Re: [netcdfgroup] netCDF-C 4.3.1-rc3 now available --- HDF4 Cmake support ?

  • To: "Ward Fisher" <wfisher@xxxxxxxxxxxxxxxx>
  • Subject: Re: [netcdfgroup] netCDF-C 4.3.1-rc3 now available --- HDF4 Cmake support ?
  • From: "Pedro Vicente" <pvicente@xxxxxxx>
  • Date: Tue, 8 Oct 2013 12:31:58 -0700
Thanks, Ward

Just one more note

There are actually 2 HDF(4) libraries on the hdf-4.2.9 distribution

1) the "HDF" library
2) the "MFHDF" library, where MF stands for Multi File

You have a way to specify the MFHDF location with HAVE_MFHDF_H, but I believe a way to specify the "HDF" header location is also needed, otherwise I get compiling errors


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


#include "hdfi.h"

------------
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: "Pedro Vicente" <pvicente@xxxxxxx>
Cc: "HDF Users Discussion List" <hdf-forum@xxxxxxxxxxxxxxxxxx>; <netcdfgroup@xxxxxxxxxxxxxxxx>
Sent: Tuesday, October 08, 2013 11:26 AM
Subject: Re: [netcdfgroup] netCDF-C 4.3.1-rc3 now available --- HDF4 Cmake support ?


On 10/8/13 12:18 PM, Pedro Vicente wrote:

Hi Ward
'
Hi Pedro,

Thanks for the bug report; I will correct it for the next release!

-Ward

 -DHAVE_MFHDF_H=<path>,

yes, that was exactly what I was looking for.

I am not very familiar yet with CMake scripts, all these symbols are listed in CMakeLists.txt, the location of the HDF4 multi file library, as well
the HDF4 library names


CHECK_INCLUDE_FILE("mfhdf.h" HAVE_MFHDF_H)
FIND_LIBRARY(HDF4_DF_LIB NAMES df libdf)
FIND_LIBRARY(HDF4_MFHDF_LIB NAMES mfhdf libmfhdf)

I tried with these options, that for my case are

-D"HAVE_MFHDF_H=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 of projects ran without errors


-- CMake Summary:

--      Build Type:                     DEBUG
--      Building Shared Libraries:      OFF
--      Building netCDF-4:              ON
--      Building DAP Support:           ON
--      Building Utilities:             ON
--      Using pnetcdf:                  OFF
--      Using Parallel IO:              OFF
-- Linking against: I:\hdf5-1.8.11\build\bin\Debug\hdf5_D.lib;I:\hdf5-1.8.11\build\bin\Debug\hdf5_hl_D.lib;I:/zlib-1.2.5/build/bin/Debug/libzlib_D.lib;I:/szip-2
.1/build/bin/Debug/libszip_D.lib;J:/curl-7.29.0/builds/libcurl-vc10-x86-debug-static-ipv6-sspi-spnego-winssl/lib/libcurl_a_debug.lib;I:/hdf4_explorer/windows/lib/debug/singlethread
ed/hm421d.lib;I:/hdf4_explorer/windows/lib/debug/singlethreaded/hd421d.lib



However, when I opened the generated solution, I get a compiler error because the HDF4 header file still cannot be found by the compiler


2>J:\netcdf-c-4.3.1-rc3\include\nc4internal.h(32): fatal error C1083: Cannot open include file: 'mfhdf.h': No such file or directory

this is the offending line

#ifdef USE_HDF4
#include <mfhdf.h>
#endif


By looking at the project settings, for example for the project 'netcdf4', these are the names included in the "Additional Include directories", under the "C++ "->"General" option


J:/netcdf-c-4.3.1-rc3/build/libsrc4;J:/netcdf-c-4.3.1-rc3/libsrc4;I:/hdf5-1.8.11/src;I:/zlib-1.2.5;J:/curl-7.29.0/builds/libcurl-vc10-x86-debug-static-ipv6-sspi-spnego-winssl/include;J:/netcdf-c-4.3.1-rc3/include;J:/netcdf-c-4.3.1-rc3/oc2;J:/netcdf-c-4.3.1-rc3/libsrc;J:/netcdf-c-4.3.1-rc3/build;J:/netcdf-c-4.3.1-rc3/libsrc4/.;%(AdditionalIncludeDirectories)

As you can see the HDF5, zlib, curl locations are all there, but the HDF4 location is missing

A workaround for now is to add these locations manually, thanks for looking into this.

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: "Pedro Vicente" <pvicente@xxxxxxx>
Sent: Tuesday, October 08, 2013 10:22 AM
Subject: Re: [netcdfgroup] netCDF-C 4.3.1-rc3 now available --- HDF4 Cmake support ?


Hi Pedro,

It is complaining that it cannot find mfhdf.h; is this file present? If it is, then CMake should be locating it (assuming it is on the standard path); otherwise, if it is not on the standard path, you may need to pass the location to CMake using (I believe) -DHAVE_MFHDF_H=<path>, or by specifying the path using the 'CFLAGS' variable. I will look into this.

-Ward

On 10/8/13 12:14 AM, Pedro Vicente wrote:
Ward

Is there a way that I can make the Cmake build detect the HDF4 headers and libraries ?

I tried

$cd build
$cmake -C ../cmake/ConfigUser.cmake <all my previous options> -D"ENABLE_HDF4=ON"

where <all my previous options> are the options I used previously regarding HDF5, curl, etc.

I got the error

--
-- Looking for mfhdf.h
-- Looking for mfhdf.h - not found
CMake Error at CMakeLists.txt:411 (MESSAGE):
 HDF4 Support specified, cannot find file mfhdf.h


I tried the 'NC_USE_STATIC_CRT' option and it generated the projects with the static CRTs, thank you for doing that.

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: Tuesday, September 24, 2013 3:26 PM
Subject: [netcdfgroup] netCDF-C 4.3.1-rc3 now available


Hello all,

On behalf of the netCDF-C development team, we are happy to announce the availability of the third release candidate for netCDF-C version 4.3.1.

Highlights of this release beyond the previous release candidate include:

* netCDF-4 compilation with OpenMPI as an alternative to MPICH2.
* Addressed Parallel netCDF-4 hanging when using HDF5 1.8.10.
* Large File Support on Windows is now functional.
* A new option for CMake-based Visual Studio builds, 'NC_USE_STATIC_CRT', used to specify which type of CRT libraries to link against (shared being the default).


Source-code zip and tar.gz archives can be found at: http://github.com/Unidata/netcdf-c/releases/tag/v4.3.1-rc3

Complete release notes may be found at: http://www.unidata.ucar.edu/software/netcdf/docs_rc/release_notes.html

Pre-built Windows binaries are available from: http://www.unidata.ucar.edu/netcdf/docs_rc/winbin.html

We look forward to addressing any issues, questions or concerns which may arise from this release candidate.

Thank you in advance,

-Ward
Ward Fisher
wfisher@xxxxxxxxxxxxxxxx

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








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