CABLE-LSM / benchcab

Tool for evaluation of CABLE land surface model
https://benchcab.readthedocs.io/en/latest/
Apache License 2.0
2 stars 4 forks source link

Unset LDFLAGS and CMAKE_PREFIX_PATH variables #282

Closed SeanBryan51 closed 7 months ago

SeanBryan51 commented 7 months ago

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

codecov[bot] commented 7 months ago

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 :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

SeanBryan51 commented 7 months ago

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 commented 7 months ago

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.