etsf-io configuration fails

option, parallelism,...

Moderators: fgoudreault, mcote

Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Locked
neruocomp
Posts: 9
Joined: Wed Sep 07, 2011 8:25 pm

etsf-io configuration fails

Post by neruocomp » Wed Sep 07, 2011 8:29 pm

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
Personally, I liked the university. They gave us money and facilities, we didn't have to produce anything! You've never been out of college! You don't know what it's like out there! I've worked in the private sector. They expect results. -Ray Ghostbusters

dcaliste
Posts: 44
Joined: Thu Oct 22, 2009 9:15 am
Contact:

Re: etsf-io configuration fails

Post by dcaliste » Thu Sep 15, 2011 6:10 pm

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.

neruocomp
Posts: 9
Joined: Wed Sep 07, 2011 8:25 pm

Re: etsf-io configuration fails

Post by neruocomp » Thu Sep 15, 2011 6:31 pm

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.
Personally, I liked the university. They gave us money and facilities, we didn't have to produce anything! You've never been out of college! You don't know what it's like out there! I've worked in the private sector. They expect results. -Ray Ghostbusters

Locked