Skip to content
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

Unset LDFLAGS and CMAKE_PREFIX_PATH variables #282

Conversation

SeanBryan51
Copy link
Collaborator

CABLE is linked against incorrect libraries for netcdf and MPI when running benchcab (v4.0.2) from the hh5 conda environment. The issue is due to environment variables being set which affect the behaviour of the build, notably LDFLAGS and CMAKE_PREFIX_PATH, which point CMake to find the netcdf and MPI libraries installed in the current conda environment. This change unsets these variables so that CMake finds the appropriate libraries which get loaded in as modules.

Fixes #279

CABLE is linked against incorrect libraries for netcdf and MPI when
running benchcab (v4.0.2) from the hh5 conda environment. The issue is
due to environment variables being set which affect the behaviour of the
build, notably LDFLAGS and CMAKE_PREFIX_PATH, which point CMake to find
the netcdf and MPI libraries installed in the current conda environment.
This change unsets these variables so that CMake finds the appropriate
libraries which get loaded in as modules.

Fixes #279
Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 71.07%. Comparing base (59910ed) to head (95bbab1).
Report is 2 commits behind head on main.

Files Patch % Lines
src/benchcab/model.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #282      +/-   ##
==========================================
- Coverage   72.81%   71.07%   -1.74%     
==========================================
  Files          18       18              
  Lines         982      968      -14     
==========================================
- Hits          715      688      -27     
- Misses        267      280      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SeanBryan51
Copy link
Collaborator Author

I cloned the hh5 analysis3-unstable environment (using mamba create --name analysis3-unstable-clone --clone analysis3-unstable). The error described in #279 was reproduced and was fixed in the cloned environment.

@ccarouge
Copy link
Collaborator

I am guessing this does not affect the build of CABLE outside of benchcab because when using build.bash it does a module purge that gets rid of all these environment variables.

Copy link
Collaborator

@ccarouge ccarouge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SeanBryan51 SeanBryan51 merged commit 5c526e4 into main Apr 17, 2024
2 of 4 checks passed
@SeanBryan51 SeanBryan51 deleted the 279-cable-linked-against-incorrect-libraries-when-run-from-the-hh5-conda-environment branch April 17, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CABLE linked against incorrect libraries when run from the hh5 conda environment
2 participants