2018-12-07 06:36:53 +08:00
|
|
|
# Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
|
|
|
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014,
|
|
|
|
# 2015, 2016, 2017, 2018
|
|
|
|
# University Corporation for Atmospheric Research/Unidata.
|
|
|
|
|
|
|
|
# See netcdf-c/COPYRIGHT file for more info.
|
2012-09-14 04:41:54 +08:00
|
|
|
IF(BUILD_SHARED_LIBS AND WIN32)
|
2014-04-03 04:26:42 +08:00
|
|
|
remove_definitions(-DDLL_EXPORT)
|
|
|
|
remove_definitions(-DDLL_NETCDF)
|
2012-09-14 04:41:54 +08:00
|
|
|
ENDIF()
|
2012-08-07 00:57:29 +08:00
|
|
|
|
2012-08-22 04:08:53 +08:00
|
|
|
SET(ncdump_FILES ncdump.c vardata.c dumplib.c indent.c nctime0.c utils.c nciter.c)
|
2018-07-27 10:16:02 +08:00
|
|
|
SET(nccopy_FILES nccopy.c nciter.c chunkspec.c utils.c dimmap.c list.c)
|
2018-08-01 02:51:24 +08:00
|
|
|
SET(ocprint_FILES ocprint.c)
|
2012-08-08 06:58:15 +08:00
|
|
|
|
2012-09-14 04:41:54 +08:00
|
|
|
IF(USE_X_GETOPT)
|
2014-04-03 04:26:42 +08:00
|
|
|
SET(ncdump_FILES ${ncdump_FILES} XGetopt.c)
|
|
|
|
SET(nccopy_FILES ${nccopy_FILES} XGetopt.c)
|
2018-08-01 02:51:24 +08:00
|
|
|
SET(ocprint_FILES ${ocprint_FILES} XGetopt.c)
|
|
|
|
|
2012-09-14 02:27:23 +08:00
|
|
|
ENDIF()
|
|
|
|
|
2012-08-04 06:24:29 +08:00
|
|
|
ADD_EXECUTABLE(ncdump ${ncdump_FILES})
|
|
|
|
ADD_EXECUTABLE(nccopy ${nccopy_FILES})
|
2018-08-02 04:15:01 +08:00
|
|
|
|
|
|
|
IF(ENABLE_DAP)
|
|
|
|
ADD_EXECUTABLE(ocprint ${ocprint_FILES})
|
|
|
|
ENDIF(ENABLE_DAP)
|
2012-08-04 06:24:29 +08:00
|
|
|
|
2012-08-11 05:44:00 +08:00
|
|
|
TARGET_LINK_LIBRARIES(ncdump netcdf ${ALL_TLL_LIBS})
|
|
|
|
TARGET_LINK_LIBRARIES(nccopy netcdf ${ALL_TLL_LIBS})
|
2018-08-02 04:15:01 +08:00
|
|
|
|
|
|
|
IF(ENABLE_DAP)
|
|
|
|
TARGET_LINK_LIBRARIES(ocprint netcdf ${ALL_TLL_LIBS})
|
|
|
|
ENDIF(ENABLE_DAP)
|
2012-08-04 06:24:29 +08:00
|
|
|
|
2015-01-28 04:57:51 +08:00
|
|
|
####
|
|
|
|
# We have to do a little tweaking
|
|
|
|
# to remove the Release/ and Debug/ directories
|
|
|
|
# in MSVC builds. This is required to get
|
|
|
|
# test scripts to work.
|
|
|
|
####
|
|
|
|
IF(MSVC)
|
2015-02-05 05:11:20 +08:00
|
|
|
SET_TARGET_PROPERTIES(ncdump PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
2015-01-28 04:57:51 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2015-02-05 05:11:20 +08:00
|
|
|
SET_TARGET_PROPERTIES(ncdump PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
2015-01-28 04:57:51 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(ncdump PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2015-02-05 05:11:20 +08:00
|
|
|
SET_TARGET_PROPERTIES(nccopy PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
2015-01-28 04:57:51 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2015-02-05 05:11:20 +08:00
|
|
|
SET_TARGET_PROPERTIES(nccopy PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
2015-01-28 04:57:51 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(nccopy PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2018-08-01 02:51:24 +08:00
|
|
|
|
2018-08-02 04:15:01 +08:00
|
|
|
IF(ENABLE_DAP)
|
2018-08-01 02:51:24 +08:00
|
|
|
SET_TARGET_PROPERTIES(ocprint PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
2018-08-02 04:15:01 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(ocprint PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(ocprint PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
ENDIF(ENABLE_DAP)
|
|
|
|
|
2015-01-28 04:57:51 +08:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
2012-08-08 06:58:15 +08:00
|
|
|
IF(ENABLE_TESTS)
|
2014-04-03 04:26:42 +08:00
|
|
|
ADD_EXECUTABLE(rewrite-scalar rewrite-scalar.c)
|
|
|
|
ADD_EXECUTABLE(bom bom.c)
|
2016-01-06 13:26:20 +08:00
|
|
|
ADD_EXECUTABLE(tst_dimsizes tst_dimsizes.c)
|
2017-03-09 08:01:10 +08:00
|
|
|
ADD_EXECUTABLE(nctrunc nctrunc.c)
|
2014-04-03 04:26:42 +08:00
|
|
|
TARGET_LINK_LIBRARIES(rewrite-scalar netcdf)
|
|
|
|
TARGET_LINK_LIBRARIES(bom netcdf)
|
2016-01-06 13:26:20 +08:00
|
|
|
TARGET_LINK_LIBRARIES(tst_dimsizes netcdf)
|
2015-01-28 05:20:24 +08:00
|
|
|
|
2017-04-07 04:55:11 +08:00
|
|
|
IF(USE_NETCDF4)
|
|
|
|
ADD_EXECUTABLE(tst_fileinfo tst_fileinfo.c)
|
|
|
|
TARGET_LINK_LIBRARIES(tst_fileinfo netcdf)
|
|
|
|
ENDIF()
|
2016-05-04 11:17:06 +08:00
|
|
|
|
2017-04-07 04:55:11 +08:00
|
|
|
IF(MSVC)
|
|
|
|
SET_TARGET_PROPERTIES(rewrite-scalar PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(rewrite-scalar PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(rewrite-scalar PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2015-01-28 05:20:24 +08:00
|
|
|
|
2017-04-07 04:55:11 +08:00
|
|
|
SET_TARGET_PROPERTIES(bom PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(bom PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(bom PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2016-01-06 13:26:20 +08:00
|
|
|
|
2017-04-07 04:55:11 +08:00
|
|
|
SET_TARGET_PROPERTIES(tst_dimsizes PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(tst_dimsizes PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(tst_dimsizes PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2017-01-19 12:46:47 +08:00
|
|
|
|
2017-04-07 04:55:11 +08:00
|
|
|
SET_TARGET_PROPERTIES(nctrunc PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
2017-01-20 00:59:17 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2017-04-07 04:55:11 +08:00
|
|
|
SET_TARGET_PROPERTIES(nctrunc PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
2017-01-20 00:59:17 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2017-04-07 04:55:11 +08:00
|
|
|
SET_TARGET_PROPERTIES(nctrunc PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
2017-01-20 00:59:17 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
2017-04-07 04:55:11 +08:00
|
|
|
|
|
|
|
IF(USE_NETCDF4)
|
|
|
|
SET_TARGET_PROPERTIES(tst_fileinfo PROPERTIES RUNTIME_OUTPUT_DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(tst_fileinfo PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
SET_TARGET_PROPERTIES(tst_fileinfo PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
|
|
ENDIF(USE_NETCDF4)
|
2017-12-13 00:44:22 +08:00
|
|
|
ENDIF(MSVC)
|
2015-01-28 05:20:24 +08:00
|
|
|
|
2014-04-03 04:26:42 +08:00
|
|
|
# Base tests
|
|
|
|
# The tests are set up as a combination of shell scripts and executables that
|
|
|
|
# must be run in a particular order. It is painful but will use macros to help
|
|
|
|
# keep it from being too bad.
|
2015-02-05 05:11:20 +08:00
|
|
|
|
2014-04-03 04:26:42 +08:00
|
|
|
## Start adding tests in the appropriate order
|
2017-11-17 08:43:21 +08:00
|
|
|
add_sh_test(ncdump run_tests)
|
|
|
|
add_sh_test(ncdump tst_64bit)
|
2017-11-17 08:54:30 +08:00
|
|
|
add_bin_test_no_prefix(ref_ctest)
|
|
|
|
add_bin_test_no_prefix(ref_ctest64)
|
2014-04-03 04:26:42 +08:00
|
|
|
add_sh_test(ncdump tst_output)
|
|
|
|
add_sh_test(ncdump tst_lengths)
|
|
|
|
add_sh_test(ncdump tst_calendars)
|
2017-11-25 17:57:13 +08:00
|
|
|
build_bin_test_no_prefix(tst_utf8)
|
2014-04-03 04:26:42 +08:00
|
|
|
add_sh_test(ncdump run_utf8_tests)
|
2015-10-23 04:09:19 +08:00
|
|
|
IF(USE_NETCDF4)
|
|
|
|
add_sh_test(ncdump run_utf8_nc4_tests)
|
2017-01-20 00:59:17 +08:00
|
|
|
add_sh_test(ncdump tst_fileinfo)
|
re e-support UBS-599337
re pull request https://github.com/Unidata/netcdf-c/pull/405
re pull request https://github.com/Unidata/netcdf-c/pull/446
Notes:
1. This branch is a cleanup of the magic.dmh branch.
2. magic.dmh was originally merged, but caused problems with parallel IO.
It was re-issued as pull request https://github.com/Unidata/netcdf-c/pull/446.
3. This branch + pull request replace any previous pull requests and magic.dmh branch.
Given an otherwise valid netCDF file that has a corrupted header,
the netcdf library currently crashes. Instead, it should return
NC_ENOTNC.
Additionally, the NC_check_file_type code does not do the
forward search required by hdf5 files. It currently only looks
at file position 0 instead of 512, 1024, 2048,... Also, it turns
out that the HDF4 magic number is assumed to always be at the
beginning of the file (unlike HDF5).
The change is localized to libdispatch/dfile.c See
https://support.hdfgroup.org/release4/doc/DSpec_html/DS.pdf
Also, it turns out that the code in NC_check_file_type is duplicated
(mostly) in the function libsrc4/nc4file.c#nc_check_for_hdf.
This branch does the following.
1. Make NC_check_file_type return NC_ENOTNC instead of crashing.
2. Remove nc_check_for_hdf and centralize all file format checking
NC_check_file_type.
3. Add proper forward search for HDF5 files (but not HDF4 files)
to look for the magic number at offsets of 0, 512, 1024...
4. Add test tst_hdf5_offset.sh. This tests that hdf5 files with
an offset are properly recognized. It does so by prefixing
a legal file with some number of zero bytes: 512, 1024, etc.
5. Off-topic: Added -N flag to ncdump to force a specific output dataset name.
2017-10-25 06:25:09 +08:00
|
|
|
add_sh_test(ncdump tst_hdf5_offset)
|
2015-10-23 04:09:19 +08:00
|
|
|
ENDIF(USE_NETCDF4)
|
|
|
|
|
2017-11-21 08:02:16 +08:00
|
|
|
add_sh_test(ncdump tst_null_byte_padding)
|
|
|
|
IF(USE_STRICT_NULL_BYTE_HEADER_PADDING)
|
|
|
|
SET_TESTS_PROPERTIES(ncdump_tst_null_byte_padding PROPERTIES WILL_FAIL TRUE)
|
|
|
|
ENDIF(USE_STRICT_NULL_BYTE_HEADER_PADDING)
|
2017-11-21 04:52:06 +08:00
|
|
|
|
2014-04-03 04:26:42 +08:00
|
|
|
add_sh_test(ncdump tst_nccopy3)
|
2018-04-26 18:36:26 +08:00
|
|
|
IF(HAVE_BASH)
|
|
|
|
SET_TESTS_PROPERTIES(ncdump_tst_nccopy3 PROPERTIES RUN_SERIAL TRUE)
|
|
|
|
ENDIF(HAVE_BASH)
|
2017-12-07 06:00:21 +08:00
|
|
|
|
2017-09-02 01:58:37 +08:00
|
|
|
add_sh_test(ncdump tst_nccopy3_subset)
|
2014-04-03 04:26:42 +08:00
|
|
|
add_sh_test(ncdump tst_charfill)
|
2015-01-31 00:40:48 +08:00
|
|
|
|
2015-05-30 03:34:35 +08:00
|
|
|
add_sh_test(ncdump tst_formatx3)
|
|
|
|
add_sh_test(ncdump tst_bom)
|
2016-01-09 03:55:11 +08:00
|
|
|
add_sh_test(ncdump tst_dimsizes)
|
2017-04-07 04:55:11 +08:00
|
|
|
|
2015-04-21 06:06:20 +08:00
|
|
|
# The following test script invokes
|
|
|
|
# gcc directly.
|
|
|
|
IF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
|
2015-05-30 03:34:35 +08:00
|
|
|
IF(ENABLE_LARGE_FILE_TESTS)
|
2015-04-21 06:06:20 +08:00
|
|
|
add_sh_test(ncdump tst_iter)
|
2015-05-30 03:34:35 +08:00
|
|
|
ENDIF(ENABLE_LARGE_FILE_TESTS)
|
|
|
|
ENDIF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
|
2015-01-31 00:40:48 +08:00
|
|
|
|
2018-05-12 05:30:19 +08:00
|
|
|
add_sh_test(ncdump tst_inmemory_nc3)
|
|
|
|
IF(USE_NETCDF4)
|
2015-11-07 04:20:10 +08:00
|
|
|
add_sh_test(ncdump tst_inmemory_nc4)
|
2018-05-12 05:30:19 +08:00
|
|
|
ENDIF(USE_NETCDF4)
|
2015-02-05 05:11:20 +08:00
|
|
|
|
2014-04-03 04:26:42 +08:00
|
|
|
IF(USE_NETCDF4)
|
2017-11-25 17:57:13 +08:00
|
|
|
build_bin_test_no_prefix(tst_create_files)
|
|
|
|
build_bin_test_no_prefix(tst_group_data)
|
|
|
|
build_bin_test_no_prefix(tst_enum_data)
|
|
|
|
build_bin_test_no_prefix(tst_opaque_data)
|
|
|
|
build_bin_test_no_prefix(tst_string_data)
|
|
|
|
build_bin_test_no_prefix(tst_vlen_data)
|
|
|
|
build_bin_test_no_prefix(tst_comp)
|
|
|
|
build_bin_test_no_prefix(tst_comp2)
|
|
|
|
build_bin_test_no_prefix(tst_nans)
|
|
|
|
build_bin_test_no_prefix(tst_h_scalar)
|
2014-04-03 04:26:42 +08:00
|
|
|
add_sh_test(ncdump tst_formatx4)
|
|
|
|
# Add this test by hand, as it is also called from a script.
|
|
|
|
# Editing the script would break autotools compatibility.
|
2017-11-25 17:57:13 +08:00
|
|
|
build_bin_test_no_prefix(tst_special_atts)
|
|
|
|
build_bin_test_no_prefix(tst_compress)
|
|
|
|
build_bin_test_no_prefix(tst_chunking)
|
2017-11-17 08:54:30 +08:00
|
|
|
|
2016-04-29 04:41:42 +08:00
|
|
|
###
|
|
|
|
# This test fails on Visual Studio builds with bash.
|
|
|
|
# It passes, but technically fails because the scientific
|
|
|
|
# formatting omits a 0.
|
|
|
|
###
|
2017-12-13 00:44:22 +08:00
|
|
|
IF(EXTRA_TESTS)
|
2016-04-29 04:41:42 +08:00
|
|
|
add_sh_test(ncdump run_back_comp_tests)
|
2017-12-13 00:44:22 +08:00
|
|
|
IF(MSVC)
|
|
|
|
SET_TESTS_PROPERTIES(ncdump_run_back_comp_tests PROPERTIES WILL_FAIL TRUE)
|
|
|
|
ENDIF(MSVC)
|
|
|
|
ENDIF(EXTRA_TESTS)
|
2016-04-29 04:41:42 +08:00
|
|
|
|
2015-04-21 06:06:20 +08:00
|
|
|
# Known failure on MSVC; the number of 0's padding
|
|
|
|
# is different, but the result is actually correct.
|
2017-11-26 04:49:05 +08:00
|
|
|
IF(HAVE_BASH)
|
|
|
|
add_sh_test(ncdump tst_netcdf4)
|
|
|
|
build_bin_test_no_prefix(tst_h_rdc0)
|
|
|
|
ENDIF()
|
2015-04-21 03:18:24 +08:00
|
|
|
|
2017-11-25 17:57:13 +08:00
|
|
|
build_bin_test_no_prefix(tst_unicode)
|
2015-04-21 03:18:24 +08:00
|
|
|
|
2017-11-25 17:57:13 +08:00
|
|
|
build_bin_test_no_prefix(tst_fillbug)
|
2017-11-17 08:54:30 +08:00
|
|
|
add_sh_test(ncdump_sh tst_fillbug)
|
2015-04-21 03:18:24 +08:00
|
|
|
|
2017-12-13 00:44:22 +08:00
|
|
|
add_sh_test(ncdump tst_netcdf4_4)
|
2018-04-27 04:38:56 +08:00
|
|
|
IF(MSVC AND HAVE_BASH)
|
2017-12-13 00:44:22 +08:00
|
|
|
SET_TESTS_PROPERTIES(ncdump_tst_netcdf4_4 PROPERTIES WILL_FAIL TRUE)
|
2018-04-27 04:38:56 +08:00
|
|
|
ENDIF(MSVC AND HAVE_BASH)
|
2015-02-05 05:11:20 +08:00
|
|
|
|
2017-05-25 04:25:22 +08:00
|
|
|
###
|
|
|
|
# Some test reordering was required to ensure these tests
|
|
|
|
# only ran after ncdump was built.
|
|
|
|
###
|
|
|
|
add_sh_test(ncdump run_ncgen_tests)
|
|
|
|
IF(USE_NETCDF4)
|
|
|
|
add_sh_test(ncdump run_ncgen_nc4_tests)
|
2017-12-13 00:44:22 +08:00
|
|
|
ENDIF(USE_NETCDF4)
|
2016-04-29 04:41:42 +08:00
|
|
|
|
2014-04-03 04:26:42 +08:00
|
|
|
add_sh_test(ncdump tst_grp_spec)
|
|
|
|
add_sh_test(ncdump tst_mud)
|
|
|
|
add_sh_test(ncdump_shell tst_h_scalar)
|
2017-12-13 00:44:22 +08:00
|
|
|
|
2017-12-02 06:04:13 +08:00
|
|
|
add_sh_test(ncdump tst_nccopy4)
|
2018-04-26 18:36:26 +08:00
|
|
|
IF(HAVE_BASH)
|
|
|
|
SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES RUN_SERIAL TRUE)
|
|
|
|
ENDIF(HAVE_BASH)
|
2015-02-05 05:11:20 +08:00
|
|
|
|
2018-07-27 10:16:02 +08:00
|
|
|
add_sh_test(ncdump tst_nccopy5)
|
|
|
|
IF(HAVE_BASH)
|
|
|
|
SET_TESTS_PROPERTIES(ncdump_tst_nccopy5 PROPERTIES RUN_SERIAL TRUE)
|
|
|
|
ENDIF(HAVE_BASH)
|
|
|
|
|
2017-12-13 00:44:22 +08:00
|
|
|
IF(USE_NETCDF4)
|
|
|
|
add_sh_test(ncdump tst_ncgen4)
|
|
|
|
ENDIF(USE_NETCDF4)
|
2012-08-10 06:54:19 +08:00
|
|
|
|
2015-11-20 04:44:07 +08:00
|
|
|
add_sh_test(ncdump tst_inttags)
|
|
|
|
IF(USE_NETCDF4)
|
|
|
|
add_sh_test(ncdump tst_inttags4)
|
2017-12-13 00:44:22 +08:00
|
|
|
ENDIF(USE_NETCDF4)
|
2015-11-20 04:44:07 +08:00
|
|
|
|
2017-12-13 00:44:22 +08:00
|
|
|
ENDIF()
|
2012-08-10 06:54:19 +08:00
|
|
|
|
2012-08-08 06:58:15 +08:00
|
|
|
ENDIF()
|
|
|
|
|
2012-09-20 05:32:28 +08:00
|
|
|
IF(MSVC)
|
2015-02-05 05:11:20 +08:00
|
|
|
SET_TARGET_PROPERTIES(ncdump
|
2014-04-03 04:26:42 +08:00
|
|
|
PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
|
|
|
|
)
|
|
|
|
SET_TARGET_PROPERTIES(nccopy
|
|
|
|
PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
|
|
|
|
)
|
2018-08-02 04:15:01 +08:00
|
|
|
|
|
|
|
IF(ENABLE_DAP)
|
|
|
|
SET_TARGET_PROPERTIES(ocprint
|
|
|
|
PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
|
|
|
|
)
|
|
|
|
ENDIF(ENABLE_DAP)
|
2012-09-20 05:32:28 +08:00
|
|
|
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
2013-08-23 01:15:12 +08:00
|
|
|
INSTALL(TARGETS ncdump RUNTIME DESTINATION bin COMPONENT utilities)
|
|
|
|
INSTALL(TARGETS nccopy RUNTIME DESTINATION bin COMPONENT utilities)
|
2018-08-02 04:15:01 +08:00
|
|
|
|
2012-10-18 05:14:30 +08:00
|
|
|
SET(MAN_FILES nccopy.1 ncdump.1)
|
2013-06-04 00:42:04 +08:00
|
|
|
|
2018-03-16 22:38:40 +08:00
|
|
|
# Note, the L512.bin file is file containing exactly 512 bytes each of value 0.
|
re e-support UBS-599337
re pull request https://github.com/Unidata/netcdf-c/pull/405
re pull request https://github.com/Unidata/netcdf-c/pull/446
Notes:
1. This branch is a cleanup of the magic.dmh branch.
2. magic.dmh was originally merged, but caused problems with parallel IO.
It was re-issued as pull request https://github.com/Unidata/netcdf-c/pull/446.
3. This branch + pull request replace any previous pull requests and magic.dmh branch.
Given an otherwise valid netCDF file that has a corrupted header,
the netcdf library currently crashes. Instead, it should return
NC_ENOTNC.
Additionally, the NC_check_file_type code does not do the
forward search required by hdf5 files. It currently only looks
at file position 0 instead of 512, 1024, 2048,... Also, it turns
out that the HDF4 magic number is assumed to always be at the
beginning of the file (unlike HDF5).
The change is localized to libdispatch/dfile.c See
https://support.hdfgroup.org/release4/doc/DSpec_html/DS.pdf
Also, it turns out that the code in NC_check_file_type is duplicated
(mostly) in the function libsrc4/nc4file.c#nc_check_for_hdf.
This branch does the following.
1. Make NC_check_file_type return NC_ENOTNC instead of crashing.
2. Remove nc_check_for_hdf and centralize all file format checking
NC_check_file_type.
3. Add proper forward search for HDF5 files (but not HDF4 files)
to look for the magic number at offsets of 0, 512, 1024...
4. Add test tst_hdf5_offset.sh. This tests that hdf5 files with
an offset are properly recognized. It does so by prefixing
a legal file with some number of zero bytes: 512, 1024, etc.
5. Off-topic: Added -N flag to ncdump to force a specific output dataset name.
2017-10-25 06:25:09 +08:00
|
|
|
# It is used for creating hdf5 files with varying offsets for testing.
|
2013-06-04 00:42:04 +08:00
|
|
|
|
re e-support UBS-599337
re pull request https://github.com/Unidata/netcdf-c/pull/405
re pull request https://github.com/Unidata/netcdf-c/pull/446
Notes:
1. This branch is a cleanup of the magic.dmh branch.
2. magic.dmh was originally merged, but caused problems with parallel IO.
It was re-issued as pull request https://github.com/Unidata/netcdf-c/pull/446.
3. This branch + pull request replace any previous pull requests and magic.dmh branch.
Given an otherwise valid netCDF file that has a corrupted header,
the netcdf library currently crashes. Instead, it should return
NC_ENOTNC.
Additionally, the NC_check_file_type code does not do the
forward search required by hdf5 files. It currently only looks
at file position 0 instead of 512, 1024, 2048,... Also, it turns
out that the HDF4 magic number is assumed to always be at the
beginning of the file (unlike HDF5).
The change is localized to libdispatch/dfile.c See
https://support.hdfgroup.org/release4/doc/DSpec_html/DS.pdf
Also, it turns out that the code in NC_check_file_type is duplicated
(mostly) in the function libsrc4/nc4file.c#nc_check_for_hdf.
This branch does the following.
1. Make NC_check_file_type return NC_ENOTNC instead of crashing.
2. Remove nc_check_for_hdf and centralize all file format checking
NC_check_file_type.
3. Add proper forward search for HDF5 files (but not HDF4 files)
to look for the magic number at offsets of 0, 512, 1024...
4. Add test tst_hdf5_offset.sh. This tests that hdf5 files with
an offset are properly recognized. It does so by prefixing
a legal file with some number of zero bytes: 512, 1024, etc.
5. Off-topic: Added -N flag to ncdump to force a specific output dataset name.
2017-10-25 06:25:09 +08:00
|
|
|
FILE(GLOB COPY_FILES ${CMAKE_BINARY_DIR}/ncgen/*.nc ${CMAKE_BINARY_DIR}/nc_test4/*.nc ${CMAKE_CURRENT_SOURCE_DIR}/*.ncml ${CMAKE_CURRENT_SOURCE_DIR}/*.nc ${CMAKE_CURRENT_SOURCE_DIR}/*.cdl ${CMAKE_CURRENT_SOURCE_DIR}/*.sh ${CMAKE_CURRENT_SOURCE_DIR}/*.1 ${CMAKE_CURRENT_SOURCE_DIR}/L512.bin)
|
2013-06-04 00:42:04 +08:00
|
|
|
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)
|
|
|
|
|
2014-09-20 02:43:39 +08:00
|
|
|
ADD_SUBDIRECTORY(cdl)
|
|
|
|
ADD_SUBDIRECTORY(expected)
|
2013-06-04 00:42:04 +08:00
|
|
|
|
2012-08-28 05:49:09 +08:00
|
|
|
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CLEANFILES}")
|
|
|
|
|
2015-02-05 05:11:20 +08:00
|
|
|
IF(NOT MSVC)
|
2014-04-03 04:26:42 +08:00
|
|
|
INSTALL(FILES ${MAN_FILES} DESTINATION "share/man/man1" COMPONENT documentation)
|
2013-06-04 00:42:04 +08:00
|
|
|
ENDIF()
|