geoschem / integrated_methane_inversion

Integrated Methane Inversion workflow repository.
https://imi.readthedocs.org
MIT License
26 stars 23 forks source link

./gcclassic: error while loading shared libraries: libnetcdff.so.7: cannot open shared object file: No such file or directory #103

Closed delgadocc closed 1 year ago

delgadocc commented 1 year ago

Dear IMI support team,

Thanks in advance for all your effort in maintaining this amazing tool. I am trying to install the IMI framework using Spack on a local server but I am getting the error "./gcclassic: error while loading shared libraries: libnetcdff.so.7: cannot open shared object file: No such file or directory" at the time of running the Spinup stage. Attached you find the configuration file (config.txt), the log file (imi_output.txt), the GEOS-CHEM enviroment file (Otago.txt) and the GEOS-CHEM build summary (CMakeCache.txt).

I thank you in advance for any help, since I have been trying to solve the problem for several weeks without any progress and this is considerably delaying my PhD thesis.

Best regards

CMakeCache.txt config.txt imi_output.txt

laestrada commented 1 year ago

Hi @delgadocc,

Thanks for using the IMI! We ask that you provide your institution, PI name, and what your application for the IMI is. This helps us to better understand our user base and prioritize new updates.

This error looks like the dynamic linker isn't finding your library path to libnetcdff.so.7. This issue explains the problem well. I think you may just need to set the env variable LD_LIBRARY_PATH. Try something like this:

export NETCDF_HOME=$(spack location -i netcdf-c)              # netCDF-C
export LD_LIBRARY_PATH=${NETCDF_HOME}/lib
export NETCDF_FORTRAN_HOME=$(spack location -i netcdf-fortran) # netCDF-Fortran
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NETCDF_FORTRAN_HOME}/lib

If this doesn't work, please also provide the CMakeCache.txt file, since it looks to have not attached properly above. Let us know if this resolves the issue!

delgadocc commented 1 year ago

Hi @laestrada

Thanks for your quick reply, I added the environmental variables into the GEOS-CHEM enviroment file (Otago.env) and the program looks that the framework is moving forward. However, I'm getting a new error so ill open a new ticket.

Thanks again for helping me!

Regards