Project

General

Profile

Configure and compile

Added by Miles Sowden over 5 years ago

Following my recent post regarding unsupported generic grid https://code.mpimet.mpg.de/boards/1/topics/6705?r=6714#message-6714 I have tried to fix the problem myself.

I downloaded 1.6.8 from Github, thinking it was the latest file. ./configure ran fine but make crashed with an error and a number of warnings (see below).
Subsequent I downloaded newer versions (1.7.2, 1.8.2, 1.9.5) from here but configure would not run on newer versions (1.9.5 log included) (All new clean untarred files).

I'm totally out my depth here, last programmed about 10 years ago, so please, simple steps I can follow. :-)

Thanks
BTW I'm running Bash on Ubuntu on Windows (see https://docs.microsoft.com/en-us/windows/wsl/install-win10 ) and latest Windows 10 (10.0.17763)

1.6.8 compile errors and warnings below.

ar: `u' modifier ignored since `D' is the default (see `U')
cgribexlib.c: In function 'grib_decode_double':
cgribexlib.c:10462:6: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
if ( ISEC0_GRIB_Len 24 && ISEC0_GRIB_Version 0 )
^
cgribexlib.c: In function 'grib_decode_float':
cgribexlib.c:11395:6: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
if ( ISEC0_GRIB_Len 24 && ISEC0_GRIB_Version 0 )
^
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
EOFs.c: In function ‘EOFs’:
EOFs.c:381:5: error: non-floating-point argument in call to function ‘__builtin_isnan’
if ( !DBL_IS_EQUAL(weight[i], 0) && !DBL_IS_EQUAL(weight[i], missval) &&
^
EOFs.c:381:5: error: non-floating-point argument in call to function ‘__builtin_isnan’
EOFs.c:396:8: error: non-floating-point argument in call to function ‘__builtin_isnan’
if ( !DBL_IS_EQUAL(weight[i], 0) && !DBL_IS_EQUAL(weight[i], missval) &&
^
EOFs.c:396:8: error: non-floating-point argument in call to function ‘__builtin_isnan’
make[2]: * [cdo-EOFs.o] Error 1
make[1]:
[all] Error 2
make: *
* [all-recursive] Error 1

Replies (11)

RE: Configure and compile - Added by Ralf Mueller over 5 years ago

hi Miles!

We don't build CDO on that version of Linux ;-) We have a testing box running but didn't invest time in checking it out with respect to that. Currently the recommended way to use CDO on windows is cygwin.

I think the first issue is missing packages - I guess you need to install g++ because we switched from C to C++. Also the dev packages for netcdf, udunits2, fftw3 should be installed.

hth + thanks for the tests
ralf

RE: Configure and compile - Added by Miles Sowden over 5 years ago

Thanks,
Happy to help test. The windoze update does away with the need for the virtual window. To the system it appears as though it's a Ubuntu linux distribution. Been using CDO and paraview for about two years so totally stable. (installed using sudo apt install cdo).

Can you step me thru what dev packages (URL's) to get and what do I do to install them? Binary libraries should already be on my system.
Installing g++ told me that I need to run update on a lot of the installed programs so that may be part of the earlier problems. Does any of the previously attached files point to exactly what is missing?

RE: Configure and compile - Added by Ralf Mueller over 5 years ago

Thx for the info that CDO us usable from scratch! which version is it?

I think if you use the built-in ubuntu for two years, you should get a long list of other packages no matter with package you want to install.

the packages needed for building CDO are: libaec-dev libhdf5-dev libnetcdf-dev autotools libudunits2-dev automake autoconf libtool libproj-dev

cheers
ralf

RE: Configure and compile - Added by Miles Sowden over 5 years ago

Ralf, seems to be working. configure and compile is still running. local cdo -V successful. Now to make install....

Only had to do sudo apt upgrade
sudo apt install g++

Climate Data Operators version 1.9.5 (http://mpimet.mpg.de/cdo)
System: x86_64-pc-linux-gnu
CXX Compiler: g++ -std=gnu++11 -g -O2 -fopenmp
CXX version : g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
C Compiler: gcc -g -O2 -fopenmp
C version : gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
F77 Compiler: f77 -g -O2
F77 version : unknown
Features: 15GB 8threads C++11 Fortran DATA PTHREADS OpenMP4 SSE2
Libraries:
Filetypes: srv ext ieg grb1
CDI library version : 1.9.5
CGRIBEX library version : 1.9.1
EXSE library version : 1.4.0
FILE library version : 1.8.3

RE: Configure and compile - Added by Ralf Mueller over 5 years ago

COOL!!! I always wondered if this would be an alternative.

But again: Which CDO version comes from the package manager?

RE: Configure and compile - Added by Miles Sowden over 5 years ago

My day-to day version is 1.7.0 (installed from sudo) and I now have 1.9.2 running from ./src/cdo checking with -V.
Make install seemed ok but -V is still saying 1.7.0. I think I may need to do an uninstall first.
However, I'm going to do the local fix first for the smooth9 routine then work out what went wrong

RE: Configure and compile - Added by Ralf Mueller over 5 years ago

I think you have to add the installation directory to your PATH variable in order to use it as default cdo

RE: Configure and compile - Added by Miles Sowden over 5 years ago

Failed on an actual file

./cdo sub -smooth9 land.nc land.nc delta.nc

cdo sub: Open failed on >land.nc<
Unsupported file type (library support not compiled in)
To create a CDO application with NetCDF support use: ./configure --with-netcdf=<NetCDF root directory> ...

From https://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html I used
git clone http://github.com/Unidata/netcdf-c netcdf-c

then reran
./configure --with-netcdf=/usr/share/netcdf-c

failed with
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
configure: error: Could not link to NetCDF library

Any ideas?

RE: Configure and compile - Added by Ralf Mueller over 5 years ago

if you have installed the libnetcdf-dev package, you can just use

--with-netcdf
with the configure call. no need to install something manually

hth
ralf

RE: Configure and compile - Added by Miles Sowden over 5 years ago

Almost there. Tried to do it manually didn't work.
Finally found https://cloud-gc.readthedocs.io/en/latest/chapter04_developer-guide/install-basic.html#install-netcdf-library-with-package-manager

specifically needed to run: sudo apt-get install libnetcdf-dev libnetcdff-dev
ran nc-config --all and it returned
--cflags -> -I/usr/include -I/usr/include/hdf5/serial
--libs -> -L/usr/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial -lnetcdf -lhdf5_hl -lhdf5 -lpthread -lsz -lz -ldl -lm -lcurl
Then there was fun playing with the settings until finally stumbled upon
./configure --with-netcdf --with-lhdf5_hl --with-hdf5 --with-pthread --with-sz --with-z --with-dl --with-m --with-curl CPPFLAGS="-I/usr/include -I/usr/include/hdf5/serial" LDFLAGS="-L/usr/lib -L/usr/lib/x86_64-linux-gnu/hdf5/serial"

Comparing the new build to the old there are slight differences. Why the missing items, and what should I do to fix? And the threadsafe?

thanks

NEW BUILD ./src/cdo -V
System: x86_64-pc-linux-gnu
CXX Compiler: g++ -std=gnu++11 -g -O2 -fopenmp
CXX version : g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
C Compiler: gcc -g -O2 -fopenmp
C version : gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
F77 Compiler: f77 -g -O2
F77 version : unknown
Features: 15GB 8threads C++11 Fortran DATA PTHREADS OpenMP4 HDF5 NC4/HDF5/threadsafe OPeNDAP CURL SSE2
Libraries: HDF5/1.8.16 curl/7.47.0(h7.26.0)
Filetypes: srv ext ieg grb1 nc1 nc2 nc4 nc4c nc5
CDI library version : 1.9.5
CGRIBEX library version : 1.9.1
NetCDF library version : 4.4.0 of Mar 29 2016 11:41:40 $
HDF5 library version : 1.8.16 threadsafe
EXSE library version : 1.4.0
FILE library version : 1.8.3

OLD INSTALL cdo -V
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

RE: Configure and compile - Added by Ralf Mueller over 5 years ago

Thx for the work, Miles!

good to know, that the built-in Linux is usable.

cheers
ralf

    (1-11/11)