Project

General

Profile

cdo cannot find netcdf

Added by yi li over 7 years ago

I am reading some nc file and get the following error:

liyi@LAPTOP-UKQF6VCI:~/d/projects/bcsd-python/data$ cdo griddes $merra > merra_grid
cdo griddes: Open failed on >merra_example.nc<
Unsupported file type (library support not compiled in)

In my /usr/lib folder, there is a libnetcdf.so.7.1.1 file and a libnetcdf.so.7 file.
After getting this error, I installed netcdf again in /usr/lib/netcdf/4.4.1.1. But I still get the same error: unsupported file type.

Note that I am using the bash on Windows 10, and get this problem. I can do the same thing on my ubuntu laptop without any problem.

Here is my cdo version, which seems to have netCDF(but have a $ in the end, I don't know why).

liyi@LAPTOP-UKQF6VCI:/usr/lib$ cdo -V
Climate Data Operators version 1.6.2 (http://code.zmaw.de/projects/cdo)
Compiler: gcc -std=gnu99 -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -pedantic -fPIC -pthread
version: gcc (Ubuntu/Linaro 4.8.2-4ubuntu1) 4.8.2
Compiled: by buildd on allspice (x86_64-unknown-linux-gnu) Nov 15 2013 17:10:54
Features: PTHREADS Z JASPER PROJ.4 MAGICS
Libraries: proj/4.7
Filetypes: srv ext ieg grb grb2 nc
CDI library version : 1.6.2 of Nov 15 2013 17:10:44
GRIB_API library version : 1.10.4
netCDF library version : 4.1.3 of Feb 24 2014 21:05:37 $
HDF5 library version : 1.8.11
SERVICE library version : 1.3.1 of Nov 15 2013 17:10:28
EXTRA library version : 1.3.1 of Nov 15 2013 17:10:20
IEG library version : 1.3.1 of Nov 15 2013 17:10:24
FILE library version : 1.8.2 of Nov 15 2013 17:10:20


Replies (2)

RE: cdo cannot find netcdf - Added by Ralf Mueller over 7 years ago

Hi!

yi li wrote:

I am reading some nc file and get the following error:

liyi@LAPTOP-UKQF6VCI:~/d/projects/bcsd-python/data$ cdo griddes $merra > merra_grid
cdo griddes: Open failed on >merra_example.nc<
Unsupported file type (library support not compiled in)

In my /usr/lib folder, there is a libnetcdf.so.7.1.1 file and a libnetcdf.so.7 file.
After getting this error, I installed netcdf again in /usr/lib/netcdf/4.4.1.1. But I still get the same error: unsupported file type.

you can look up, which library version is used by cdo by calling ldd on the cdo binary like

ldd /usr/bin/cdo
If you install a new version, it's not autoamically used by CDO, you have to re-link (or rebuild + install) cdo.

Note that I am using the bash on Windows 10, and get this problem. I can do the same thing on my ubuntu laptop without any problem.

this is a little bit confusing. you're using cygwin, right?

Here is my cdo version, which seems to have netCDF(but have a $ in the end, I don't know why).

this is just the default prompt of bash

liyi@LAPTOP-UKQF6VCI:/usr/lib$ cdo -V
Climate Data Operators version 1.6.2 (http://code.zmaw.de/projects/cdo)
Compiler: gcc -std=gnu99 -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -pedantic -fPIC -pthread
version: gcc (Ubuntu/Linaro 4.8.2-4ubuntu1) 4.8.2
Compiled: by buildd on allspice (x86_64-unknown-linux-gnu) Nov 15 2013 17:10:54
Features: PTHREADS Z JASPER PROJ.4 MAGICS
Libraries: proj/4.7
Filetypes: srv ext ieg grb grb2 nc
CDI library version : 1.6.2 of Nov 15 2013 17:10:44
GRIB_API library version : 1.10.4
netCDF library version : 4.1.3 of Feb 24 2014 21:05:37 $
HDF5 library version : 1.8.11
SERVICE library version : 1.3.1 of Nov 15 2013 17:10:28
EXTRA library version : 1.3.1 of Nov 15 2013 17:10:20
IEG library version : 1.3.1 of Nov 15 2013 17:10:24
FILE library version : 1.8.2 of Nov 15 2013 17:10:20

this looks ok, in fact. but why do you use such an old version? what about the cygwin binary for 1.7.2: https://code.zmaw.de/attachments/download/12761/cdo-1.7.2-cygwin64.zip. I suspect, that you versiin is an old-cross-compiled one ...

RE: cdo cannot find netcdf - Added by yi li over 7 years ago

Thanks Ralf!

It works now, even though I don't know exactly why. But as you pointed out the old version of cdo, I reinstalled it (I used to install it by "apt-get install cdo", and that's maybe why the version is very old).

I am using the linux bash on Windows 10, which is a new feature in Windows 10. This post also helps:

https://code.zmaw.de/boards/1/topics/3826

Thank you very much!

    (1-2/2)