-
Notifications
You must be signed in to change notification settings - Fork 3
CMake build system #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
FWIW would it be possible to keep the two build systems side-by-side for a little while (not delete the automake stuff)? Longer term obviously better to settle on just one and I'm fine if it's cmake, but while things are under development I'd also prefer to keep the build system I'm more comfortable with. |
Thanks for the catch, I'll look into that. Usually I run the tests with ASAN enabled but I might have missed one. Maybe I'll add that to the CI as well. |
.github/workflows/build.yaml
Outdated
cc: [gcc, clang] | ||
os: [ubuntu-latest, macos-15, macos-14] | ||
gcc: [12, 14] | ||
cmake_options: ["", "-DENABLE_ASAN=ON"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I see you already did that here 👍
This sounds good to me. It should only take a couple reverts to get this back to a working state with both build systems, so I'll do that now. |
80a8685
to
35c260b
Compare
oops, that's weird--I wonder why the build failed on my last commit, when it was passing before. |
* asdf -> asdf_cli * Ensure libasdf produces libasdf.a, not liblibasdf.a * Maybe fix submodules not initializing
* Link STC to libm * Set visibility=hidden compiler option for all sources * Remove defines that are configured by the build system globally
# Conflicts: # Makefile.am # configure.ac # tests/Makefile.am
* Fix up source and binary archive generation
This reverts commit 091e65c.
This reverts commit cb9bb52.
This reverts commit 350851c
* Add documentation build to workflow
* Accept SPHINX_FLAGS from cache
ofc one may have other local build directories and those can be added in .git/info/exclude, but at least include the standard "build/" directory by default
I guess maybe at some point you rebased on main? Anyways I just rebased as well and added a new source file to |
option to flip all tests on Otherwise, I think I agree with making things like the shell tests optional. Going to try to add the header tests and doctests now too
Thing I seem to have learned, unless I'm missing something. ISTM CPack doesn't have some equivalent of Likewise I'm looking into it because I don't want to give up on this approach just because of that. |
After a fair bit of mucking around found a nice enough way to make this work, though adding new doctests will require re-running cmake I think; that's fine
Nice--I got the "weird" tests working, and I'm actually a bit happier with how they work under cmake. Now my only quibble is with the source distribution, but I've been doing research an I think I understand the differences in philosophy a little better. CPack is in of itself a standalone program that can just be invoked through cmake, I get that. Its strength seems to be more in its ability to generate different kinds of binary packages. It's not really as worried about "pristine" source distributions the way GNU is. It still seems to be a shame though; I think all the necessary information is available in cmake's build tree to determine what files are needed for a reproducible build, so to whitelist rather than throw the whole kitchen sink in. I won't worry about it too much for now as long as the autotools build system is coexisting, but I wonder if I could cobble together some way to emulate |
I did emulate it for hstcal before ever realizing the There I used EDIT: This is the custom target that builds the archive: So implementing |
examples/asdf_dump_key.c
Outdated
|
||
// Yanked out of ndarray code, and modified to partially handle ASCII and UCS4 | ||
// This handy function really should be exported... | ||
static ssize_t asdf_ndarray_datatype_size(const asdf_datatype_t type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably could be--it's somewhat useful. Though since #50 there is a more robust asdf_datatype_t
type attached to each ndarray which also has on it the byte size of the datatype (including support for strings, tables, etc.)
Oops, I think you accidentally committed the compression stuff to the same branch. I'll split it off to its own branch. I'm not sure I want to merge the example code but this is still really useful stuff to have as proof-of-concept. I think I'm happy enough now to merge the version of this from the other day as-is. I have some ideas for the |
That's fair, the compression stuff is way out of scope. @nden had asked me to whip up a working example to pass along to some folks that wanted to read data from a Level 3 Roman ASDF file using libasdf. Everything I was handed to play with was compressed with LZ4 so that's how I ended up going down the rabbit hole. I'll just drop the compression commits from this branch and open a new PR to implement the cmake side of the compression stuff without the example code. You'll need to link to these libraries eventually anyway. |
This PR replaces GNU Autotools with CMake.
I encountered a couple issues that might be a bit out of scope:
munit
might be incompatible with the latest macOS SDK on 15test-ndarray.c