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

  • To: Andreas <lists@xxxxxxxxxx>
  • Subject: Re: [netcdfgroup] mfhdf.h not found even though it's present
  • From: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
  • Date: Fri, 13 Aug 2010 03:15:58 -0600
Andreas <lists@xxxxxxxxxx> writes:

> Thanks for your comment!
>
>> The option --enable-hdf4  only tells it to compile to use hdf4, it does not 
>> tell it where that resides, and /usr/include/hdf must not be in your search 
>> paths. I forget the exact form of the option that tells it that but it is 
>> something like:
>> 
>> --with-hdf4=
>
> Yes, I know about that. And I didn't try using it because ``./configure
> --help`` says:
>
>   --with-hdf4=<directory> Specify location of HDF4 library. Configure
>     will expect to find subdirs include and lib.
>
> And as I wrote, the libs are in /usr/lib, the headers in /usr/include/hdf.
>
> 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.

Thanks!

Ed

-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



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