Project

General

Profile

cdo-1.5.4 installation error "cdo: error while loading shared libraries: libnetcdf.so.7"

Added by David Adams over 12 years ago

Hi all
I am try to install the CDO package on my Linux X64 Desktop (Fedora 16)
in order to convert GrADS ctl binary file to a netcdf file.

I have compiled the Netcdf package, and then configure cdo-1.5.4.

./configure --with-netcdf=/netcdf-4.1.3

Everything appears to work fine, but when I enter the command
cdo -V
I get
cdo: error while loading shared libraries: libnetcdf.so.7: cannot open shared object file: No such file or directory

To find this file I checkwith locate libnetcdf.so.7 and I get
/netcdf-4.1.3/liblib/.libs/libnetcdf.so.7
/netcdf-4.1.3/liblib/.libs/libnetcdf.so.7.1.1
/usr/local/lib/libnetcdf.so.7
/usr/local/lib/libnetcdf.so.7.1.1

So the file exists, but is not being found.

any ideas,
thanks,
David


Replies (1)

RE: cdo-1.5.4 installation error "cdo: error while loading shared libraries: libnetcdf.so.7" - Added by Ralf Mueller over 12 years ago

The point is: /netcdf-4.1.3 is not in you library search path. you seem do have a netcdf installation in /usr/local. You could use it with

./configure --with-netcdf=/usr/local

Use
ldconfig -p
to see, which libraries can be found by default. I bet /netcdf-4.1.3/lib/lib/libnetcdf.so is not there. If you really REALLY have to use /netcdf-4.1.3, you do one of the folloing steps:

  • add /netcdf-4.1.3/lib to you default load path by changing /etc/ldconfig.conf or add a file in /etc/ldconfig.d/ (root privileges required)
  • Add
    LD_LIBRARY_PATH=/netcdf-4.1.3/lib:$LD_LIBRARY_PATH
    to your .profile, but this will only work for you
  • same as above, but for /etc/profile (as root). will work for everybody
  • build cdo with static linking:
    ./configure --with-netcdf=/netcdf-4.1.3 CFLAGS=-static

It's a bit strange, that libtool does not handle this for you.

    (1-1/1)