Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

(RESOLVED) Geogrid Error: error while loading shared libraries:

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.


New member
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: cannot open shared object file: No such file or directory

Any ideas why netcdf is having problems?
It could be possible that NetCDF has been updated since you built WPS. Check your netcdf path (echo $NETCDF) and see if that library exists there. If you happen to be using Cheyenne's supercomputer, try logging out and logging back in (it sounds silly, but this has gotten me past this error in the past).
This might just be an issue of correctly setting the LD_LIBRARY_PATH environment variable to include the path to the netCDF shared library.

Thanks for always helping out guys. I still cannot spot whats going wrong.
I tried echo$NETCDF. And I get this response:
echo/home/ggp17mkm/Build_WRF/LIBRARIES/libs/netcdf/: No such file or directory

I have treid logging out and in of my uni HPC several times. Doesn't solve the issue.
I have attached the screenshot of what I have in the netcdf folder.

Also, my .bashrc file has these paths set:

# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc

# Uncomment the following line if you don't like systemctl's auto-paging feature:

# User specific aliases and functions
export DIR="/home/ggp17mkm/Build_WRF/LIBRARIES/libs"
export CC="gcc"
export CXX="g++"
export FC="gfortran"
export FCFLAGS="-m64"
export F77="gfortran"
export FFLAGS="-m64"
export PATH="$DIR/netcdf/bin:$PATH"
#export HDF5="/usr/local/modulefiles/staging/eb/all/HDF5/"
export NETCDF="/home/ggp17mkm/Build_WRF/LIBRARIES/libs/netcdf/"
#export PATH="$DIR/mpich/bin:$PATH"
export LDFLAGS="-L$DIR/grib2/lib"
export CPPFLAGS="-I$DIR/grib2/include"
export JASPERLIB="$DIR/grib2/lib"
export JASPERINC="$DIR/grib2/include"


  • Screenshot (135).png
    Screenshot (135).png
    30.2 KB · Views: 4,112
Can you put a space between 'echo' and $NETCDF'? The command should be:
echo $NETCDF

Ahh I see. Sorry for that silly error. I get this path as response to echo $NETCDF
Thanks for sending that. As mgduda mentioned, you may just need to set your LD_LIBRARY_PATH. If it's not already included, add the NetCDF library to the path. Something like:
export LD_LIBRARY_PATH=/path-to-netcdf-library/lib:$LD_LIBRARY_PATH
Let me know if that makes any difference.

As my netcdf path is: /home/ggp17mkm/Build_WRF/LIBRARIES/libs/netcdf/

I have added this to my .bashrc file:

I logged out and in again, then issued ./geogrid.exe, but still have the same error.
I think you may be missing the beginning "/" character, and you need to add the suffix "/lib" (assuming that agrees with the installation path of the files like "libnetcdf.a". Also, you need to export the variable. Can you try the following:
export LD_LIBRARY_PATH=/home/ggp17mkm/Build_WRF/LIBRARIES/libs/netcdf/lib:$LD_LIBRARY_PATH
? You can even run this export command directly in your shell to test.
Thanks for all the help :) I really appreciate it. the netcdf error seems to have solved. However there are these errors now:

Processing domain 1 of 1
Processing XLAT and XLONG

Program received signal SIGSEGV: Segmentation fault - inavlid memory reference.

Backtrace for this error:

0x7F497F7E in ext_ncd_inquiry
0x43216A in_output_module_MOD_output_init
0x43B3E5 in_process_tile_module_MOD_process_tile
Segmentation fault
Thanks for updating the post to let us know that the original error is corrected. Do you mind posting the new problem as a new topic inquiry, as the error is different now. It helps to keep topics separated, organized, and more searchable. When you do post it, please also attach your namelist.wps file, along with the full geogrid.log. Thanks!