[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #JZT-105309]: neCDF 4.3.0 installation issue - Can't find or link to the hdf5 library



> Hello Russ,
> 
> I have added:
> 
> export LDLIBS="-lsz"  (that is - Lower case L, lower case S and lower case Z)
> 
> before
> 
> ./configure --prefix=/usr/local/netcdf-4.3.0ifort64-hdf5-1.8.9
> 
> but unfortunately I hit the same fault.
> 
> Sorry, did I spell it right?

Yes, that's right.

The only way I've gotten it to work is also using --disable-shared as a 
configure option, and that works with either LIBS=-lsz or LDLIBS=-lsz.  

With the default shared library build, my test stops
in "make check" with:

  libtool: link: gcc -shared  -fPIC -DPIC  .libs/libnetcdf_la-stub.o  
-Wl,--whole-archive  ../libdispatch/.libs/libnetcdf2.a 
../libdispatch/.libs/libdispatch.a ../libsrc/.libs/libnetcdf3.a  
../libdap2/.libs/libdap2.a ../oc2/.libs/liboc.a ../libsrc4/.libs/libnetcdf4.a 
-Wl,--no-whole-archive  - L/machine/russ/installs/hdf5-189-sz-static/lib 
-L/machine/russ/installs/szip/lib /machine/russ/installs/hdf5-189-sz- 
static/lib/libhdf5_hl.a /machine/russ/installs/hdf5-189-sz-static/lib/libhdf5.a 
-lrt -lm -lz -lcurl  -O2   -Wl,-soname  -Wl,libnetcdf.so.7 -o 
.libs/libnetcdf.so.7.2.0
  /usr/bin/ld: 
/machine/russ/installs/hdf5-189-sz-static/lib/libhdf5_hl.a(H5DS.o): relocation 
R_X86_64_32 against  `.rodata.str1.1' can not be used when making a shared 
object; recompile with -fPIC
  /machine/russ/installs/hdf5-189-sz-static/lib/libhdf5_hl.a: could not read 
symbols: Bad value
  collect2: ld returned 1 exit status
  make[1]: *** [libnetcdf.la] Error 1

I'm not sure which library has to be recompiled with -fPIC, maybe libsz.  I'll 
let
you know if I can get it working without using "--disable-shared" on the netCDF 
configure ...

--Russ

> I have attached the script, the make log and config.log.
> 
> Regards,
> Peter
> 
> -----Original Message-----
> From: Unidata netCDF Support [mailto:address@hidden]
> Sent: 20 June 2013 16:39
> To: Chiu, Peter (STFC,RAL,RALSP)
> Cc: address@hidden
> Subject: [netCDF #JZT-105309]: neCDF 4.3.0 installation issue - Can't find or 
> link to the hdf5 library
> 
> Peter,
> 
> > I actually ran the build a number of times with different combinations, so 
> > the config.log has been overwritten.
> > (I added in the hdf5 library in the LD_LIBRARY_PATH at the front just
> > in case it would make any difference.)
> >
> > I have just re-ran the part of the script that builds netCDF and produced 
> > another config.log.
> >
> > I have attached the config.log and the make log as well.
> >
> > I shall try building the netCDF with gcc, but our user would like to use 
> > the netCDF linked with Intel compilers as well.
> > So it will be useful to resolve this.
> 
> The problem is that szlib is not being found because "-lsz" is not included 
> with the ld flags when configure tests with a program containing a call to 
> H5Fflush.  I didn't see this problem, because we don't test with szlib and I 
> was misled by the error message that it couldn't find libhdf5 rather than 
> libsz.
> 
> It may be you can force the search for szlib by just adding "LDLIBS=-lsz"
> to your configure invocation for netCDF.  I think the configure script should 
> have included this, but it's not well tested, because we don't test 
> adequately with szlib.  Thanks for reporting this problem and being 
> persistent about getting it resolved.
> 
> By the way, the clue was in the config.log, where the third try at finding 
> H5Fflush resulted in these error messages:
> 
> configure:16229: /opt/intel/composer_xe_2013.0.079/bin/intel64/icc -o 
> conftest -g -O2 -I/usr/local/hdf5-1.8.9intel/include 
> -L/usr/local/hdf5-1.8.9intel/lib conftest.c -lhdf5  -lm -lcurl  >&5
> /usr/local/hdf5-1.8.9intel/lib/libhdf5.a(H5Z.o): In function `H5Zunregister':
> H5Z.c:(.text+0xa9b): undefined reference to `SZ_encoder_enabled'
> /usr/local/hdf5-1.8.9intel/lib/libhdf5.a(H5Z.o): In function `H5Z_unregister':
> H5Z.c:(.text+0x1872): undefined reference to `SZ_encoder_enabled'
> ...
> /usr/local/hdf5-1.8.9intel/lib/libhdf5.a(H5Z.o):H5Z.c:(.text+0x67f1): more 
> undefined references to `SZ_encoder_enabled' follow
> /usr/local/hdf5-1.8.9intel/lib/libhdf5.a(H5Zszip.o): In function 
> `H5Z_filter_szip':
> H5Zszip.c:(.text+0x6f2): undefined reference to `SZ_BufftoBuffDecompress'
> H5Zszip.c:(.text+0x7c9): undefined reference to `SZ_BufftoBuffCompress'
> configure:16229: $? = 1
> configure: failed program was:
> ...
> | return H5Fflush ();
> ...
> configure:16246: result: no
> configure:16253: error: Can't find or link to the hdf5 library. Use 
> --disable-netcdf-4, or see config.log for errors.
> 
> I'm testing the LDLIBS=-lsz workaround here, just to make sure it works ...
> 
> --Russ
> 
> 
> > -----Original Message-----
> > From: Unidata netCDF Support [mailto:address@hidden]
> > Sent: 20 June 2013 03:19
> > To: Chiu, Peter (STFC,RAL,RALSP)
> > Cc: address@hidden
> > Subject: [netCDF #JZT-105309]: neCDF 4.3.0 installation issue - Can't
> > find or link to the hdf5 library
> >
> > Peter,
> >
> > One more thing I should have requested.  Could you send the entire 
> > netCDF-4.3.0 config.log produced by running the netCDF configure script?  
> > It provides more detailed information that might give us an idea why the 
> > installed hdf5-1.8.9 library is not being found ...
> >
> > --Russ
> >
> > > > I am trying to install netCDF 4.3.0 on a Scientific Linux 6.4
> > > > system with Intel studio c and fortran compilers but have hit a
> > > > problem, wonder if you can help resolve this.
> > > >
> > > > I used the following commands (in a script) to install hdf5-1.8.9,
> > > > which appears to have gone through the "make check" without major 
> > > > problems.
> > > >
> > > > When it comes down to install netCDF 4.3.0, it then complains with
> > > > the above error.
> > > >
> > > > As you can see from the script, I have already exported the
> > > > environment variables CPPFLAGS, LDFLAGS, and LD_LIBRARY_PATH to
> > > > point to the installed location on hdf5-1.8.9.  I have also
> > > > confirmed the hdf5 installed location being correct.
> > > >
> > > > However the fault persists.  I have attached the log on this 
> > > > installation.
> > >
> > > I can't duplicate the problem here, using HDF5-1.8.9, netCDF 4.3.0,
> > > and a shell script very similar to yours, except that I use gcc
> > > rather than Intel compilers, and I didn't enable fortran or cxx in
> > > the HDF libraries (those APIs aren't used by netCDF-4).  I note that
> > > you repeated the HDF5-1.8.9 library location in the first and third
> > > position of your LD_LIBRARY_PATH and LD_RUN_PATH env variables, but that 
> > > shouldn't cause a problem.
> > >
> > > Does it all work if you use gcc instead of icc?
> > >
> > > --Russ
> > >
> > >
> > > > Much grateful if anyone can advise on this.
> > > >
> > > > Regards,
> > > >
> > > > Peter Chiu
> > > >
> > > > STFC Rutherford Appleton Laboratory UK echo "Enable intel 64
> > > > compilers"
> > > > #intel64
> > > > source /opt/intel/bin/compilervars.sh intel64
> > > >
> > > > CC=/opt/intel/composer_xe_2013.0.079/bin/intel64/icc
> > > >
> > > > FC=/opt/intel/composer_xe_2013.0.079/bin/intel64/ifort
> > > >
> > > > CXX=/opt/intel/composer_xe_2013.0.079/bin/intel64/icpc
> > > >
> > > > export CC FC CXX
> > > > ls $CC $FC $CXX
> > > >
> > > > echo "Start installing hdf5-1.8.9 with intel"
> > > > cd /usr/local/kits/netcdf-src/hdf5-1.8.9
> > > >
> > > > make distclean
> > > >
> > > > ./configure --prefix=/usr/local/hdf5-1.8.9intel
> > > > --with-szlib=/usr/local/szip \
> > > > --with-zlib=/usr/local/zlib1.2.7 --enable-fortran --enable-cxx
> > > > --disable-shared echo; echo "`date`: make"
> > > > make
> > > > echo; echo "`date`: make check"
> > > > make check
> > > > echo; echo "`date`: make check install"
> > > > make install
> > > >
> > > > echo
> > > >
> > > > echo "Set CPPFLAGS..."
> > > > CPPFLAGS='-I/usr/local/hdf5-1.8.9intel/include'
> > > >
> > > > ls /usr/local/hdf5-1.8.9intel/include /usr/local/szip/include
> > > > /usr/local/zlib1.2.7/include
> > > >
> > > > echo "Set LDFLAGS..."
> > > > LDFLAGS='-L/usr/local/hdf5-1.8.9intel/lib'
> > > >
> > > > ls /opt/intel/composer_xe_2013.0.079/compiler/lib/intel64
> > > > /usr/local/hdf5-1.8.9intel/lib /usr/local/szip/lib
> > > > /usr/local/zlib1.2.7/lib export CPPFLAGS LDFLAGS
> > > >
> > > > LD_LIBRARY_PATH="/usr/local/hdf5-1.8.9intel/lib:/opt/intel/composer_xe_2013.0.079/compiler/lib/intel64:/usr/local/hdf5-1.8.9intel/lib:/usr/local/szip/lib:/usr/local/zlib1.2.7/lib:$LD_LIBRARY_PATH"
> > > > LD_RUN_PATH="/usr/local/hdf5-1.8.9intel/lib:/opt/intel/composer_xe_2013.0.079/compiler/lib/intel64:/usr/local/hdf5-1.8.9intel/lib:/usr/local/szip/lib:/usr/local/zlib1.2.7/lib:$LD_RUN_PATH"
> > > >
> > > > export LD_LIBRARY_PATH LD_RUN_PATH
> > > >
> > > > cd /usr/local/kits/netcdf-src/netcdf-4.3.0
> > > >
> > > > make distclean
> > > >
> > > > ./configure --prefix=/usr/local/netcdf-4.3.0ifort64-hdf5-1.8.9
> > > > --disable-dap-remote-tests
> > > >
> > > > make
> > > > make check
> > > >
> > > >
> > > > --
> > > > Scanned by iCritical.
> > > >
> > > >
> > > >
> > >
> > > Russ Rew                                         UCAR Unidata Program
> > > address@hidden                      http://www.unidata.ucar.edu
> > >
> > >
> >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: JZT-105309
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> >
> 
> Russ Rew                                         UCAR Unidata Program
> address@hidden                      http://www.unidata.ucar.edu
> 
> 
> 
> Ticket Details
> ===================
> Ticket ID: JZT-105309
> Department: Support netCDF
> Priority: Normal
> Status: Closed
> 
> 

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: JZT-105309
Department: Support netCDF
Priority: Normal
Status: Closed