I ran
./build.sh
which gave me the executable file oceanG, but when I tried to run it I got the following error message:
./oceanG: error while loading shared libraries: libnetcdf.so.7: cannot open shared object file: No such file or directory
does anyone have any ideas how to go about fixing this?
Compiling finished but won't run (solved)
Compiling finished but won't run (solved)
Last edited by lteeter on Tue Aug 07, 2012 9:13 pm, edited 1 time in total.
Re: Compiling finished but won't run
Managed to figure this out; for anyone having similar problems it looks like my libnetcdf.so.7 file was installed in /usr/local/lib which apparently isn't searched, so I had to add it to the library path:
export LD_LIBRARY_PATH="/usr/local/lib/:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/usr/local/lib/:$LD_LIBRARY_PATH"
- arango
- Site Admin
- Posts: 1367
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
Re: Compiling finished but won't run (solved)
Notice that in the build script you have control of the location of the compilers and libraries. We usually install the NetCDF library with the following possibilities:
where XXX is the compiler (gfortran, ifort, pgi, etc). You can make a directory link to the NetCDF version so you can have many of them and use the one in the assigned link. As you can see, there are many possibilities and combinations. It is not wise to put everything in /usr/local/lib
I have mentioned several times in this forum to use the ROMS build script. This type of problem is frequently reported in this forum. Users need to be aware of it and pay attention to all the compilation messages...
Code: Select all
/opt/XXXsoft/
/mpich/
/netcdf3@
/netcdf4@
/mpich2/
/netcdf3@
/netcdf4@
/openmpi/
/netcdf3@
/netcdf4@
/serial/
/netcdf3@
/netcdf4@
I have mentioned several times in this forum to use the ROMS build script. This type of problem is frequently reported in this forum. Users need to be aware of it and pay attention to all the compilation messages...