NOAA-EMC / NCEPLIBS

Top level repo containing submodules for NCEPLIBS and associated dependencies for superproject builds
Other
42 stars 18 forks source link

Logical flaw when creating the shell script to set environment variables #53

Closed climbfuji closed 4 years ago

climbfuji commented 4 years ago

On systems where netCDF is loaded as a module, the current logic searches for it using

find_package(NetCDF REQUIRED MODULE)

in the top-level CMakeLists.txt. This requires the environment variable NETCDF to be set when invoking cmake, but it does not set the NETCDF cmake variable. As a consequence, the scripts setenv_nceplibs.sh and setenv_nceplibs.csh are populated with

setenv NETCDF ""

If netCDF is built as part of NCEPLIBS-external (i.e. the netcdf libraries are in the PATH and LD_LIBRARY_PATH after sourcing the shell script) or on systems where modulefiles are used (i.e. the shell scripts are not sourced) , this is no problem. We should augment the findNetCDF.cmake package to set the cmake variable NETCDF correctly.

This is high priority for the beta03 tag of NCEPLIBS.

climbfuji commented 4 years ago

@kgerheiser @mark-a-potts FYI

climbfuji commented 4 years ago

This will be fixed by https://github.com/NOAA-EMC/CMakeModules/pull/23.

climbfuji commented 4 years ago

Fixed.