Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

libnetcdf not found in wrfhydro/dev:base #151

Open
sporella opened this issue Apr 26, 2024 · 4 comments
Open

libnetcdf not found in wrfhydro/dev:base #151

sporella opened this issue Apr 26, 2024 · 4 comments
Assignees

Comments

@sporella
Copy link

sporella commented Apr 26, 2024

Hello:

I had a functional workflow with the wrfhydro/dev:base image two years ago. I'm using the model again, but I have this error message:

error while loading shared libraries: libnetcdf.so.19: cannot open shared object file: No such file or directory

I exported the netcdf path and compile again, but now I have this error:

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

My folder is a simple test case that worked with the old version of the image. What I'm missing?

Thanks!

@sporella sporella changed the title libnetcdf not found in wrfhrydo/dev:base libnetcdf not found in wrfhydro/dev:base Apr 27, 2024
@scrasmussen
Copy link
Member

Hi, thanks for letting us know about this, I'll take a look into this. We had to update the Dockerfile recently so this is probably from those changes. Just to double check you're using the wrfhydro/dev:base image and trying to build the current WRF-Hydro main branch? If the setup is different please let us know, thanks

@scrasmussen scrasmussen self-assigned this Apr 29, 2024
@sporella
Copy link
Author

Hi, thanks for your answer. My workflow uses version 5.1.1. I tested it also with version 5.2.0 and I had the same issue

@scrasmussen
Copy link
Member

Hi, so I ran the newer Docker container and the issue is that the apt-get installation installs the NetCDF library in a different path than the previous method. You can use the command $ nf-config --flibs to see the command line argument to point to the library. From there you can double check the path to add the library location with ls.

docker@642d30d31452:~/wrf_hydro_nwm_public/src/Run$ ls /usr/local/lib/
libfmpich.so  libmpi.so.12.3.1  libmpicxx.la         libmpifort.la         libnetcdf.a         libnetcdf.so.19.2.2  libnetcdff.so.7
libmpi.a      libmpich.so       libmpicxx.so         libmpifort.so         libnetcdf.la        libnetcdff.a         libnetcdff.so.7.2.0
libmpi.la     libmpichcxx.so    libmpicxx.so.12      libmpifort.so.12      libnetcdf.settings  libnetcdff.la        libopa.so
libmpi.so     libmpichf90.so    libmpicxx.so.12.3.1  libmpifort.so.12.3.1  libnetcdf.so        libnetcdff.settings  pkgconfig
libmpi.so.12  libmpicxx.a       libmpifort.a         libmpl.so             libnetcdf.so.19     libnetcdff.so        python3.10

Then by adding the path to the environment variable LD_LIBRARY_PATH the runtime will know where to look to include it. The following command should work for this Docker image:

$ export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH

@sporella
Copy link
Author

sporella commented May 9, 2024

Hi, the command above solves the issue! Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants