-
Notifications
You must be signed in to change notification settings - Fork 90
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
CMake fixes for netCDF #2493
CMake fixes for netCDF #2493
Conversation
CMake 3.21 on MacOS needs `\\.` rather than `\.`
Making string lowercase before regex matching the version.
When compiled from the git repo, `ncxx4-config --version` may return something like `4.3.2-developer`. However, CMake's `find_dependency()` function does not recognize that as a valid version argument. Modifying the regex to remove anything trailing the `#.#.#` version number fixes the problem.
NCXX_BINARY_DIR is not defined in cmake/FindnetCDFCxx.cmake, so never exists.
These variables can be used (rather than netCDFCxx_ROOT and netCDF_ROOT) to find the netCDF and netCDF-cxx4 libraries. `set`'ing them if they exist means packages importing BOUT++ should link to the same libraries.
@ZedThree this PR seems to fix the problems I was posting about on Slack yesterday. At least, I've managed to compile STORM against this branch. I'm not at all sure about point 3 in the description above - I couldn't see I did also try to use |
I have a feeling |
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.
LGTM, but the removed NCXX_BINARY_DIR
branch is needed for BOUT_DOWNLOAD_NETCDF_CX4
Now with explanation of why it is needed. Co-authored-by: Peter Hill <zed.three@gmail.com>
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.
Lovely, thanks @johnomotani !
next
Small CMake changes for MacOS #2455.ncxx4-config --version
be4.3.2-developer
. CMake doesn't like the-developer
suffix, so update the regex inFindnetCDFCxx.cmake
to remove it.NCXX_BINARY_DIR
inbout++Config.cmake.in
since this variable seems to never be used.set()
the variablesNC_CONFIG
andNCXX4_CONFIG
, if they exist. This allows packages that import BOUT++ to make use of these variables when finding netCDF and netCDF-cxx4, without having to pass them again.