Skip to content

Stop GCHP build if CMake detects library conflicts from a Conda environment #520

@yantosca

Description

@yantosca

Your name

Bob Yantosca

Your affiliation

Harvard + GCST

Provide a clear and concise overview of the new feature requested.

We have seen that building GCHP when a conda environment containing ESMF is activated can lead to comipilation warnings. Or worse, GCHP can be linked against the wrong library version:

runtime library [libstdc++.so.6] in /n/sw/helmod-rocky8/apps/Core/gcc/12.2.0-fasrc01/\
lib64/../lib64 may be hidden by files in:
      /n/jacob_lab/Users/ryantosca/mamba/envs/gcpy_env/lib
    runtime library [libnetcdff.so.7] in /n/sw/helmod-rocky8/apps/MPI/gcc/12.2.0-fasrc01/\
openmpi/4.1.4-fasrc01/netcdf-fortran/4.6.0-fasrc02/lib may be hidden by files in:
      /n/jacob_lab/Users/ryantosca/mamba/envs/gcpy_env/lib
    runtime library [libnetcdf.so.19] in /n/sw/helmod-rocky8/apps/MPI/gcc/12.2.0-fasrc01/\
openmpi/4.1.4-fasrc01/netcdf-c/4.9.2-fasrc01/lib64 may be hidden by files in:
      /n/jacob_lab/Users/ryantosca/mamba/envs/gcpy_env/lib
    runtime library [libgomp.so.1] in /n/sw/helmod-rocky8/apps/Core/gcc/12.2.0-fasrc01/li\
b64 may be hidden by files in:
      /n/jacob_lab/Users/ryantosca/mamba/envs/gcpy_env/lib

  Some of these libraries may not be found correctly.

We could add a check in the relevant CMakeLists.txt to stop the build if hidden libraries are found. Or at the very least, if a conda environment is activated (i.e. if the $CONDA_DEFAULT_ENV envvar is defined).

Tagging @lizziel

Reference(s)

No response

Will you be implementing this feature yourself?

Yes, but I will need some help

Additional information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions