./geogrid.exe: error while loading shared libraries: libnetcdf.so.7: cannot open shared object file: No such file or directory
Closed this issue · 17 comments
Describe the bug
i have successfully installed wrf using wrf-mosit on ubuntu 22.04 on wsl.
After setting my domain etc in the namelist.wps file, when I run the geogrid program, I get this error:
./geogrid.exe: error while loading shared libraries: libnetcdf.so.7: cannot open shared object file: No such file or directory
Are you using GNU or Intel compilers @ginpain ?
I'm using the GNU compiler
I'm using the GNU compiler
Did you export the libraries prior to running geogrid?
#!/bin/bash
#setting environment for WRF model to run
export LD_LIBRARY_PATH=/home/workhorse/WRF/Libs/NETCDF/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/home/workhorse/WRF/Libs/grib2/lib:$LD_LIBRARY_PATH
export PATH=/home/workhorse/WRF/Libs/MPICH/bin:$PATH
export PATH=/home/workhorse/WRF/Libs/grib2/lib:$PATH
The paths will be similar to this
No, i did not export the libraries, are these the only ones i need to export?
No, i did not export the libraries, are these the only ones i need to export?
Should be.
Just change the pathing names to match your system.
i did it, and changed the path to my user, but the geogrid still gives the same error
do you have another version of WRF on this user account or modified the bashrc file?
No i don't have another versions of wrf and i did not modify the bashrc file
okay, hmm try checking the netcdf file folder for that file that it says it can't find. If it exists then we have a different issue than if it doesn't.
positive update about the error : the geogrid.exe works successfully only when i export the libs but if i open a new terminal session i have to export the libs again
ah so that's what it was
So you were sucessful @ginpain
I apologize for the delayed response, Mr. @HathewayWill The issue has been resolved. Now, I'm wondering if it would be appropriate to include the export lines in the bashrc file to ensure they are permanent.
I previously have done that but the issue I ran into was that if someone wanted to install another version of wrf on their system then having the exports in the bashRC file would make the other one error out.
I'm trying to put something in the readme file about how to export it properly in the terminal
Thank you so much for your assistance! I truly appreciate your help and commend your efforts in creating such an incredible script WRF-MOSIT. It has certainly made the installation process much more manageable for me as a beginner. I eagerly await any updates you make to the readme file. Thanks again!
You are very welcome. I'm going to close this issue now since we resolved it.