Unidata / netcdf-cxx4

Official GitHub repository for netCDF-C++ libraries and utilities.
Other
126 stars 49 forks source link

Can't build netcdf-cxx4 with MSVC2019; missing HDF5 config and wrong subdirectories #104

Open szumial opened 3 years ago

szumial commented 3 years ago

Hi! I am trying to build netcdf-cxx4-4.3.1 using cmake GUI and I can't proceed with the process due to some HDF5 errors and wrong CMakeLists subdirectories. My issue is similar to Issue 90: https://github.com/Unidata/netcdf-cxx4/issues/90

Environment details: Windows 10 x64 MSVC 2019 CMake GUI 3.19.1 netcdf 4.8.0 HDF5 - various versions

The netcdf 4.8.0 and HDF5 have been installed using the pre-packaged installers for Windows 10 x64.

First of all, my problem is that the HDF5 is missing the required H5Free (Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.). This happens regardless of the HDF5 version used - as suggested in Issue 90, I have started with the 1.12.0 abd then switched to a 1.10.x release and the problem persisted.

Another issue I am getting is that _CMake Error at CMakeLists.txt:639 (ADD_SUBDIRECTORY): ADDSUBDIRECTORY given source "cxx4" which is not an existing directory. error. I am unsure what is causing this error message to pop up.

My CMake log is as follows:

Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19042. Bash shell not found; disabling shell script tests. CMake Error at CMakeLists.txt:405 (CHECK_LIBRARY_EXISTS): CHECK_LIBRARY_EXISTS Macro invoked with incorrect arguments for macro named: CHECK_LIBRARY_EXISTS

Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.

NetCDF C Configuration Summary

==============================

General


NetCDF Version: 4.3.1 Configured On:
Host System: -- Build Directory: C:/Users/szumi/Downloads/netcdf-cxx4-4.3.1/build Install Prefix:

Compiling Options


C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe CFLAGS: /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 CPPFLAGS: /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MDd /Zi /Ob0 /Od /RTC1 LDFLAGS: /machine:x64 /debug /INCREMENTAL AM_CFLAGS:
AM_CPPFLAGS:
AM_LDFLAGS:
Shared Library: yes Static Library: no Extra libraries:

CMake Error at CMakeLists.txt:639 (ADD_SUBDIRECTORY): ADD_SUBDIRECTORY given source "cxx4" which is not an existing directory.