libnetcdf.so.7 error

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
jande023
Posts: 29
Joined: Tue Oct 16, 2012 8:55 pm
Location: Old Dominion Universiy

libnetcdf.so.7 error

#1 Unread post by jande023 »

I have installed ROMS and netcdf 4.1.3 and have successfully run the Upwelling and Estuary Sediment Test cases. However, recently I started getting an error each time I try to execute ROMS, e.g.,

./oceanS < ocean_estuary_test.in > estuary.out &

Note, I get the same message trying to run the upwelling test now, specifically:

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

the file libnetcdf.so.7 does appear in the netcdf/lib path and the size is 18B. Is the file possibly corrupt? Should I replace the file with a copy from my download source code or do I need to reinstall netcdf? Is there another possible cause and/or solution?

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: libnetcdf.so.7 error

#2 Unread post by kate »

I don't know why it would have worked before, but one thing that can happen is that the model will link just fine, but at run time, the shared libraries need to be in directories in your LD_LIBRARY_PATH environment variable. Do you have that environment variable set? Does it include the directory with your netcdf library? The way to set it depends on what shell you are using.

jande023
Posts: 29
Joined: Tue Oct 16, 2012 8:55 pm
Location: Old Dominion Universiy

Re: libnetcdf.so.7 error

#3 Unread post by jande023 »

Thank you Kate. Yes I run the command:

setenv LD_LIBRARY_PATH/$HOME/netcdf/lib

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: libnetcdf.so.7 error

#4 Unread post by kate »

jande023 wrote:Thank you Kate. Yes I run the command:

setenv LD_LIBRARY_PATH/$HOME/netcdf/lib
You need a space between LD_LIBRARY_PATH and the path that follows. You can check by typing "printenv LD_LIBRARY_PATH" to see that it's set correctly.

jande023
Posts: 29
Joined: Tue Oct 16, 2012 8:55 pm
Location: Old Dominion Universiy

Re: libnetcdf.so.7 error

#5 Unread post by jande023 »

Feeling pretty silly. The space did the trick. Thank you.

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: libnetcdf.so.7 error

#6 Unread post by HugoMichel »

i have the same error when i try to run the scrip_test but with libnetcdff.so.6 i have this in my bash_profile:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
export PATH=/opt/subversion/bin:$PATH

export CPPFLAGS="-I/usr/local/hdf5-1.8.13/include -I/usr/local/zlib-1.2.8/include -I/usr/local/netcdf.4.3.2/include"
export LDFLAGS="-L/usr/local/hdf5-1.8.13/lib -L/usr/local/zlib-1.2.8/lib -L/usr/local/netcdf.4.3.2/lib"
export LD_LIBRARY_PATH="/usr/local/hdf5-1.8.13/lib /usr/local/zlib-1.2.8/lib /usr/local/netcdf.4.3.2/lib"

export NETCDF=/usr/local/netcdf.4.3.2
export NETCDF_INCDIR=/usr/local/netcdf.4.3.2/include
export NETCDF_LIBDIR=/usr/local/netcdf.4.3.2/lib

export MCT_INCDIR=/usr/local/include
export MCT_LIBDIR=/usr/local/lib

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: libnetcdf.so.7 error

#7 Unread post by kate »

export LD_LIBRARY_PATH="/usr/local/hdf5-1.8.13/lib /usr/local/zlib-1.2.8/lib /usr/local/netcdf.4.3.2/lib"
It's all about the spaces again. In this context, it should be colons instead as in your path:
export LD_LIBRARY_PATH="/usr/local/hdf5-1.8.13/lib:/usr/local/zlib-1.2.8/lib:/usr/local/netcdf.4.3.2/lib"

HugoMichel
Posts: 13
Joined: Tue Aug 04, 2015 4:42 pm
Location: Universidad Del Mar

Re: libnetcdf.so.7 error

#8 Unread post by HugoMichel »

i did this thaks and i think that this is solved, but when i run scrip_test showme that:

[michel@localhost SCRIP]$ ./scrip_test
&REMAP_INPUTS
FIELD_CHOICE= 2,
INTERP_FILE="rmp_T42_to_POP43_conserv.nc ",
OUTPUT_FILE="out_T42_to_POP43_conserv.nc ",
/
Error in netCDF: No such file or directory

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: libnetcdf.so.7 error

#9 Unread post by kate »

Then this becomes a question for some other forum. Is this scrip for setting up COAWST? Take it to the COAWST forum then. Do you think it has the file it can't find or did you not read the error message?

johan.navarro.padron
Posts: 7
Joined: Mon Dec 05, 2011 3:29 pm
Location: Instituto de oceanolodia(IDO)

Re: libnetcdf.so.7 error

#10 Unread post by johan.navarro.padron »

Hello everyone,
I have the same issue (error while loading shared libraries libnetcdf.so.7), and I made "export LD_LIBRARY_PATH=/usr/local/lib:$PATH" and the problem still remain.
I'm trying to run in a Rock Cluster.
Grettings

Post Reply