Re: [netcdfgroup] mfhdf.h not found even though it's present

>> So I tried anyways configuring using
>>
>> --enable-netcdf4 --enable-hdf4 --enable-cxx-4 --enable-shared
>> --with-hdf4=/usr/include/hdf FC=gfortran
>>
>> And, alas, the compilation seems to work :) However, when I then run
>> ``make && make -j1 test``, I get the following error:
>>
> 
> Howdy Andreas!
> 
> You have hit upon the weak spot of the --with-hdf4 option (and also the
> --with-hdf5, --with-pnetcdf, --with-zlib, --with-szlib options). They
> expect to find lib and include under the same directory. But this is not
> always the case.
> 
> The answer is to not use the --with-hdf4 option, but instead, before
> running configure, set CPPFLAGS and LDFLAGS to include the appropriate
> arguments:
> 
> CPPFLAGS=-I/usr/include LDFLAGS=-L/usr/lib ./configure --enable-hdf4 && make 
> check
> 
> Give this a try and let me know if it doesn't work for you.

Heya, Ed!

Thanks for your help, this now seems to work. Unfortunately, the build
doesn't successfully finish (yet), as I get the following error:

   configure:25845: cc -o conftest -g -O2 -I/usr/include/hdf -L/usr/lib
conftest.c -lhdf5  -lhdf5_hl -lhdf5  -lm -lz -lhdf5 -lmfhdf -ldf -ljpeg
-lz >&5
   /tmp/ccdQCasV.o: In function `main':
   /home/MYHOME/tmp/software/build/libnetcdf4-4.1.1/conftest.c:109:
undefined reference to `H5Z_can_apply_szip'
   collect2: ld returned 1 exit status

In total, there's several 'undefined reference's:

   conftest.c:95: undefined reference to `_doprnt'
   conftest.c:97: undefined reference to `strlcat'
   conftest.c:109: undefined reference to `MPI_Comm_f2c'
   conftest.c:108: undefined reference to `H5Pget_fapl_mpiposix'
   conftest.c:108: undefined reference to `H5Pget_fapl_mpio'
   conftest.c:109: undefined reference to `H5Z_can_apply_szip'

Which is strange, because all the libraries the cc links to (using the
-lXXX flags) do exist in /usr/lib ...

The undefined references to the MPI stuff could be because I have the
libhdf5-serial-1.8.4 package installed, and not the MPI version. And it
might also be that the Ubuntu package is not linked against szip ... Any
ideas?

Thanks for your insight,

Andreas.



  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: