Project

General

Profile

Fail to complie cdo-1.7.2

Added by Shizhu Wang over 7 years ago

I was trying to install cdo on my server.
I used the following command lines to install it step by step:
----------------------------------------------------------------------
./configure --with-netcdf=~/local/netcdf
make
----------------------------------------------------------------------
then an error emerged:
----------------------------------------------------------------------
util.c:155:23: error: uuid/uuid.h: No such file or directory
util.c: In function 'cdiCreateUUID':
util.c:177: warning: implicit declaration of function 'uuid_generate'
make3: * [util.lo] Error 1
make3: Leaving directory `/soa01/home/wangsz/local/cdo-1.7.2/libcdi/src'
make2:
[all] Error 2
make2: Leaving directory `/soa01/home/wangsz/local/cdo-1.7.2/libcdi/src'
make1:
[all-recursive] Error 1
make1: Leaving directory `/soa01/home/wangsz/local/cdo-1.7.2/libcdi'
make: *
[all-recursive] Error 1
----------------------------------------------------------------------
Then I changed the compiler from gcc to icc:
----------------------------------------------------------------------
./configure --with-netcdf=~/local/netcdf CC=icc
make
----------------------------------------------------------------------
Another error came to me:
----------------------------------------------------------------------
libtool: compile: icc std=c99 -DHAVE_CONFIG_H -I. -Dg77Fortran -g -O2 -pthread -MT file.lo -MD -MP -MF .deps/file.Tpo -c file.c -fPIC -DPIC -o .libs/file.o
file.c(918): error: identifier "SSIZE_MAX" is undefined
xassert(fileptr
>bufferSize <= SSIZE_MAX);
^

compilation aborted for file.c (code 2)
make3: * [file.lo] Error 1
make3: Leaving directory `/soa01/home/wangsz/local/cdo-1.7.2/libcdi/src'
make2:
[all] Error 2
make2: Leaving directory `/soa01/home/wangsz/local/cdo-1.7.2/libcdi/src'
make1:
[all-recursive] Error 1
make1: Leaving directory `/soa01/home/wangsz/local/cdo-1.7.2/libcdi'
make: *
[all-recursive] Error 1
----------------------------------------------------------------------

I don't know how to solve it. Do I miss some important points when configure?
Attached are the two config.log files with different compilers.
Any suggestions will be appreciated.
Thanks a lot.
Night.


Replies (10)

RE: Fail to complie cdo-1.7.2 - Added by Ralf Mueller over 7 years ago

here are my recommendation:

  • use absolute paths for configure options
    ~/local/netcdf
    does not work.
  • update your compilers if possible, because we cannot always be backward compatible with old compiler versions
    • intel 11 is from 2008
    • gcc 4.4.7 is from 2012

For the gcc-error, I'd recommede to install something like libuuid. it used to be part of packages like util-linux

For the icc error, Try to run configure with additional setup

CFLAGS='-DSSIZE_MAX=INT_MAX'
Just put this at the end of your former call like
./configure --with-netcdf=$HOME/local/netcdf --prefix=/soa01/home/wangsz/local/cdo/ CC=icc CFLAGS='-DSSIZE_MAX=INT_MAX'

hth
ralf

RE: Fail to complie cdo-1.7.2 - Added by Shizhu Wang over 7 years ago

Dear Ralf,

