Project

General

Profile

Install CDO with netCDF4

Added by Sheng-Hung Wang about 5 years ago

Hi there,

I have a problem to install CDO on Fedora 25, which is similar problem to earlier topic https://code.mpimet.mpg.de/boards/1/topics/1445.

Basically, configure was not able to find nc-config

configure:24569: checking nc-config script
configure:24573: checking for nc-config
configure:24603: result: no
configure:24661: result: Could not find nc-config! go on with default configuration

therefore not able to to create Make file with netcdf4

ENABLE_NC2 = no
ENABLE_NC4 = no
ENABLE_NC4HDF5 = no
ENABLE_NETCDF = yes

And yes netcdf4 library and nc-config are there

nc-config --all

This netCDF 4.4.1.1 has been built with the following features:

--cc        -> gcc
--cflags -> -I/usr/include -I/usr/include/hdf
--libs -> -L/usr/lib64 -lnetcdf
--has-c++   -> no
--cxx ->
--has-c++4  -> yes
--cxx4 -> g++
--cxx4flags -> -I/usr/include
--cxx4libs -> -L/usr/lib64 -lnetcdf_c++4 -lnetcdf
--has-fortran-> yes
--fc -> gfortran
--fflags -> -I/usr/include
--flibs -> -lnetcdff
--has-f90 -> no
--has-f03 -> yes
--has-dap   > yes
--has-nc2 -> yes
--has-nc4 -> yes
--has-hdf5 -> yes
--has-hdf4 -> yes
--has-logging
> no
--has-pnetcdf-> no
--has-szlib ->
--prefix    > /usr
--includedir
> /usr/include
--libdir -> /usr/lib64
--version -> netCDF 4.4.1.1

and CDO I got is

cdo -V
Climate Data Operators version 1.9.6 (http://mpimet.mpg.de/cdo)
System: x86_64-pc-linux-gnu
CXX Compiler: g++ -g -O2 -fopenmp
CXX version : g++ (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
C Compiler: gcc -fPIC -g -O2 -fopenmp
C version : gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
F77 Compiler: gfortran -m64
F77 version : GNU Fortran (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)
Features: 15GB 16threads C++14 Fortran DATA PTHREADS OpenMP45 HDF5 SSE2
Libraries: HDF5/1.8.17
Filetypes: srv ext ieg grb1 grb2 nc1 nc5
CDI library version : 1.9.6
cgribex library version : 1.9.2
ecCodes library version : 1.16.0
NetCDF library version : 4.4.1.1 of Nov 29 2016 18:57:46 $
exse library version : 1.4.1
FILE library version : 1.8.3

I did try make distclean as earlier topic solution, and it didn't work.

Any suggestion how to fix this either in configure or environment variable? or?

Thanks


Replies (4)

RE: Install CDO with netCDF4 - Added by Ralf Mueller about 5 years ago

could you upload the config.log file, please?

cheers
ralf

RE: Install CDO with netCDF4 - Added by Sheng-Hung Wang about 5 years ago

Here is my config.log file.

RE: Install CDO with netCDF4 - Added by Ralf Mueller about 5 years ago

/configure --prefix=/home/wang.446/Downloads/temp CFLAGS=-fPIC -g -O2 --enable-netcdf4 --with-netcdf=/usr/lib64
  1. there is not configure option --enable-netcdf4 fir the CDO configure script - instead this has to given to the netcdf configure command
  2. --with with options require a directory, there the binary library files AND the include headers can be found. For system-libraries below /usr you can use --with-netcdf without any directory given.
  3. you can see here what happened: the nc-config script should be used to get the correct CFLAGS and LDFLAGS, but it is not there. So the default configuration is done. This means no netcdf4, because is required extra linking. netcdf2 is implemented by the netcdf library itself. so thius part if the Netcdf standard can securely be used.

My recommondation is: just use '--with-netcdf'

hth
ralf

RE: Install CDO with netCDF4 - Added by Sheng-Hung Wang about 5 years ago

After I change --with-netcdf=/usr/lib64 to --with-netcdf, it works. Thanks!!

    (1-4/4)