Re: [netcdfgroup] [Hdf-forum] netCDF-C 4.3.1-RC5 Available - build HDF4 in Windows

Elena , Binh-Minh, I am going to need your help on this, since I am having trouble building the HDF4 library in a way that netCDF accepts it.

I just realized that the HDF4 version I was using was version 4.2.1 (circa year 1998) and the current version 4.2.9 has this symbol in h4config.h


/* Define if we support HDF NetCDF-3 APIs */
//#define H4_HAVE_NETCDF 1

So I am guessing here that this must be commented in the HDF4 build, so that netCDF accepts the HDF4 library without conflicts.

Is this the case?

There are 2 ways to build HDF4 in Windows:

1) Use the supplied Visual Studio projects
2) Use Cmake to generate Visual Studio projects

I tried 1)

"hdf" and "mfhdf" build fine
The current distro does not include the jpeg source. It should.
I had the jpeg source from version 4.2.1, so I can use that, no problem here.

This was done with

//#define H4_HAVE_NETCDF 1

commented , but I still have the same netCDF errors as in the last email.


So, assuming that the above build was done as it should, I am guessing here that the root of the problem is this symbol,
used by CMake of netCDF to detect "a"  HDF4 header location.

-D"MFHDF_H_INCLUDE_DIR=I:\hdf4-4.2.9-bin\include"

That I assume must include all the HDF4 headers.

Is this correct?

I tried to use

I:\hdf4-4.2.9-bin\include"

this place includes *all* the HDF4 headers, since this is a binary distribution (I use only the headers, not the libs)


This because the HDF5 *source* header locations includes 'mfhdf.h' and 'h4config.h' in different places.


I realize that this setting is a bit unusual (using source locations for the headers), but as a developer, binary distributions are totally useless for me , so
it would be great if anyone could come up with some fix for this

thanks

ps

these are the errors I get while compiling "netcdf4" from the generated CMake Visual Studio

2>J:\netcdf-c-4.3.1-rc5\include\netcdf_f.h(16): error C2054: expected '(' to follow 'EXTERNL' 2>J:\netcdf-c-4.3.1-rc5\include\netcdf_f.h(16): error C2085: 'nc_inq_var_chunking_ints' : not in formal parameter list 2>J:\netcdf-c-4.3.1-rc5\include\netcdf_f.h(18): error C2061: syntax error : identifier 'EXTERNL' 2>J:\netcdf-c-4.3.1-rc5\include\netcdf_f.h(22): error C2054: expected '(' to follow 'EXTERNL' 2>J:\netcdf-c-4.3.1-rc5\include\netcdf_f.h(23): error C2085: 'nc_open_par_fortran' : not in formal parameter list

[EDIT]

on closer look , these errors are actually different from the one from my first email

I:\hdf4_explorer\mfhdf\libsrc\netcdf.h(25): fatal error C1083: Cannot open
include file: 'hdfi.h': No such file or directory

so, it seems, that is solved, and this is another issue



----------------------
Pedro Vicente
pedro.vicente@xxxxxxxxxxxxxxxxxx
http://www.space-research.org/






----- Original Message ----- From: "Pedro Vicente" <pvicente@xxxxxxx>
To: <netcdfgroup@xxxxxxxxxxxxxxxx>; "Ward Fisher" <wfisher@xxxxxxxxxxxxxxxx>
Cc: "HDF Users Discussion List" <hdf-forum@xxxxxxxxxxxxxxxxxx>
Sent: Tuesday, December 10, 2013 8:41 PM
Subject: Re: [Hdf-forum] [netcdfgroup] netCDF-C 4.3.1-RC5 Available


Hi Ward

It seems there is still an issue with the CMake HDF4 settings.
This is for Windows

In my case I used

-D"MFHDF_H_INCLUDE_DIR=I:\hdf4_explorer\mfhdf\libsrc"
-D"HDF4_DF_LIB=I:\hdf4_explorer\windows\lib\debug\singlethreaded\hd421d.lib"
-D"HDF4_MFHDF_LIB=I:\hdf4_explorer\windows\lib\debug\singlethreaded\hm421d.lib"

The Cmake generation went fine.

But when I try to build the generated Visual Studio 2010 solution , I get this error


I:\hdf4_explorer\mfhdf\libsrc\netcdf.h(25): fatal error C1083: Cannot open include file: 'hdfi.h': No such file or directory


The file <HDF4 root>\mfhdf\libsrc\netcdf.h

is part of the HDF4 distribution.

There are 2 distinct HDF4 libraries, each one with their different locations and header files.

In the Unix world , I believe when doing

make install

all these headers are copied to the same place.

But this is not necessarily true in Windows. One can just specify any location for the headers.


I tried to copy 'hdfi.h' to the same location that 'mfhdf.h' is located , but then I get a multitude of errors in netCDF, either unknown or duplicated symbols, due to the fact that the 'netcdf.h'
used is the one from the HDF4 distribution.

I am not really sure how to solve this.

Maybe copy all the HDF4 headers (which ones?) to one place , omitting the netcdf.h from HDF4 ?

For the autoconf build of HDF4 and netCDF, when enabling HDF4, there are these flags

for HDF4

 --disable-netcdf

"to prevent it from building an HDF4 version of the netCDF-2 library that conflicts with the netCDF-2 functions that are built into the Unidata netCDF library."

and for netCDF

--enable-hdf4

http://www.unidata.ucar.edu/software/netcdf/docs/build_hdf4.html

so, it's my understanding that these flags must define some macros in the code of the *two* libraries (HDF4 and netCDF) that compile some parts of the code and not others.

Is this the case?

If yes, then maybe setting these macros manually in Windows should do.


Thanks

Pedro

------------
pvicente@xxxxxxx
Department of Earth System Science
3200 Croul Hall
University of California, Irvine
Irvine, CA 92697-3100







----- Original Message ----- From: "Ward Fisher" <wfisher@xxxxxxxxxxxxxxxx>
To: <netcdfgroup@xxxxxxxxxxxxxxxx>
Sent: Friday, December 06, 2013 11:27 AM
Subject: [netcdfgroup] netCDF-C 4.3.1-RC5 Available


Hello all,

The netCDF-C libraries 4.3.1-r5 are now available.

Highlights of this release beyond the previous release candidate include:

* Fixed netCDF-4 failure when renaming a dimension and renaming a variable using that dimension, in either order. NCF-177 * Fixed bug in ncgen; it was not properly filling empty string constants ("") to be the proper length. NCF-279 * Fixed bug in ncgen where it was interpreting int64 constants as uint64 constants. NCF-278* When opening a netCDF-4 file, streamline the iteration over objects in the underlying HDF5 file. * Fixed bug in handling Http Basic Authorization. The code was actually there but was not being executed. NCF-277 * When compiling with hdf4 support, both autotools and cmake-based builds now properly look for the libjpeg dependency and will link against it when found (or complain if it's not). Also added ENABLE_HDF4_FILE_TESTS option to CMake-based builds.

Complete release notes may be found at:

http://www.unidata.ucar.edu/software/netcdf/docs_rc/release_notes.html

Source-code zip and tar.gz archives can be found at:

* http://github.com/Unidata/netcdf-c/releases/tag/v4.3.1-rc5

Pre-built Windows binaries are available from:

http://www.unidata.ucar.edu/netcdf/docs_rc/winbin.html

Thanks all,

-Ward
Ward Fisher
wfisher@xxxxxxxxxxxxxxxx

_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/



_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@xxxxxxxxxxxxxxxxxx
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org





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