Thanks for your fast response. Recently I tried many ways including your suggestion.
Here are the problems.
---------------------------------------------------------------------------------------------
As for the absolute path:
if I change the relative path to an absolute one,
./configure --with-netcdf=/soa01/home/wangsz/local/netcdf CC=icc
I got the error:
--------------------------------------------------
checking for netcdf.h... yes
checking for library containing nc_open... no
configure: error: Could not link to NetCDF library
configure: error: ./configure failed for libcdi
--------------------------------------------------
The log file is config_absolt.log.
---------------------------------------------------------------------------------------------
Then I did this(konwn problems from https://code.zmaw.de/projects/cdo/wiki#Static-build-with-netcdf-411-incl-dap)
./configure --prefix=/soa01/home/wangsz/local/cdo/ --with-netcdf=/soa01/home/wangsz/local/netcdf/ CC=icc LIBS='-lcurl -lgssapi_krb5 -lssl -lcrypto -ldl -lidn -ldes425 -lkrb5 -lk5crypto -lcom_err -lkrb5support -lresolv'
Error again:
--------------------------------------------------
checking for style of include used by make... GNU
checking for gcc... icc
checking whether the C compiler works... no
configure: error: in `/soa01/home/wangsz/local/cdo-1.7.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
--------------------------------------------------
Acturally I don't really understand what "LIBS='-lcurl lgssapi...-lresolv'" means. Shame on me.:(
The log file is config_LIBS.log.
--------------------------------------------------------------------------------------------

Then I disabled the netcdf feature and just ran ./configure:
./configure CC=icc
@make
Then same error as the first time:
--------------------------------------------------
file.c(918): error: identifier "SSIZE_MAX" is undefined
xassert(fileptr->bufferSize <= SSIZE_MAX);
--------------------------------------------------
---------------------------------------------------------------------------------------------
I put 'CFLAGS='-DSSIZE_MAX=INT_MAX' to the end of ./configure as you said:
./configure CC=icc CFLAGS='-DSSIZE_MAX=INT_MAX'
make@
--------------------------------------------------
util.c(155): catastrophic error: could not open source file "uuid/uuid.h"
#include <uuid/uuid.h>
^

compilation aborted for util.c (code 4)
make3: * [util.lo] Error 1
make3: Leaving directory `/soa01/home/wangsz/local/cdo-1.7.2/libcdi/src'
make2:
[all] Error 2
make2: Leaving directory `/soa01/home/wangsz/local/cdo-1.7.2/libcdi/src'
make1:
[all-recursive] Error 1
make1: Leaving directory `/soa01/home/wangsz/local/cdo-1.7.2/libcdi'
make: *
[all-recursive] Error 1
--------------------------------------------------
The log file is config_SSIZE.log.
---------------------------------------------------------------------------------------------
uuid seems to be the problem. So should I, as you said, install libuuid first? What is libuuid for?
After I install it, should I change some environment variables to make it work? Google says libuuid is a part of e2fsprogs package.
Actural, I found there is a command calld uuid on my server. But I don't know where to find uuid.h.
[wangsz@latecomer04 local]$ rpm ql uuid
/usr/bin/uuid
/usr/lib64/libossp-uuid.so.16
/usr/lib64/libossp-uuid.so.16.0.21
/usr/share/doc/uuid-1.6.1
/usr/share/doc/uuid-1.6.1/AUTHORS
/usr/share/doc/uuid-1.6.1/ChangeLog
/usr/share/doc/uuid-1.6.1/HISTORY
/usr/share/doc/uuid-1.6.1/NEWS
/usr/share/doc/uuid-1.6.1/PORTING
/usr/share/doc/uuid-1.6.1/README
/usr/share/doc/uuid-1.6.1/SEEALSO
/usr/share/doc/uuid-1.6.1/THANKS
/usr/share/doc/uuid-1.6.1/TODO
/usr/share/doc/uuid-1.6.1/USERS
/usr/share/man/man1/uuid-config.1.gz
/usr/share/man/man1/uuid.1.gz
--------------------------------------------------------------------------------------------

Sorry for so many questions. I have to admit a unfriendly beggining with CDO.:(
PS: I am new to Linux. Now I just use gcc and icc on my server although they are old.

Thank you again,Ralf.
Best regards,
Night

RE: Fail to complie cdo-1.7.2 - Added by Ralf Mueller over 7 years ago

Night Wang wrote:

Dear Ralf,

Thanks for your fast response. Recently I tried many ways including your suggestion.
Here are the problems.
---------------------------------------------------------------------------------------------
As for the absolute path:
if I change the relative path to an absolute one,
./configure --with-netcdf=/soa01/home/wangsz/local/netcdf CC=icc
I got the error:
--------------------------------------------------
checking for netcdf.h... yes
checking for library containing nc_open... no
configure: error: Could not link to NetCDF library
configure: error: ./configure failed for libcdi
--------------------------------------------------
The log file is config_absolt.log.
---------------------------------------------------------------------------------------------
Then I did this(konwn problems from https://code.zmaw.de/projects/cdo/wiki#Static-build-with-netcdf-411-incl-dap)
./configure --prefix=/soa01/home/wangsz/local/cdo/ --with-netcdf=/soa01/home/wangsz/local/netcdf/ CC=icc LIBS='-lcurl -lgssapi_krb5 -lssl -lcrypto -ldl -lidn -ldes425 -lkrb5 -lk5crypto -lcom_err -lkrb5support -lresolv'
Error again:

whats inside /soa01/home/wangsz/local/netcdf/lib?

This long LIBS variable is for static libraries.

--------------------------------------------------
---------------------------------------------------------------------------------------------
I put 'CFLAGS='-DSSIZE_MAX=INT_MAX' to the end of ./configure as you said:
./configure CC=icc CFLAGS='-DSSIZE_MAX=INT_MAX'
make

--------------------------------------------------
util.c(155): catastrophic error: could not open source file "uuid/uuid.h"
#include <uuid/uuid.h>
^
[...]
-------------------------
uuid seems to be the problem. So should I, as you said, install libuuid first? What is libuuid for?
After I install it, should I change some environment variables to make it work? Google says libuuid is a part of e2fsprogs package.

you should install e2fsprogs and rerun

./configure CC=icc CFLAGS='-DSSIZE_MAX=INT_MAX

Maybe, we should try it differently - on older systems, the building can be somewhat complex. The questionen is, if you really want to do this? If you're new to Linux, this can be hard, so why not skipping this and have some fun. I'd recommend to
use conda, see Anaconda.
It's a packaging system independent from the specific linux distribution and many scientific tools (incl. CDO) are included. This can be worth learning, because you can easily transfer stuff to you next system no matter what kind of unix it is.

hth
ralf

RE: Fail to complie cdo-1.7.2 - Added by Shizhu Wang over 7 years ago

Dear Ralf,
Thanks for your explanation.
It seems that I figured out some errors.Here are my thoughts.
1. Given that the constants, such as SSIZE_MAX and M_SQRT2, are provided by gcc, it will be better to use gcc rather than icc. Am I right?
2. There is uuid on my server but no library for uuid. So I installed libuuid(downloaded from https://sourceforge.net/projects/libuuid/?source=typ_redirect).
After I installed libuuid and then:

./configure CPPFLAGS='-I /soa01/home/wangsz/local/libuuid-1.0.3/build/include'
make
make install

It worked!!! Big step for me.;)

3. Now it comes to the netcdf error.

./configure CPPFLAGS='-I /soa01/home/wangsz/local/libuuid-1.0.3/build/include' --prefix=/soa01/home/wangsz/local/cdo/ --with-netcdf=/soa01/home/wangsz/local/netcdf/

Error like this:
----------------------------------------------------------------
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
configure: error: ./configure failed for libcdi
----------------------------------------------------------------
Attached is the config_withNC.log file.

Here are the files in /soa01/home/wangsz/local/netcdf/lib:
----------------------------------------------------------------
libhdf5.a libhdf5_hl.so.8 libhdf5.so libnetcdff.a libnetcdff.so.6.0.1 libnetcdf.so.7.2.0
libhdf5_hl.a libhdf5_hl.so.8.0.2 libhdf5.so.8 libnetcdff.la libnetcdf.la pkgconfig
libhdf5_hl.la libhdf5.la libhdf5.so.8.0.2 libnetcdff.so libnetcdf.so
libhdf5_hl.so libhdf5.settings libnetcdf.a libnetcdff.so.6 libnetcdf.so.7
----------------------------------------------------------------
netcdf on my server was not installed from source code. I copied it from someone else who compiled it on his computer. Is there anything lost?

4.As for Anaconda, I will try it. I don't konw whether it will work because internet is forbidden on my server.

Thanks.
Best regards,
Night.

RE: Fail to complie cdo-1.7.2 - Added by Ralf Mueller over 7 years ago

I need to look into libcdi/config.log because the error comed from the second configure call within the 'libcdi' directory

In general, copying binary objects (like compiled libnetcdf files) is not a good idea. your host might be different than the host where you took it from in terms of environment like compilers, external library versions. To solve these dependencies is a job for a package maintainer.

We ususally test CDO with multiple compilers: gcc, intel, clang, pgi. but our oldest versions a newer than your versions: gcc 4.8.2, intel 14.0.2.

best wishes
ralf

RE: Fail to complie cdo-1.7.2 - Added by Shizhu Wang over 7 years ago

Here is the config.log from ./libcdi.
I am intalling netcdf from source code now.

Thanks.
Best wishes,
Night

RE: Fail to complie cdo-1.7.2 - Added by Ralf Mueller over 7 years ago

This is the interessting part:

configure:27243: ./libtool --mode=link --tag=CC gcc -std=gnu99 -o conftest -g -O2 -pthread -I/soa01/home/wangsz/local/netcdf//include -I /soa01/home/wangsz/local/libuuid-1.0.3/build/include -L/soa01/home/wangsz/local/netcdf//lib  conftest.c -lnetcdf   -lm  >&5
libtool: link: warning: library `/soa01/home/wangsz/local/netcdf//lib/libnetcdf.la' was moved.
libtool: link: cannot find the library `/soa01/home/xiaob/tools/tools_intel/lib/libhdf5_hl.la' or unhandled argument `/soa01/home/xiaob/tools/tools_intel/lib/libhdf5_hl.la'
configure:27243: $? = 1

Another user (xiaob) has prob. compiled netcdf + hdf5 (IO backend of netcdf4). These inter-dependencies of netcdf and hdf5 are kept inside the .la files created by a tool called libtool. That's why you cannot just copy things to somewhere else - the dependencies are still there with absolute paths. Could ask user xiaob how the build was done?

maybe this helps:

I pre-packaged some CDO-related libraries (once uppon a time) - it might work for you (I just tested it on my current machine, but yours is differen, so let's see)

RE: Fail to complie cdo-1.7.2 - Added by Shizhu Wang over 7 years ago

Dear Ralf,
Sorry for the delayed response to you. I was attending a field research recently.
Today I installed many softwares---szip,zlib,hdf5,netcdf,jasper,grib_api.
Just like you said last time, I had better install them by myself.
Then, I began to install cdo.

./configure CPPFLAGS=-I/soa01/home/wangsz/local/libuuid-1.0.3/build/include --prefix=/soa01/home/wangsz/local/build/cdo-1.8.0rc5/ --with-netcdf=/soa01/home/wangsz/local/build/netcdf-4.4.1.1/
make

Error like this:
----------------------------------------------------------------
libtool: link: gcc std=gnu99 -g -O2 -pthread -o cdi cdi.o -L/soa01/home/wangsz/local/build/netcdf-4.4.1.1//lib ../src/.libs/libcdi.a -luuid -L/soa01/home/wangsz/local/build/hdf5-1.8.18/lib -L/soa01/home/wangsz/local/build/zlib-1.2.8//lib -L/soa01/home/wangsz/local/build/szip-2.1//lib /soa01/home/wangsz/local/build/netcdf-4.4.1.1/lib/libnetcdf.so /soa01/home/wangsz/local/build/hdf5-1.8.18/lib/libhdf5_hl.so /soa01/home/wangsz/local/build/hdf5-1.8.18/lib/libhdf5.so -lrt /soa01/home/wangsz/local/build/szip-2.1//lib/libsz.so -lz -ldl -lcurl -lm -pthread -Wl,-rpath -Wl,/soa01/home/wangsz/local/build/netcdf-4.4.1.1/lib -Wl,-rpath -Wl,/soa01/home/wangsz/local/build/hdf5-1.8.18/lib -Wl,-rpath -Wl,/soa01/home/wangsz/local/build/szip-2.1//lib -Wl,-rpath -Wl,/soa01/home/wangsz/local/build/netcdf-4.4.1.1/lib -Wl,-rpath -Wl,/soa01/home/wangsz/local/build/hdf5-1.8.18/lib -Wl,-rpath -Wl,/soa01/home/wangsz/local/build/szip-2.1//lib
../src/.libs/libcdi.a(cdf_util.o): In function `str_is_equal':
/soa01/home/wangsz/local/cdo-1.8.0rc5/libcdi/src/cdf_util.c:21: undefined reference to `_intel_fast_memcmp'
../src/.libs/libcdi.a(cdf_util.o): In function `is_timeaxis_units':
/soa01/home/wangsz/local/cdo-1.8.0rc5/libcdi/src/cdf_util.c:69: undefined reference to `_intel_fast_memcpy'
collect2: ld returned 1 exit status
make2: * [cdi] Error 1
make2: Leaving directory `/soa01/home/wangsz/local/cdo-1.8.0rc5/libcdi/app'
make1:
[all-recursive] Error 1
make1: Leaving directory `/soa01/home/wangsz/local/cdo-1.8.0rc5/libcdi'
make: *
* [all-recursive] Error 1
---------------------------------------------------------------

Attached are the ./config.log file and the ./libcdi/config.log file.
PS: about the libs4cdo-0.0.11 directory, how do I use it?

Thanks, and merry Christmas.
Night

RE: Fail to complie cdo-1.7.2 - Added by Vency Hua almost 3 years ago

Hi~
I was trying to install cdo on Linux and I do not have rights of administrators so it is really troublesome.I installed many softwares---zlib, curl ,hdf5, netcdf,jasper,grib_api(now is named ecccdoes) and update gcc. Then I complie cdo but always report:
checking if C externals constructed with cfortran.h work... error
configure: Linking/Running with C EXTERNAL built with cfortran.h does not work!
configure: Disabling cfortran.h bindings generation
./configure: line 23102: ----------------------------------------------------------------------: command not found
the trouble is the same as yours(2016.12.26 15:39), I use google and see you problem, but I can not see your solution...

I then download cfortran and add the path (did I put the file in the wrong place? ), I also try libuuid and add the path (by vim ~/.bashrc and source .bashrc ),but still report the same question. I have been stuck in the last step of the install...how can I solve the problem of cfortran.h??
Any suggestions will be appreciated.
Thanks a lot.

RE: Fail to complie cdo-1.7.2 - Added by Ralf Mueller almost 3 years ago

hi!

For Linux your have several options to get CDO on your computer. please have a look at Linux_Platform and Anaconda

Especially the latter one will allow you to install CDO without access rights of an administrator.

cheers
ralf

    (1-10/10)