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

[netCDF #BXR-962926]: Installing NetCDF library with HDF4 support



It looks to me like when you built hdf4, you did not
specify --disable-netcdf when building hdf4 - despite what
you say below. You might look at the file ${H4DIR}/lib/libhdf4.settings
and look for the line (probably at the end) that looks like this:
   Support for netCDF API 2.3.2: XXX
where XXX is either yes or no.

> Ok, the problem is the following error shown in config.log:
> > /usr/local/include/mfhdf.h:29:10: fatal error: 'netcdf.h' file not found
> 
> So mfhdf.h is being found, but for some reason netcdf.h is not being found.
> 
> 
> 
> > Sure, here are the values I’m using for CPPFLAGS and LDFLAGS:
> >
> > $ echo $CPPFLAGS
> > -I/usr/local/include -I/usr/local/include
> > $ echo $LDFLAGS
> > -L/usr/local/lib -L/usr/local/lib
> > $ echo $CFLAGS
> > -I/usr/local/include -I/usr/local/include
> >
> > The config.log is attached.
> > --
> > JP Rippe
> >
> > PhD Student - Marine Sciences
> > The University of North Carolina at Chapel Hill
> > Castillo Lab <http://castillolab.web.unc.edu/>
> >
> > > On Mar 3, 2019, at 3:27 PM, Unidata netCDF Support <address@hidden> wrote:
> > >
> > >> Does it need to be in /usr/include/ instead?
> > > No, where it is is fine. It must be the values you are using
> > > for LDFLAGS and CPPFLAGS (you might try setting CFLAGS=CPPFLAGS).
> > > Can you send the exact values you are using for them?
> > > Also, when building the netcdf-c library, can you send the contents
> > > of config.log?
> > >
> > >
> > >>
> > >> Thanks for the response. It is in ${H4DIR}/include. I set both H4DIR and 
> > >> H5DIR to “/usr/local/“ and it’s in there. Does it need to be in 
> > >> /usr/include/ instead?
> > >>
> > >> JP
> > >> --
> > >> JP Rippe
> > >>
> > >> PhD Student - Marine Sciences
> > >> The University of North Carolina at Chapel Hill
> > >> Castillo Lab <http://castillolab.web.unc.edu/>
> > >>
> > >>> On Mar 3, 2019, at 2:24 PM, Unidata netCDF Support <address@hidden> 
> > >>> wrote:
> > >>>
> > >>> Sorry for the delay.
> > >>> The first thing to do is to locate mfhdf.h.
> > >>> Can you see if it actually exists in ${H4DIR}/include?
> > >>> If not, see if you can find where it is installed.
> > >>> You might try this series of commands.
> > >>>   cd /usr; find . -name mfhdf.h
> > >>>
> > >>>
> > >>>>
> > >>>> I'm having trouble compiling the NetCDF library from source with HDF4
> > >>>> support. So far, I've followed the instructions for building and 
> > >>>> installing
> > >>>> the HDF4 library with the --disable-netcdf option:
> > >>>>
> > >>>> $ # Build and install HDF4
> > >>>> $ ./configure --enable-shared --disable-netcdf --disable-fortran
> > >>>> --prefix=${H4DIR}
> > >>>> $ make check
> > >>>> $ make install
> > >>>>
> > >>>> After that, I set my environment variable options CPPFLAGS and LDFLAGS 
> > >>>> to
> > >>>> the appropriate paths (-I/usr/local/include and -L/usr/local/lib) and 
> > >>>> tried
> > >>>> to compile the netcdf-c-4.6.2 package:
> > >>>>
> > >>>> $ # Build and install netCDF-4 with HDF4 access enabled
> > >>>> $ CPPFLAGS="-I${H5DIR}/include -I${H4DIR}/include" \
> > >>>> LDFLAGS="-L${H5DIR}/lib -L${H4DIR}/lib" \
> > >>>> ./configure --enable-hdf4 --enable-hdf4-file-tests
> > >>>>
> > >>>> However, I keep getting the error that it can't find mfhdf.h. I found 
> > >>>> this
> > >>>> exchange addressing the same problem (
> > >>>> https://www.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2010/msg00348.html),
> > >>>> but it was resolved by setting the environment variables as above and 
> > >>>> that
> > >>>> doesn't seem to help for me.
> > >>>>
> > >>>> I'm wondering if you might have any other suggestions that might 
> > >>>> resolve
> > >>>> the problem. My ultimate goal is to use the R library ncdf4 to analyze 
> > >>>> HDF4
> > >>>> files and any help would be very much appreciated. Looking forward to
> > >>>> hearing back.
> > >>>>
> > >>>> Thanks a lot,
> > >>>> JP
> > >>>>
> > >>>> --
> > >>>> JP Rippe
> > >>>>
> > >>>> PhD Candidate - Marine Sciences
> > >>>> The University of North Carolina at Chapel Hill
> > >>>> Castillo Lab <http://castillolab.web.unc.edu/>
> > >>>>
> > >>>>
> > >>>
> > >>> =Dennis Heimbigner
> > >>> Unidata
> > >>>
> > >>>
> > >>> Ticket Details
> > >>> ===================
> > >>> Ticket ID: BXR-962926
> > >>> Department: Support netCDF
> > >>> Priority: Urgent
> > >>> Status: Open
> > >>> ===================
> > >>> 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.
> > >>>
> > >>>
> > >>
> > >>
> > >>
> > >
> > > =Dennis Heimbigner
> > >  Unidata
> > >
> > >
> > > Ticket Details
> > > ===================
> > > Ticket ID: BXR-962926
> > > Department: Support netCDF
> > > Priority: Urgent
> > > Status: Open
> > > ===================
> > > 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.
> > >
> > >
> >
> >
> 
> =Dennis Heimbigner
> Unidata
> 

=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: BXR-962926
Department: Support netCDF
Priority: Urgent
Status: Open
===================
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.