Project

General

Profile

Trying to compile CDO with netCDF libraries

Added by Tom Crowley over 12 years ago

All

I am trying to compile the CDO application on a Red Hat 5.97 Linux machine. I've untarred the CDO 1.5.3 version in a /root/downloads directory. I've also downloaded and installed the netCDF 4.1.3 source code in the /root/downloads/netCDF_C directory. When I try to run the ./configure --with-netcdf=/root/downloads/netCDF_C/netcdf-4.1.3 command, the application seems like it is compiling o.k. until it gets to the end. It is giving me the following lines, showing CDO did not compile with netCDF.

Why is it not linking to the netcdf library? I'm including my config.log file.

checking netcdf.h usability... yes
checking netcdf.h presence... yes
checking for netcdf.h... yes
checking for library containing nc_open... no
configure: error: Could not link to netcdf library

Any ideas would be greatfully appreciated!!!

Thanks!

config.log (53.2 KB) config.log config.log file

Replies (11)

RE: Trying to compile CDO with netCDF libraries - Added by Ralf Mueller over 12 years ago

Did you really install netcdf to /root/downloads/netCDF_C/netcdf-4.1.3/? I suppose, you've only downloaded and extracted the netcdf package.

RE: Trying to compile CDO with netCDF libraries - Added by Tom Crowley over 12 years ago

I downloaded the netCDF files to /root/downloads and created a /netCDF_C directory. When I extracted the files, it created a /netcdf-4.1.3 directory with all the files in it.

RE: Trying to compile CDO with netCDF libraries - Added by Ralf Mueller over 12 years ago

But this is a source code release. You have to run

 configure && make && make install 
first, just like with cdo. Netcdf has come dependencies (e.g. to hdf5).

It's a lot easier if you use pre-compiled packaged from the package repository of your linux distribution. rpmfind might also help.

RE: Trying to compile CDO with netCDF libraries - Added by Tom Crowley over 12 years ago

Ralf,

I've gotten past my linking errors, however, now I'm having an issue with trying to convert a netCDF file to GRIB. I've linked CDO with netCDF and HDF5 libraries. When I try and convert a netCDF file to GRIB with the following command, I'm getting an error.
cdo -f grb copy 20120105_v_160000_l_0032400.nc 20120105_v_160000_l_0032400.grb

The error says the following:
cdo copy: Open failed on >20120105_v_160000_l_0032400.nc<
Unsupported file type (library support not compiled in)

Any ideas of what could be causing this?

Thanks!

RE: Trying to compile CDO with netCDF libraries - Added by Ralf Mueller over 12 years ago

Please provide the output of

cdo -V

RE: Trying to compile CDO with netCDF libraries - Added by Matthias Büchner over 8 years ago

I'm facing the same error message when compiling cdo:

checking netcdf.h usability... yes
checking netcdf.h presence... yes
checking for netcdf.h... yes
checking for library containing nc_open... no
configure: error: Could not link to netcdf library

config.log reveals, that configure looks for the library only in the [NETCDF]/lib folder. But on our HPC the library is located in the lib64 sub folder. How to get the configure script to see the libnetcdf in lib64?

Best,
Matthias

RE: Trying to compile CDO with netCDF libraries - Added by Ralf Mueller over 8 years ago

please upload the config.log file

RE: Trying to compile CDO with netCDF libraries - Added by Matthias Büchner over 8 years ago

Hi Ralf,

I just tracked down the issue to a misconfigured nc-config on our new cluster. Changing the script will most likely solve it.

Thanks for your time.

Best regards,
Matthias

RE: Trying to compile CDO with netCDF libraries - Added by Ralf Mueller over 8 years ago

Another option is conda - its precompiled for 64bit linux

RE: Trying to compile CDO with netCDF libraries - Added by Mayur Khandelwal almost 4 years ago

Hi Tom;Ralf
Actually I am facing the same problem while compiling the CDO application. Can you please explain how you solved these linking errors?

Thanks!

RE: Trying to compile CDO with netCDF libraries - Added by Ralf Mueller almost 4 years ago

hi Mayur!

why bothering yourself with handling the dependencies manually? conda is perfect for this. or spack.

cheers
ralf

    (1-11/11)