Install Climate Data Operator (CDO) with NetCDF, GRIB2 and HDF5 support

Building CDO with Netcdf, HDF5 and GRIB2  support.

  1. Download CDO from https://code.zmaw.de/projects/cdo/files. On a unix box download using wget-  “wget https://code.zmaw.de/attachments/download/11392/cdo-1.7.0.tar.gz.”  Use the latest verion of cdo.
  2. Download NetCDF from http://www.unidata.ucar.edu/downloads/netcdf/index.jsp. Use the C version. On Unix – “wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.3.3.1.tar.gz”.
  3. Download Grib API from https://software.ecmwf.int/wiki/display/GRIB/Releases. On unix – “wget https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-1.14.4-Source.tar.gz?api=v2
  4. Download Jasper from http://www.ece.uvic.ca/~frodo/jasper/#download. On Unix – “wget http://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip
  5. Download HDF5 and zlib from ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.
  6. Create a directory that will hold the installation libs and include files. For this demonstration we use /opt/cdo-install (make sure that the directory is created)
  7. Install zlib using
    1. ./configure –prefix =/opt/cdo-install
    2.  ‘make’, ‘make check’ and ‘make install’
  8. Install HDF5 using
    1. ./configure –with-zlib=/opt/cdo-install –prefix=/opt/cdo-install CFLAGS=-fPIC
    2. ‘make’, ‘make check’ and ‘make install’
  9. Install NetCDF using (to enable dap, install libcurl from http://curl.haxx.se/download.html. Install it from source using –prefix=/opt/cdo-install/)
    1. CPPFLAGS=-I/opt/cdo-install/include LDFLAGS=-L/opt/cdo-install/lib ./configure –prefix=/opt/cdo-install CFLAGS=-fPIC
    2. ‘make’, ‘make check’ and ‘make install’
  10. Install Jasper using
    1. ./configure –prefix=/opt/cdo-install  CFLAGS=-fPIC
    2. ‘make’, ‘make check’ and ‘make install’
  11. Install grib using
    1. ./configure –prefix=/opt/cdo-install CFLAGS=-fPIC  –with-netcdf=/opt/cdo-install –with-jasper=/opt/cdo-install
    2. ‘make’, ‘make check’ and ‘make install’
  12. Install cdo using
    1. ./configure –prefix=/opt/cdo-install CFLAGS=-fPIC  –with-netcdf=/opt/cdo-install –with-jasper=/opt/cdo-install –with-hdf5=/opt/cdo-install  –with-grib_api=/opt/cdo-install
    2. ‘make’, ‘make check’ and ‘make install’

 

This should install CDO with grib, netcdf and HDF5 support. Note that the binaries are in /opt/cdo-install/bin. Add this folder to the path to make the binaries available everywhere.

23 thoughts on “Install Climate Data Operator (CDO) with NetCDF, GRIB2 and HDF5 support

  • March 25, 2013 at 7:24 pm
    Permalink

    Sir,
    I could not able install Jasper.
    It is showing like
    ********
    checking build system type… x86_64-unknown-linux-gnu
    checking host system type… x86_64-unknown-linux-gnu
    checking target system type… x86_64-unknown-linux-gnu
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking for gawk… gawk
    checking whether make sets $(MAKE)… yes
    checking for gcc… gcc
    checking for C compiler default output file name… configure: error: C compiler cannot create executables
    See `config.log’ for more details.
    ***********
    Can you suggest me..where might be wrong

    Looking forward you

    Raju

    Reply
  • March 26, 2013 at 7:02 am
    Permalink

    Dear Sir,

    Thank you very much

    Installed successfully

    Thank you for nice guidence

    Regards
    RAju

    Reply
  • August 20, 2013 at 6:44 am
    Permalink

    Dear Sir,
    I could not able install Jasper.
    It is showing like

    checking build system type… x86_64-redhat-linux-gnu
    checking host system type… x86_64-redhat-linux-gnu
    checking target system type… x86_64-redhat-linux-gnu
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking for gawk… gawk
    checking whether make sets $(MAKE)… yes
    checking for gcc… gcc
    checking for C compiler default output file name… configure: error: C compiler cannot create executables
    See `config.log’ for more details.

    Can you suggest me..where might be wrong

    Looking forward you

    daniel

    Reply
  • October 18, 2013 at 11:24 am
    Permalink

    very nice procedure and nicely explained..

    Reply
  • November 28, 2013 at 4:54 pm
    Permalink

    I have the same problem of Raju that he resolved his problem on the last March. Can I have the same explanation, please?
    thanks so much!

    Regards!
    Dario

    Reply
  • December 1, 2013 at 1:59 pm
    Permalink

    Dear Sirs or Madams,

    I have the same issue here trying to install jasper on an opensuse machine (12.2).

    Can you please provide me with the solution as well ?

    Any help’s appreciated,

    regards shaase

    Reply
  • December 11, 2013 at 2:24 pm
    Permalink

    for jasper

    not
    ./configure –prefix=/opt/cdo-install CFLAGS=-fPICmake

    but
    ./configure –prefix=/opt/cdo-install CFLAGS=-fPIC

    it works for me

    Reply
  • March 3, 2014 at 3:04 am
    Permalink

    Dear Sir,

    I am not able to install grib while all previous steps run ok. it seems not able to find the netcdf-4 libarary. I am using cdo-1.6.3 and netcdf-4.2. it stopped when

    CC:gcc -std=gnu99 CFLAGS:-fPIC LIBS: -lm
    checking zlib.h usability… yes
    checking zlib.h presence… yes
    checking for zlib.h… yes
    checking for library containing deflate… -lz
    checking for szlib library… suppressed
    checking for hdf5 library… suppressed
    checking netcdf.h usability… yes
    checking netcdf.h presence… yes
    checking for netcdf.h… yes
    checking for library containing nc_open… no

    CC:gcc -std=gnu99 CFLAGS:-fPIC LIBS: -lm
    checking zlib.h usability… yes
    checking zlib.h presence… yes
    checking for zlib.h… yes
    checking for library containing deflate… -lz
    checking for szlib library… suppressed
    checking for hdf5 library… suppressed
    checking netcdf.h usability… yes
    checking netcdf.h presence… yes
    checking for netcdf.h… yes
    checking for library containing nc_open… no

    and then
    error: Could not link to netcdf library

    By the way I am using cygwin to install it.

    It will be very appreciated if you’ll help me to get this installed properly.

    Thanks

    Heping

    Reply
    • June 8, 2019 at 10:26 am
      Permalink

      I am having the same problem as yours. And I also use Cygwin (32bit)
      Have you solved that problem?
      Please let me know.
      Thank you!

      Reply
  • November 18, 2016 at 7:15 pm
    Permalink

    Doesn’t work on cygwin at all. Spent 2 days trying to figure out how to do this to no avail. Anyone having success on cygwin? The sysem is Win32 so I have to use cygwin.

    Reply
  • December 12, 2016 at 1:24 pm
    Permalink

    Simple steps for CDO installation:

    1. open terminal (terminal or konsole) and type
    sudo -s -H
    and after enter your root password for root privilege (for possibilty to install a package)

    2. after, type line:
    add-apt-repository “deb http://archive.ubuntu.com/ubuntu trusty main universe restricted multiverse”

    3. after, type line:
    apt-get update

    4. after, type line:
    apt-get install cdo

    Thanks

    Dr. Surendra Kumar Chandniha

    Reply
  • December 26, 2016 at 2:51 pm
    Permalink

    sudo apt install cdo
    which cdo
    /usr/bin/cdo
    cdo -V
    Climate Data Operators version 1.7.0 (http://mpimet.mpg.de/cdo)
    Compiler: gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fPIC -fopenmp
    version: gcc (Ubuntu 5.3.1-9ubuntu2) 5.3.1 20160220
    Features: DATA PTHREADS OpenMP4 HDF5 NC4/HDF5/threadsafe OPeNDAP SZ Z UDUNITS2 PROJ.4 MAGICS CURL FFTW3 SSE2
    Libraries: HDF5/1.8.16 proj/4.92 curl/7.47.0
    Filetypes: srv ext ieg grb grb2 nc nc2 nc4 nc4c
    CDI library version : 1.7.0
    GRIB_API library version : 1.14.4
    netCDF library version : 4.4.0 of Mar 29 2016 11:41:40 $
    HDF5 library version : 1.8.16
    SERVICE library version : 1.4.0
    EXTRA library version : 1.4.0
    IEG library version : 1.4.0
    FILE library version : 1.8.2

    Reply
  • January 5, 2017 at 5:36 am
    Permalink

    Dear Sir,

    I am not able to install cdo(setp 12) while all previous steps run ok.
    An error occurs as the following.

    cdo.c:1322: warning: implicit declaration of function ‘omp_get_thread_limit’
    cdo.c:1323: error: ‘omp_sched_t’ undeclared (first use in this function)
    cdo.c:1323: error: (Each undeclared identifier is reported only once
    cdo.c:1323: error: for each function it appears in.)
    cdo.c:1323: error: expected ‘;’ before ‘kind’
    cdo.c:1325: warning: implicit declaration of function ‘omp_get_schedule’
    cdo.c:1325: error: ‘kind’ undeclared (first use in this function)

    it seems that maybe openmp or omp are not support. But how can I solve this problem?

    By the way, my platform is in Linux ,and the cdo version is cdo-1.7.0, netcdf version is netcdf-4.4.1.

    It will be very appreciated if you’ll help me to get this installed properly.
    Thanks for your helping me.

    Reply
  • January 20, 2017 at 11:14 am
    Permalink

    i cannot install any file.till compilaton eveything is ok but after that it gives following errors
    zlib version 1.2.6 = 0x1260, compile flags = 0xa9
    uncompress(): hello, hello!
    gzread(): hello, hello!
    gzgets() after gzseek: hello!
    inflate(): hello, hello!
    large_inflate(): OK
    after inflateSync(): hello, hello!
    inflate with dictionary: hello, hello!
    *** zlib 64-bit test OK ***
    spacephysics1@space:~/Downloads/zlib-1.2.6$ make install
    mkdir: cannot create directory ‘/opt/cdoinstall’: Permission denied
    make: [install-libs] Error 1 (ignored)
    mkdir: cannot create directory ‘/opt/cdoinstall’: Permission denied
    make: [install-libs] Error 1 (ignored)
    mkdir: cannot create directory ‘/opt/cdoinstall’: Permission denied
    make: [install-libs] Error 1 (ignored)
    mkdir: cannot create directory ‘/opt/cdoinstall’: Permission denied
    make: [install-libs] Error 1 (ignored)
    mkdir: cannot create directory ‘/opt/cdoinstall’: Permission denied
    make: [install-libs] Error 1 (ignored)
    cp libz.a /opt/cdoinstall/lib
    cp: cannot create regular file ‘/opt/cdoinstall/lib’: No such file or directory
    make: *** [install-libs] Error 1
    spacephysics1@space:~/Downloads/zlib-1.2.6$
    please suggest where is the problem

    Reply
  • May 2, 2017 at 9:51 pm
    Permalink

    Hello

    I think all 6 installations worked out. At least I did not get an error message and 4 folders were created (bin, include, man, share). However I may have misunderstood something because if I type cdo command the xterm console gives me back “command not found”. So is there a last step I should do or does anybody now what I missed. Thank you in advance

    Reply
  • May 4, 2017 at 9:59 am
    Permalink

    Hi,

    I want to mention on step 12 that Grib_api will be changed into ecCodes (since February 2017) and they use the Cmake compilator instead of ./configure. used what was written in their ReadMe file
    – create an empty build directory, cd build and launch the command : cmake ../eccodes-2.2.0-Source -DCMAKE_INSTALL_PREFIX=/opt/cdo-install/

    Everything work fine but at the end, CDO says that grib Library is not connected..

    So my question is : what is the equivalent of CFLAGS=-fPIC –with-netcdf=/opt/cdo-install –with-jasper=/opt/cdo-install in Cmake?

    Thanks for helping me

    Reply
  • May 9, 2017 at 2:37 pm
    Permalink

    Your instructions were very informative. Thank you!

    Reply
  • July 12, 2017 at 6:31 pm
    Permalink

    Dear Sir,

    Do you have installation steps for Windows?

    Best regards
    Adem

    Reply
  • July 23, 2017 at 7:57 pm
    Permalink

    salam
    I can’t install hdf5
    this message is display on terminal:
    th5s.c:733:9: error: C++ style comments are not allowed in ISO C90
    // ret = H5Pset_alloc_time(plist_id, alloc_time);
    ^
    th5s.c:733:9: error: (this will be reported only once per input file)
    In file included from th5s.c:25:0:
    th5s.c: At top level:
    H5srcdir.h:38:20: warning: ‘H5_get_srcdir_filename’ defined but not used [-Wunused-function]
    static const char *H5_get_srcdir_filename(const char *filename)
    ^
    H5srcdir.h:68:20: warning: ‘H5_get_srcdir’ defined but not used [-Wunused-function]
    static const char *H5_get_srcdir(void)
    please help me!
    Thanks

    Reply
  • October 4, 2017 at 2:55 pm
    Permalink

    Dear sir, is the same process of installation for Windows 10?

    Reply
  • October 6, 2017 at 2:30 pm
    Permalink

    Hello,
    I have the same as smc77, hdf5 doesn’t installed correctly. Thus, I can’t pass to next steps and finish the installation.
    Do you have any solution to help me.
    Thanks in advance, regards
    Renaud J

    Reply
  • February 3, 2018 at 9:33 am
    Permalink

    I am not able to install ncdf here. It is giving error while configuration only, as showing below..
    [vigna@localhost ncdf_1.8.6]$ CPPFLAGS=-I/opt/cdo-install/include LDFLAGS=-L/opt/cdo-install/lib ./configure –prefix=/opt/cdo-install CFLAGS=-fPIC
    bash: ./configure: No such file or directory
    May be there is some syntax error but I am not able to solve it.
    Kindly help me with it.

    Reply
    • February 3, 2018 at 9:58 am
      Permalink

      I got the mistake for that error but now i am getting another error which is..
      configure: error: Can’t find or link to the hdf5 library. Use –disable-netcdf-4, or see config.log for errors.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.