Page 1 of 1

etsf-io configuration fails

Posted: Wed Sep 07, 2011 8:29 pm
by neruocomp
Trying to build the prereqs, already have netcdf-4.1.1(including hdf5-1.8.5) built and tested.
I run configure for etsf-io and it fails:

./configure --with-netcdf-module-path=/share/apps/netcdf/4.1.1-gcc-4.6.1/include --with-netcdf-ldflags="`/share/apps/netcdf/4.1.1-gcc-4.6.1/bin/nc-config --libs`"

Where nc-config --libs returns
-L/share/apps/netcdf/4.1.1-gcc-4.6.1/lib -lnetcdf -L/share/apps/hdf5/1.8.5-gcc-4.6.1//lib -lhdf5_hl -lhdf5 -lz -lm

Along with the following environment variables set:
export PATH=/share/apps/gcc/4.6.1/bin:/share/apps/openmpi/1.4.3-gcc-4.6.1/bin:$PATH
export LD_LIBRARY_PATH=/share/apps/gcc/4.6.1/lib64:/share/apps/gmp/5.0.2/lib:/share/apps/mpfr/3.0.1/lib:/share/apps/mpc/0.9/lib:/share/apps/openmpi/1.4.3-gcc-4.6.1/lib:/share/apps/gsl/1.15/lib:$LD_LIBRARY_PATH

This fails and the following is in config.log:
configure:3748: checking for netcdf library
configure:3765: gfortran -o conftest -g -O2 -I/share/apps/netcdf/4.1.1-gcc-4.6.1/include -L/share/apps/netcdf/4.1.1-gcc-4.6.1/lib -lnetcdf -L/share/apps/hdf5/1.8.5-gcc-4.6.1//lib -lhdf5_hl -lhdf5 -lz -lm conftest.f90 -lnetcdf >&5
/share/apps/netcdf/4.1.1-gcc-4.6.1/lib/libnetcdf.a(nc4var.o): In function `nc4_reopen_dataset':
/root/workspace/netcdf-4.1.1/libsrc4/nc4var.c:51: undefined reference to `H5open'
/root/workspace/netcdf-4.1.1/libsrc4/nc4var.c:51: undefined reference to `H5P_CLS_DATASET_ACCESS_g'
/root/workspace/netcdf-4.1.1/libsrc4/nc4var.c:51: undefined reference to `H5Pcreate'
/root/workspace/netcdf-4.1.1/libsrc4/nc4var.c:56: undefined reference to `H5Pset_chunk_cache'
/root/workspace/netcdf-4.1.1/libsrc4/nc4var.c:60: undefined reference to `H5Dclose'
/root/workspace/netcdf-4.1.1/libsrc4/nc4var.c:62: undefined reference to `H5Dopen2'
/root/workspace/netcdf-4.1.1/libsrc4/nc4var.c:65: undefined reference to `H5Pclose'
........

Any ideas?
David

Re: etsf-io configuration fails

Posted: Thu Sep 15, 2011 6:10 pm
by dcaliste
Can you try the following, if it successes, I will have to change a bit the configure of ETSF_IO :

LIBS="-lhdf5_hl -lhdf5 -lz -lm" LDFLAGS="-L/share/apps/netcdf/4.1.1-gcc-4.6.1/lib -L/share/apps/hdf5/1.8.5-gcc-4.6.1//lib" ./configure

The issue you report may come from the fact that configure tries to compile the following line :
gfortran -o conftest -g -O2 $LDFLAGS conftest.f90 -lnetcdf
Notice the -lnetcdf at the end. Indeed, by providing --with-netcdf-ldflags=... you change the ldflags only, and configure tries -lnetcdf anyway. But in your case, you need to provide the HDF5 additional links also.

If that's indeed the issue, I will modify ESF_IO configure option not to assume that the library is linked by adding -lnetcdf only with some ldflags.

Re: etsf-io configuration fails

Posted: Thu Sep 15, 2011 6:31 pm
by neruocomp
Sorry, still doesn't work. Here is the config.log

# LIBS="-lhdf5_hl -lhdf5 -lz -lm" LDFLAGS="-L/share/apps/netcdf/4.1.1-gcc-4.6.1/lib -L/share/apps/hdf5/1.8.5-gcc-4.6.1//lib" ./configure --with-netcdf-module-path=/share/apps/netcdf/4.1.1-gcc-4.6.1/include --with-netcdf-ldflags="`/share/apps/netcdf/4.1.1-gcc-4.6.1/bin/nc-config --libs`"

configure:3866: gfortran -o conftest -g -O2 -I/share/apps/netcdf/4.1.1-gcc-4.6.1/include -L/share/apps/netcdf/4.1.1-gcc-4.6.1/lib -L/share/apps/hdf5/1.8.5-gcc-4.6.1//lib -L/share/apps/netcdf/4.1.1-gcc-4.6.1/lib -lnetcdf -L/share/apps/hdf5/1.8.5-gcc-4.6.1//lib -lhdf5_hl -lhdf5 -lz -lm conftest.f90 -lhdf5_hl -lhdf5 -lz -lm -lnetcdf >&5
/share/apps/netcdf/4.1.1-gcc-4.6.1/lib/libnetcdf.a(nc4var.o): In function `nc4_reopen_dataset':
/root/workspace/netcdf-4.1.1/libsrc4/nc4var.c:51: undefined reference to `H5open'
/root/workspace/netcdf-4.1.1/libsrc4/nc4var.c:51: undefined reference to `H5P_CLS_DATASET_ACCESS_g'
.....
collect2: ld returned 1 exit status
configure:3872: $? = 1

I forgot to add that after that, there is this as well:

configure:3905: gfortran -o conftest -g -O2 -I/share/apps/netcdf/4.1.1-gcc-4.6.1/include -L/share/apps/netcdf/4.1.1-gcc-4.6.1/lib -L/share/apps/hdf5/1.8.5-gcc-4.6.1//lib -L/share/apps/netcdf/4.1.1-gcc-4.6.1/lib -lnetcdf -L/share/apps/hdf5/1.8.5-gcc-4.6.1//lib -lhdf5_hl -lhdf5 -lz -lm conftest.f90 -lhdf5_hl -lhdf5 -lz -lm -lnetcdff -lnetcdf >&5
/usr/bin/ld: cannot find -lnetcdff
collect2: ld returned 1 exit status
configure:3911: $? = 1

Following the netcdf instructions I built it with static linking so it doesn't create a libnetcdff.a file.