Commit 3837d203 authored by T.J. Corona's avatar T.J. Corona

Use an older version of netcdf

This is necessary until we update paraview to its latest master
parent bde4e116
Pipeline #135108 passed with stage
set(netcdf_libdir)
if (UNIX AND NOT APPLE)
set(netcdf_libdir
-DCMAKE_INSTALL_LIBDIR:BOOL=lib)
endif ()
superbuild_add_project(netcdf
DEPENDS hdf5 zlib
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DBUILD_TESTING:BOOL=OFF
-DENABLE_TESTS:BOOL=OFF
-DBUILD_UTILITIES:BOOL=OFF
-DUSE_SZIP:BOOL=OFF
-DENABLE_DAP:BOOL=OFF
${netcdf_libdir})
superbuild_apply_patch(netcdf vtk-tag
"Add #define to mark API as VTK-modified")
superbuild_apply_patch(netcdf find-hdf5-hl
"Fix use of old, undocumented FindHDF5 variable")
diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt
index 6603bd0..fcd616a 100644
--- a/liblib/CMakeLists.txt
+++ b/liblib/CMakeLists.txt
@@ -57,6 +57,9 @@ IF(USE_HDF5 OR USE_NETCDF4)
IF(HDF5_hdf5_hl_LIBRARY AND NOT HDF5_HL_LIBRARY)
SET(HDF5_HL_LIBRARY ${HDF5_hdf5_hl_LIBRARY})
ENDIF()
+ IF(HDF5_C_HL_LIBRARIES AND NOT HDF5_HL_LIBRARY)
+ SET(HDF5_HL_LIBRARY ${HDF5_C_HL_LIBRARIES})
+ ENDIF()
SET(TLL_LIBS ${HDF5_C_LIBRARY} ${HDF5_HL_LIBRARY} ${TLL_LIBS} ${SZIP_LIBRARY})
ELSE() # Windows CMake defines HDF5_LIBRARIES.
SET(TLL_LIBS ${HDF5_LIBRARIES} ${TLL_LIBS} ${SZIP_LIBRARY})
diff --git a/cxx/netcdfcpp.h b/cxx/netcdfcpp.h
index f3e9f19..0db228d 100644
--- a/cxx/netcdfcpp.h
+++ b/cxx/netcdfcpp.h
@@ -10,6 +10,12 @@
#ifndef NETCDF_HH
#define NETCDF_HH
+// We've changed the API from upstream in VTK commits 6223f230 and
+// 64cb89e3 to use size_t* instead of long* for (some) overloads of
+// methods like NcVar::get. This define signals users of this header
+// that they should use size_t for these methods.
+#define VTK_NETCDF_USE_SIZE_T
+
#include "ncvalues.h" // arrays that know their element type
typedef const char* NcToken; // names for netCDF objects
include("${CMAKE_CURRENT_LIST_DIR}/../netcdf.cmake")
# VS2015 support
superbuild_apply_patch(netcdf VS2015
"Support Visual Studio 2015")
# Fix wrong name of win32 into _win32
superbuild_apply_patch(netcdf fix-_win32-name
"Replace win32 with _win32")
diff -NrU5 netcdf-4.3.2/config.h.in.cmake netcdf-4.3.2.VS2015/config.h.in.cmake
--- netcdf-4.3.2/config.h.in.cmake 2014-04-23 17:35:20.000000000 -0400
+++ netcdf-4.3.2.VS2015/config.h.in.cmake 2016-12-08 15:46:21.000000000 -0500
@@ -28,19 +28,23 @@
#endif
#ifdef _WIN32
#ifndef strcasecmp
#define strcasecmp _stricmp
- #define snprintf _snprintf
+ #if defined(_MSC_VER) && (_MSC_VER < 1900)
+ #define snprintf _snprintf
+ #endif
#endif
#endif
#define strdup _strdup
#define fdopen _fdopen
#define write _write
- #define snprintf _snprintf
+ #if defined(_MSC_VER) && (_MSC_VER < 1900)
+ #define snprintf _snprintf
+ #endif
#define strtoll _strtoi64
#endif
/* Cache Size, other variables for HDF5 */
diff -Nru5 src/include/nc4internal.h src._win32/include/nc4internal.h
--- src/include/nc4internal.h 2017-02-27 10:05:26.251487500 -0500
+++ src._win32/include/nc4internal.h 2017-02-27 09:58:37.654095200 -0500
@@ -62,15 +62,15 @@
#define X_INT_MIN (-2147483647-1)
#define X_INT_MAX 2147483647
#define X_LONG_MIN X_INT_MIN
#define X_LONG_MAX X_INT_MAX
#define X_UINT_MAX 4294967295U
-#ifdef WIN32 /* Windows, of course, has to be a *little* different. */
+#ifdef _WIN32 /* Windows, of course, has to be a *little* different. */
#define X_FLOAT_MAX 3.402823466e+38f
#else
#define X_FLOAT_MAX 3.40282347e+38f
-#endif /* WIN32 */
+#endif /* _WIN32 */
#define X_FLOAT_MIN (-X_FLOAT_MAX)
#define X_DOUBLE_MAX 1.7976931348623157e+308
#define X_DOUBLE_MIN (-X_DOUBLE_MAX)
/* These have to do with creating chuncked datasets in HDF5. */
diff -Nru5 src/libsrc/ncx.h src._win32/libsrc/ncx.h
--- src/libsrc/ncx.h 2017-02-27 10:07:37.301704600 -0500
+++ src._win32/libsrc/ncx.h 2017-02-27 10:02:08.784493300 -0500
@@ -95,11 +95,15 @@
#define X_INT_MAX 2147483647
#define X_UINT_MAX 4294967295U
#define X_LONGLONG_MIN (-9223372036854775807LL-1LL)
#define X_LONGLONG_MAX 9223372036854775807LL
#define X_ULONGLONG_MAX 18446744073709551615ULL
+#ifdef _WIN32 /* Windows, of course, has to be a *little* different. */
#define X_FLOAT_MAX 3.402823466e+38f
+#else
+#define X_FLOAT_MAX 3.40282347e+38f
+#endif /* _WIN32 */
#define X_FLOAT_MIN (-X_FLOAT_MAX)
#define X_FLT_MAX X_FLOAT_MAX /* alias compatible with limits.h */
#if CRAYFLOAT
/* ldexp(1. - ldexp(.5 , -46), 1024) */
#define X_DOUBLE_MAX 1.79769313486230e+308
diff -Nru5 src/nc_test/tests.h src._win32/nc_test/tests.h
--- src/nc_test/tests.h 2017-02-27 10:05:23.392050500 -0500
+++ src._win32/nc_test/tests.h 2017-02-27 10:03:10.111914100 -0500
@@ -33,15 +33,15 @@
#define X_INT_MAX 2147483647
#if defined(FLT_MAX_EXP) && FLT_MAX_EXP < 128
/* FLT_MAX < X_FLOAT_MAX */
#define X_FLOAT_MAX FLT_MAX
#else
-#ifdef WIN32 /* Windows, of course, has to be a *little* different. */
+#ifdef _WIN32 /* Windows, of course, has to be a *little* different. */
#define X_FLOAT_MAX 3.402823466e+38f
#else
#define X_FLOAT_MAX 3.40282347e+38f
-#endif /* WIN32 */
+#endif /* _WIN32 */
#endif
#define X_FLOAT_MIN (-X_FLOAT_MAX)
#if CRAYFLOAT
/* ldexp(1. - ldexp(.5 , -46), 1024) */
#define X_DOUBLE_MAX 1.79769313486230e+308
......@@ -161,6 +161,12 @@ superbuild_set_revision(nlohmannjson
superbuild_set_revision(meshkit
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/meshkit")
# Use an older version of netcdf than what is supplied by the common superbuild.
# This is necessary until we move our paraview version to its latest master.
superbuild_set_revision(netcdf
URL "https://www.paraview.org/files/dependencies/netcdf-4.3.2.modified.tar.gz"
URL_MD5 1841196c2bfcf10246966eecf92ad0ec)
superbuild_set_revision(rggsession
GIT_REPOSITORY "https://gitlab.kitware.com/cmb/plugins/rgg-session"
GIT_TAG master)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment