HPSCTerrSys / eCLM

Fork of Community Land Model v5.0
https://hpscterrsys.github.io/eCLM/
Other
8 stars 13 forks source link

Error with libraries while running eclm.exe #15

Closed AdrienDams closed 2 years ago

AdrienDams commented 2 years ago

I am still trying to use eCLM on Levante. I came across this error when running eclm.exe :

(base) [a271098@levante6 1x1_wuestebach]$ ../../lib/bin/eclm.exe 
../../lib/bin/eclm.exe: error while loading shared libraries: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory

Any ideas what I can do?

kvrigor commented 2 years ago

Have you loaded the necessary modules before running eCLM? It should be the same modules as those you used for building your model: https://github.com/HPSCTerrSys/eCLM/issues/13#issuecomment-1048577038

AdrienDams commented 2 years ago

Here is the list of my modules

(base) [a271098@levante3 1x1_wuestebach]$ module list
Currently Loaded Modulefiles:
 1) git/2.31.1-gcc-11.2.0                                
 2) intel-oneapi-compilers/2022.0.1-gcc-11.2.0           
 3) intel-oneapi-mpi/2021.5.0-gcc-11.2.0                 
 4) intel-oneapi-mkl/2022.0.1-gcc-11.2.0                 
 5) netcdf-c/4.8.1-openmpi-4.1.2-intel-2021.5.0          
 6) netcdf-fortran/4.5.3-openmpi-4.1.2-intel-2021.5.0    
 7) parallel-netcdf/1.12.2-openmpi-4.1.2-intel-2021.5.0  
(base) [a271098@levante3 1x1_wuestebach]$ ../../lib/bin/eclm.exe 
../../lib/bin/eclm.exe: error while loading shared libraries: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory
kvrigor commented 2 years ago

The issue is that the LD_LIBRARY_PATH is not being updated by the module load commands. The workaround is to manually set the LD_LIBRARY_PATH:

# Prepend paths to Intel MKL libraries
source $MKLROOT/env/vars.sh

# Prepend netCDF C library path
export LD_LIBRARY_PATH="/sw/spack-levante/netcdf-c-4.8.1-2k3cmu/lib:$LD_LIBRARY_PATH"

# Prepend netCDF Fortran library path
export LD_LIBRARY_PATH="/sw/spack-levante/netcdf-fortran-4.5.3-k6xq5g/lib:$LD_LIBRARY_PATH"

# Prepend parallel netCDf library path
export LD_LIBRARY_PATH="/sw/spack-levante/parallel-netcdf-1.12.2-mc24h4/lib:$LD_LIBRARY_PATH"

This solution is definitely not pretty; I would suggest that you ask Levante maintainers to update their modulefiles to include the LD_LIBRARY_PATH. module load is supposed to automatically set important environment variables so that the users don't have to.

AdrienDams commented 2 years ago

It's fixed! Thanks a lot. I have also sent an e-mail to Levante maintainers about this issue.