Does CESM2 supports netcdf shared libraries?

adrienD

Adrien Damseaux
Member
I'm working on porting CESM 2 to the German supercomputer Mistral. My building is working fine. However, when I try to make any runs, I have the following error message:

Code:
/work/aa0049/a271098/CTSM/scratch/I1850CLM50_021/bld/cesm.exe: error while loading shared libraries: libnetcdff.so.6: cannot open shared object file: No such file or directory

Mistral is using netcdf shared libraries (one for C, one for Fortran) and I am not sure if CESM supports that (I cannot find any other example in config_machines.xml). When I'm looking to the .pio bld log file, I can find that:

Code:
-- Found NetCDF_C: /sw/rhel6-x64/netcdf/netcdf_c-4.3.2-intel14/lib/libnetcdf.so 
-- Checking NetCDF version
-- Checking NetCDF version - failed
-- Checking whether NetCDF has parallel support
-- Checking whether NetCDF has parallel support - no
-- Looking for nc_set_log_level
-- Looking for nc_set_log_level - not found
-- Found NetCDF_Fortran: /sw/rhel6-x64/netcdf/netcdf_fortran-4.4.3-intel14/lib/libnetcdff.so

Does someone has an idea what I should do? Should I contact my sysadmin?

Thanks,
Adrien
 

jedwards

CSEG and Liaisons
Staff member
If the error above is presented at run-time the issue is that the path to your shared library isn't set,
you can set it using LD_LIBRARY_PATH environment variable or the rpath flag in the link step.
 

adrienD

Adrien Damseaux
Member
Thanks a lot, this problem is solved. If someone has the same problem I just set up LD_LIBRARY_PATH like that:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sw/rhel6-x64/netcdf/netcdf_c-4.3.2-gcc48/lib/:/sw/rhel6-x64/netcdf/netcdf_fortran-4.4.2-intel14/lib/
 

QINKONG

QINQIN KONG
Member
If the error above is presented at run-time the issue is that the path to your shared library isn't set,
you can set it using LD_LIBRARY_PATH environment variable or the rpath flag in the link step.
I saw that some examples in config_compilers.xml put netcdf_fortran lib into SLIB. Does that mean that the following three things have equivalent effects?
(1) append netcdf_fortran lib in SLIB
(2) set rpath flag in LDFLAGS
(3) set LD_LIBRARY_PATH environment variable.

Thanks!
 

QINKONG

QINQIN KONG
Member
yes these should all amount to the same thing
Thanks. Also, I feel confused about what should be appended in SLIB. Based on the examples in config_compilers.xml file, netcdf lib is generally included. Some examples include lapack, blas, hdf5, zlib and others. Does cesm has a minimum requirement of what should be included in SLIB?
 

jedwards

CSEG and Liaisons
Staff member
It's really very system and compiler dependent - some compilers provide replacements for lapack and blas. Some
systems build netcdf in a way that doesn't require the app to specifically link hdf5 and zlib even though they are used.
 

QINKONG

QINQIN KONG
Member
It's really very system and compiler dependent - some compilers provide replacements for lapack and blas. Some
systems build netcdf in a way that doesn't require the app to specifically link hdf5 and zlib even though they are used.
Yeah. Thanks for the answer!
 

xliu

Jon
Member
I have similar error, updating the SLIB doesn't work.

can anyone help check following setting? Thanks

-- The C compiler identification is GNU 7.5.0
-- The Fortran compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/mpicc
-- Check for working C compiler: /usr/bin/mpicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working Fortran compiler: /usr/bin/mpif90
-- Check for working Fortran compiler: /usr/bin/mpif90 -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/mpif90 supports Fortran 90
-- Checking whether /usr/bin/mpif90 supports Fortran 90 -- yes
-- Found NetCDF_C: /usr/local/netcdf/lib/libnetcdf.so
-- Checking NetCDF version
-- Checking NetCDF version - 4.7.4./*!<
-- Checking whether NetCDF has parallel support
-- Checking whether NetCDF has parallel support - no
-- Looking for nc_set_log_level
-- Looking for nc_set_log_level - found
-- Found NetCDF_Fortran: /usr/local/netcdf/lib/libnetcdff.so
-- Found PnetCDF_Fortran: /usr/local/pnetcdf/lib/libpnetcdf.a
-- Checking PnetCDF version
-- Checking PnetCDF version - 1.12.2
-- MPIIO detected and enabled.
-- MPI Fortran module detected and enabled.
-- Configuring done
-- Generating done
 
Back
Top