mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
Merge branch 'master' into ejh_hdf4_dispatch_unidata2
This commit is contained in:
commit
13fcc67d90
@ -325,6 +325,35 @@ IF(${CMAKE_SYSTEM_NAME} EQUAL "Darwin")
|
||||
SET(CMAKE_OSX_ARCHITECTURES i386;x86_64)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} EQUAL "Darwin")
|
||||
|
||||
# Macro for replacing '/MD' with '/MT'.
|
||||
# Used only on Windows, /MD tells VS to use the shared
|
||||
# CRT libs, MT tells VS to use the static CRT libs.
|
||||
#
|
||||
# Taken From:
|
||||
# http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F
|
||||
#
|
||||
MACRO(specify_static_crt_flag)
|
||||
SET(vars
|
||||
CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_MINSIZEREL
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
|
||||
FOREACH(flag_var ${vars})
|
||||
IF(${flag_var} MATCHES "/MD")
|
||||
STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
FOREACH(flag_var ${vars})
|
||||
MESSAGE(STATUS " '${flag_var}': ${${flag_var}}")
|
||||
ENDFOREACH()
|
||||
MESSAGE(STATUS "")
|
||||
ENDMACRO()
|
||||
|
||||
# Option to use Static Runtimes in MSVC
|
||||
IF(MSVC)
|
||||
OPTION(NC_USE_STATIC_CRT "Use static CRT Libraries ('\\MT')." OFF)
|
||||
@ -402,7 +431,7 @@ IF(NC_EXTRA_DEPS)
|
||||
STRING(REGEX REPLACE "^-l" "" _LIB ${_DEP})
|
||||
FIND_LIBRARY("${_LIB}_DEP" NAMES "${_LIB}" "lib${_LIB}")
|
||||
MESSAGE(${${_LIB}_DEP})
|
||||
IF(NOT "${_LIB}_DEP")
|
||||
IF("${${_LIB}_DEP}" STREQUAL "${_LIB}_DEP-NOTFOUND")
|
||||
MESSAGE(FATAL_ERROR "Error finding ${_LIB}.")
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Found ${_LIB}: ${${_LIB}_DEP}")
|
||||
@ -697,8 +726,17 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
|
||||
ENDIF()
|
||||
ENDIF(NOT MSVC)
|
||||
|
||||
#//////////////////////////
|
||||
#HDF5 can be optionally linked with the SZIP library (Science Data Lossless Compression Program) and ZLIB
|
||||
#Symbol to detect in ZLIB can be only H5Z_DEFLATE, a structure only defined in H5Zdeflate.c if the filter is enabled
|
||||
#For SZIP the structure can be only H5Z_SZIP, defined in H5Zszip.c if the filter is enabled
|
||||
#check_library_exists() tries to link a temporary program with these symbols
|
||||
#On MSVC for this detection to work, the HDF5 library MUST HAVE as additional dependencies the ZLIB and SZIP libraries,
|
||||
#which is not a requirement for the library to build successfully
|
||||
#//////////////////////////
|
||||
|
||||
# Make sure the user has built the library with zlib support.
|
||||
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_deflate "" HAVE_H5PSET_DEFLATE)
|
||||
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Z_DEFLATE "" HAVE_H5PSET_DEFLATE)
|
||||
|
||||
#Check to see if H5Z_SZIP exists in HDF5_Libraries. If so, we must use szip.
|
||||
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Z_SZIP "" USE_SZIP)
|
||||
@ -767,6 +805,9 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)
|
||||
INCLUDE_DIRECTORIES(${HAVE_HDF5_H})
|
||||
ENDIF(NOT HAVE_HDF5_H)
|
||||
|
||||
#option to include HDF5 High Level header file (hdf5_hl.h) in case we are not doing a make install
|
||||
INCLUDE_DIRECTORIES(${HDF5_HL_INCLUDE_DIR})
|
||||
|
||||
|
||||
ENDIF(USE_HDF5 OR ENABLE_NETCDF_4)
|
||||
|
||||
@ -1640,34 +1681,7 @@ MACRO(add_sh_test prefix F)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
# Macro for replacing '/MD' with '/MT'.
|
||||
# Used only on Windows, /MD tells VS to use the shared
|
||||
# CRT libs, MT tells VS to use the static CRT libs.
|
||||
#
|
||||
# Taken From:
|
||||
# http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F
|
||||
#
|
||||
MACRO(specify_static_crt_flag)
|
||||
SET(vars
|
||||
CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_MINSIZEREL
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG
|
||||
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL
|
||||
CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
||||
|
||||
FOREACH(flag_var ${vars})
|
||||
IF(${flag_var} MATCHES "/MD")
|
||||
STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
|
||||
ENDIF()
|
||||
ENDFOREACH()
|
||||
|
||||
FOREACH(flag_var ${vars})
|
||||
MESSAGE(STATUS " '${flag_var}': ${${flag_var}}")
|
||||
ENDFOREACH()
|
||||
MESSAGE(STATUS "")
|
||||
ENDMACRO()
|
||||
|
||||
# A function used to create autotools-style 'yes/no' definitions.
|
||||
# If a variable is set, it 'yes' is returned. Otherwise, 'no' is
|
||||
|
@ -7,6 +7,8 @@ This file contains a high-level description of this package's evolution. Release
|
||||
|
||||
## 4.6.1 - TBD
|
||||
|
||||
* [Bug Fix] Improved support for CRT builds with Visual Studio, improves zlib detection in hdf5 library. See [Github #853](https://github.com/Unidata/netcdf-c/pull/853) for more information.
|
||||
|
||||
## 4.6.0 - January 24, 2018
|
||||
* [Enhancement] Full support for using HDF5 dynamic filters, both for reading and writing. See the file docs/filters.md.
|
||||
* [Enhancement] Added an option to enable strict null-byte padding for headers; this padding was specified in the spec but was not enforced. Enabling this option will allow you to check your files, as it will return an E_NULLPAD error. It is possible for these files to have been written by older versions of libnetcdf. There is no effective problem caused by this lack of null padding, so enabling these options is informational only. The options for `configure` and `cmake` are `--enable-strict-null-byte-header-padding` and `-DENABLE_STRICT_NULL_BYTE_HEADER_PADDING`, respectively. See [Github #657](https://github.com/Unidata/netcdf-c/issues/657) for more information.
|
||||
|
@ -26,7 +26,7 @@ main(int argc, char **argv)
|
||||
{
|
||||
int ncid, dimids[NUM_DIMS];
|
||||
int varid;
|
||||
int nvars_in, varids_in[NUM_VARS];
|
||||
int nvars_in, varids_in[NUM_VARS] = {0};
|
||||
signed char fill_value = 42, fill_value_in;
|
||||
nc_type xtype_in;
|
||||
size_t len_in;
|
||||
@ -777,6 +777,7 @@ main(int argc, char **argv)
|
||||
|
||||
int dimids[NDIMS5], dimids_in[NDIMS5];
|
||||
int varid, varid1, varid2, varid3, varid4;
|
||||
int varids_in4[NVAR4] = {0};
|
||||
int ndims, nvars, natts, unlimdimid;
|
||||
nc_type xtype_in;
|
||||
char name_in[NC_MAX_NAME + 1];
|
||||
@ -959,9 +960,9 @@ main(int argc, char **argv)
|
||||
if (nc_inq(ncid, &ndims, &nvars, &natts, &unlimdimid)) ERR;
|
||||
if (ndims != NDIMS5 || nvars != NVAR4 || natts != 0 ||
|
||||
unlimdimid != -1) ERR;
|
||||
if (nc_inq_varids(ncid, &nvars, varids_in)) ERR;
|
||||
if (nc_inq_varids(ncid, &nvars, varids_in4)) ERR;
|
||||
if (nvars != NVAR4) ERR;
|
||||
if (varids_in[0] != 0 || varids_in[1] != 1) ERR;
|
||||
if (varids_in4[0] != 0 || varids_in4[1] != 1) ERR;
|
||||
if (nc_inq_var(ncid, 0, name_in, &xtype_in, &ndims, dimids_in, &natts)) ERR;
|
||||
if (strcmp(name_in, VAR_NAME5) || xtype_in != NC_INT || ndims != 1 || natts != 0 ||
|
||||
dimids_in[0] != 0) ERR;
|
||||
|
Loading…
Reference in New Issue
Block a user