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

[netCDF #VTI-484586]: configure for netcdf 4.3.3.1 can't find hdf5dll and exits



> Hey Russ,
> 
> One more time - on a current Linux x86_64 OS:
> 
> My environment is listed in the file "my_environment.txt"
> Netcdf's configure is looking for the file hdf5dll which does not exist - see 
> "look_for_hdf5dll.txt"

Yes, and the configure file even looks for that file in a *successful* build.
There are many error messages in the output from configure, because
configure works by probing the development environment to find out
how to build the software. 

My successful build on linux (or osx) also contains, in config.log,
the message:

    configure:16750: gcc -o conftest -g3 -O0 -fno-inline 
-I/Users/russ/installs/h5-1814/include -L/Users/russ/installs/h5-1814/lib 
conftest.c -lhdf5dll  -ldl -lm -lz -lcurl  >&5
    ld: library not found for -lhdf5dll

but then a few lines later in config.log it succeeds in finding
the hdf5 function it's looking for and emits the message:

    configure:16750: gcc -o conftest -g3 -O0 -fno-inline 
-I/Users/russ/installs/h5-1814/include -L/Users/russ/installs/h5-1814/lib 
conftest.c -lhdf5  -ldl -lm -lz -lcurl  >&5
    configure:16750: $? = 0
    configure:16767: result: -lhdf5

because now the compiler is invoked with a "-L" option testing if
the function is where the LDFLAGS environment variable specifies.

But in your case, the next invocation of cc looking for a function in
the hdf5 library doesn't have a "-L" option for specifying where you
installed HDF5, so the library is not found:

    configure:16765: cc -o conftest -mtune=native -m64 -DNDEBUG -DpgiFortran 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-I/opt/home/george/libs/hdf5-1.8.13/include -I/opt/home/george/libs/zlib-1.2.8/ 
-I/opt/home/george/libs/curl-7.26.0/lib/  conftest.c -lhdf5  -ldl -lm -lz  >&5
    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: 
cannot find -lhdf5
    collect2: error: ld returned 1 exit status
    configure:16765: $? = 1
   
Output of the environment in config.log also indicates the environment
variable LDFLAGS is unset for configure:

    LDFLAGS=''

I suspect you are setting LDFLAGS as a shell variable in a separate shell
command before invoking the configure command, rather than on the 
same line as the configure command (as is shown in the installation 
instructions). If you do it that way, you have to export each needed 
environment variable using an explicit "export" command, in order for 
its value to be available in subshells in which shell scripts like configure 
are run.

So try again, either setting the environment variables that are needed on 
the same line as the configure line (making their values available inside
the configure script), or run an export command for the variables. We
don't recommend the latter way of setting the variables, because then
their values persist after you have built netCDF, and that might cause
problems with subsequent builds of other software.

I note that you must have exported CPPFLAGS, because it is shown in
the config.log file with the same value as in your "my_environment.txt"
file, but the LDFLAGS variable is not.  So the information in CPPFLAGS 
is getting used in the compiles, but no information from the unexported 
LDFLAGS is available in the configure script.

--Russ

> The invocation for configure is at the top of "config.log"
> The result of running ./config is in "configme-4-1.log"
> 
> Am I missing a patch for either netcdf 4.3.3.1 or HDF5 when I try to build 
> with netcdf4 on Linux?
> 
> All works fine when I use "--disable-detcdf-4" in the invocation of config, 
> but I need netcdf 4.
> 
> Appreciate any help you may offer.
> 
> Best,
> 
> George
> 
> -----Original Message-----
> From: Unidata netCDF Support [mailto:address@hidden
> Sent: Tuesday, May 26, 2015 11:09 AM
> To: address@hidden
> Cc: address@hidden
> Subject: [netCDF #VTI-484586]: configure for netcdf 4.3.3.1 can't find 
> hdf5dll and exits
> 
> George,
> 
> > Thanks for the response. Seems I forgot to attach the tar file with the 
> > logs (now attached).
> > This is a Linux x86_64 build which is why I am stumped in the search for a 
> > DLL by gcc!
> 
> The configure script looks for an HDF5 library in several places, if it can't 
> find it in any of the standard locations for shared libraries, which include 
> an hdf5dll file.
> 
> From the config.log file you sent, it appears that you haven't used the 
> LDFLAGS and CPPFLAGS environment variables to specify where the HDF5 library 
> is installed. There's examples of how to do this with a POSIX-compliant shell 
> such as bash in the instructions for building from source:
> 
> http://www.unidata.ucar.edu/netcdf/docs/getting_and_building_netcdf.html#build_default
> 
> If you're using a different shell such as csh or tcsh, you'll need to use 
> setenv instead to set LDPATH and CPPFLAGS environment variables.
> 
> Note that sometimes  you also need to set LD_LIBRARY_PATH before running 
> configure, if the installed library is not found from the LDFLAGS variable.
> 
> If this doesn't fix the problem, please let us know.
> 
> --Russ
> 
> > Best,
> >
> > George
> >
> >
> > -----Original Message-----
> > From: Unidata netCDF Support [mailto:address@hidden
> > Sent: Sunday, May 24, 2015 8:19 PM
> > To: address@hidden
> > Cc: address@hidden
> > Subject: [netCDF #VTI-484586]: configure for netcdf 4.3.3.1 can't find
> > hdf5dll and exits
> >
> > Hi George,
> >
> > > curl-7.26.0
> > >
> > > hdf5-1.8.13
> > >
> > > hdf5-1.8.14.tar
> > >
> > > netcdf-4.3.3.1
> > >
> > > netcdf-fortran-4.4.2
> > >
> > > README.netcdf
> > >
> > > zlib-1.2.8
> > >
> > >
> > >
> > > The above versions of curl, zlib, and hdf5 have been built.
> > >
> > >
> > >
> > > The attempt to build netcdf 4.3.3.1 fails with configure looking for
> > > hdf5dll
> > >
> > > This library does not exist in the builds of the above libraries.
> >
> > Are you following these instructions for building with Visual Studio?
> >
> > http://www.unidata.ucar.edu/netcdf/docs/winbin.html#msvc-using
> >
> > They require using cmake rather than configure. You can also just download 
> > the netCDF-4.3.3.1 C library and utilities prebuilt with HDF5, zlib, and 
> > curl:
> >
> > http://www.unidata.ucar.edu/netcdf/docs/winbin.html#msvc-prebuilt
> >
> > If you're using using MSYS/MinGW or Cygwin, you can build netCDF-C using 
> > configure with the the Linux/Unix build instructions, instead of cmake:
> >
> > http://www.unidata.ucar.edu/netcdf/docs/getting_and_building_netcdf.ht
> > ml#sub
> >
> > If you have problems with this, please send us the config.log file 
> > generated by running the configure script.
> >
> > --Russ
> >
> > >
> > >
> > >
> > > The configure and make for netcdf does complete when using
> > > --disable-netcdf-4
> > >
> > >
> > >
> > > (lines 3481, 3736 of config.log )
> > >
> > >
> > >
> > > /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld:
> > > cannot find -lhdf5dll
> > >
> > > collect2: error: ld returned 1 exit status
> > >
> > > configure: error: Can't find or link to the hdf5 library. Use
> > > --disable-netcdf-4, or see config.log for errors.
> > >
> > >
> > >
> > > I would appreciate a fix.
> > >
> > >
> > >
> > > George
> >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: VTI-484586
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> >
> >
> Russ Rew                                         UCAR Unidata Program
> address@hidden                      http://www.unidata.ucar.edu
> 
> 
> 
> Ticket Details
> ===================
> Ticket ID: VTI-484586
> Department: Support netCDF
> Priority: Normal
> Status: Closed
> 
> 
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: VTI-484586
Department: Support netCDF
Priority: Normal
Status: Closed


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.