From df36f9a3b7b5c0a087c70f5bf9d3052c06322a11 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 13 Jun 2022 09:19:22 -0300 Subject: [PATCH 01/25] update to v4.9.0 and refresh patches --- recipe/meta.yaml | 8 ++--- ...ndows-VS2008-define-__func__-as-__FU.patch | 11 +++--- ...ng-code-to-handle-VS-in-test_common.patch} | 36 +++++++++---------- recipe/patches/fix-rename.patch | 26 -------------- 4 files changed, 27 insertions(+), 54 deletions(-) rename recipe/patches/{0008-Finish-the-missing-code-to-handle-VS-in-test_common..patch => 0008-Finish-the-missing-code-to-handle-VS-in-test_common.patch} (66%) delete mode 100644 recipe/patches/fix-rename.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 530d40a8..b2278ee6 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ -{% set version = "4.8.1" %} -{% set build = 2 %} +{% set version = "4.9.0" %} +{% set build = 0 %} # recipe-lint fails if mpi is undefined {% set mpi = mpi or 'nompi' %} @@ -14,7 +14,7 @@ package: source: url: https://github.com/Unidata/netcdf-c/archive/v{{ version }}.tar.gz - sha256: bc018cc30d5da402622bf76462480664c6668b55eb16ba205a0dfb8647161dd0 + sha256: 9f4cb864f3ab54adb75409984c6202323d2fc66c003e5308f3cdf224ed41c0a6 patches: - patches/0004-Prefer-getenv-TOPSRCDIR-over-STRINGIFY-TOPSRCDIR.patch - patches/0006-Fix-tests-for-Windows-VS2008-define-__func__-as-__FU.patch @@ -25,8 +25,6 @@ source: - patches/do_not_use_16_processes_in_tests.patch # [ppc64le] # Revert upstream change in 4.8.1--maybe unnecessary in 4.8.2 - patches/fix_cmake.patch # [win] - # Fix renaming file with multiple builds--will be in 4.8.2 - - patches/fix-rename.patch build: number: {{ build }} diff --git a/recipe/patches/0006-Fix-tests-for-Windows-VS2008-define-__func__-as-__FU.patch b/recipe/patches/0006-Fix-tests-for-Windows-VS2008-define-__func__-as-__FU.patch index 74eb08a4..eda84b82 100644 --- a/recipe/patches/0006-Fix-tests-for-Windows-VS2008-define-__func__-as-__FU.patch +++ b/recipe/patches/0006-Fix-tests-for-Windows-VS2008-define-__func__-as-__FU.patch @@ -1,12 +1,13 @@ ---- netcdf-c-4.6.3.orig/config.h.cmake.in 2019-02-28 17:40:34.000000000 -0300 -+++ netcdf-c-4.6.3/config.h.cmake.in 2019-03-04 12:40:57.383805113 -0300 -@@ -67,6 +67,9 @@ - #endif +--- netcdf-c-4.9.0.orig/config.h.cmake.in 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/config.h.cmake.in 2022-06-13 09:07:44.793148154 -0300 +@@ -57,6 +57,10 @@ + #define _OFF_T_DEFINED #endif + #if _MSC_VER<1900 + #define __func__ __FUNCTION__ + #endif - ++ #define strdup _strdup #define fdopen _fdopen + #define write _write diff --git a/recipe/patches/0008-Finish-the-missing-code-to-handle-VS-in-test_common..patch b/recipe/patches/0008-Finish-the-missing-code-to-handle-VS-in-test_common.patch similarity index 66% rename from recipe/patches/0008-Finish-the-missing-code-to-handle-VS-in-test_common..patch rename to recipe/patches/0008-Finish-the-missing-code-to-handle-VS-in-test_common.patch index 2c6b2945..91a8e8db 100644 --- a/recipe/patches/0008-Finish-the-missing-code-to-handle-VS-in-test_common..patch +++ b/recipe/patches/0008-Finish-the-missing-code-to-handle-VS-in-test_common.patch @@ -1,10 +1,10 @@ -diff -Naur netcdf-c-4.8.0.orig/CMakeLists.txt netcdf-c-4.8.0/CMakeLists.txt ---- netcdf-c-4.8.0.orig/CMakeLists.txt 2021-03-30 17:23:10.000000000 -0300 -+++ netcdf-c-4.8.0/CMakeLists.txt 2021-03-31 16:20:58.354763274 -0300 -@@ -2247,6 +2247,13 @@ +diff --color -Naur netcdf-c-4.9.0.orig/CMakeLists.txt netcdf-c-4.9.0/CMakeLists.txt +--- netcdf-c-4.9.0.orig/CMakeLists.txt 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/CMakeLists.txt 2022-06-13 09:15:17.540114993 -0300 +@@ -2536,6 +2536,13 @@ + SET(EXTRA_DIST ${EXTRA_DIST} ${CMAKE_CURRENT_SOURCE_DIR}/test_common.in) SET(TOPSRCDIR "${CMAKE_CURRENT_SOURCE_DIR}") SET(TOPBUILDDIR "${CMAKE_CURRENT_BINARY_DIR}") - SET(ISMSVC "${MSVC}") +IF(MSVC) + # Seems this is always upper-case by this point :-( + SET(VS_CONFIGURATION "/${CMAKE_BUILD_TYPE}") @@ -14,11 +14,11 @@ diff -Naur netcdf-c-4.8.0.orig/CMakeLists.txt netcdf-c-4.8.0/CMakeLists.txt + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_common.in ${CMAKE_CURRENT_BINARY_DIR}/test_common.sh @ONLY NEWLINE_STYLE LF) - -diff -Naur netcdf-c-4.8.0.orig/configure.ac netcdf-c-4.8.0/configure.ac ---- netcdf-c-4.8.0.orig/configure.ac 2021-03-30 17:23:10.000000000 -0300 -+++ netcdf-c-4.8.0/configure.ac 2021-03-31 15:37:39.403933822 -0300 -@@ -1618,6 +1618,7 @@ + ##### +diff --color -Naur netcdf-c-4.9.0.orig/configure.ac netcdf-c-4.9.0/configure.ac +--- netcdf-c-4.9.0.orig/configure.ac 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/configure.ac 2022-06-13 09:14:34.212977819 -0300 +@@ -1857,6 +1857,7 @@ AC_SUBST(HAS_MMAP,[$enable_mmap]) AC_SUBST(HAS_JNA,[$enable_jna]) AC_SUBST(HAS_ERANGE_FILL,[$enable_erange_fill]) @@ -26,9 +26,9 @@ diff -Naur netcdf-c-4.8.0.orig/configure.ac netcdf-c-4.8.0/configure.ac AC_SUBST(HAS_BYTERANGE,[$enable_byterange]) AC_SUBST(RELAX_COORD_BOUND,[yes]) AC_SUBST([HAS_PAR_FILTERS], [$hdf5_supports_par_filters]) -diff -Naur netcdf-c-4.8.0.orig/examples/CDL/do_comps.sh netcdf-c-4.8.0/examples/CDL/do_comps.sh ---- netcdf-c-4.8.0.orig/examples/CDL/do_comps.sh 2021-03-30 17:23:10.000000000 -0300 -+++ netcdf-c-4.8.0/examples/CDL/do_comps.sh 2021-03-31 16:18:03.592941903 -0300 +diff --color -Naur netcdf-c-4.9.0.orig/examples/CDL/do_comps.sh netcdf-c-4.9.0/examples/CDL/do_comps.sh +--- netcdf-c-4.9.0.orig/examples/CDL/do_comps.sh 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/examples/CDL/do_comps.sh 2022-06-13 09:16:42.730419193 -0300 @@ -9,6 +9,8 @@ # This shell script runs the cmp test on the example programs. # $Id: do_comps.sh,v 1.1 2006/06/27 17:44:54 ed Exp $ @@ -55,10 +55,10 @@ diff -Naur netcdf-c-4.8.0.orig/examples/CDL/do_comps.sh netcdf-c-4.8.0/examples/ echo "*** All example creations worked!" -diff -Naur netcdf-c-4.8.0.orig/test_common.in netcdf-c-4.8.0/test_common.in ---- netcdf-c-4.8.0.orig/test_common.in 2021-03-30 17:23:10.000000000 -0300 -+++ netcdf-c-4.8.0/test_common.in 2021-03-31 16:20:05.514199909 -0300 -@@ -77,8 +77,8 @@ +diff --color -Naur netcdf-c-4.9.0.orig/test_common.in netcdf-c-4.9.0/test_common.in +--- netcdf-c-4.9.0.orig/test_common.in 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/test_common.in 2022-06-13 09:17:29.281492909 -0300 +@@ -101,8 +101,8 @@ top_srcdir="$TOPSRCDIR" top_builddir="$TOPBUILDDIR" @@ -69,7 +69,7 @@ diff -Naur netcdf-c-4.8.0.orig/test_common.in netcdf-c-4.8.0/test_common.in # srcdir may or may not be defined, but if not, then create it if test "x$srcdir" = x ; then -@@ -95,6 +95,12 @@ +@@ -119,6 +119,12 @@ # execdir is an alias for builddir execdir="${builddir}" diff --git a/recipe/patches/fix-rename.patch b/recipe/patches/fix-rename.patch deleted file mode 100644 index d4603e50..00000000 --- a/recipe/patches/fix-rename.patch +++ /dev/null @@ -1,26 +0,0 @@ -commit 4f37d1a82648123d696e8490bfc54a792d21de1e -Author: Dennis Heimbigner -Date: Tue Aug 24 15:11:26 2021 -0600 - - Make Issue https://github.com/Unidata/netcdf-c/issues/2077 work when build is repeated. - - re: https://github.com/Unidata/netcdf-c/pull/2075 - - The long file name fix fails when the build is manually repeated - because the source file has already been renamed. Solution is to - test if the dest file exists or not before doing the rename. - -diff --git a/dap4_test/baselinethredds/CMakeLists.txt b/dap4_test/baselinethredds/CMakeLists.txt -index 4420c0e54..50bc61111 100644 ---- a/dap4_test/baselinethredds/CMakeLists.txt -+++ b/dap4_test/baselinethredds/CMakeLists.txt -@@ -12,7 +12,9 @@ FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSION - ## - # Rename file in support of https://github.com/Unidata/netcdf-c/issues/2077 - ## -+IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds) - FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/GOES16_TEST1.nc4.thredds ${CMAKE_CURRENT_BINARY_DIR}/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds) -+ENDIF() - - FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*) - SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} CMakeLists.txt) From 93adf55ac102148d710f031e8120cb3ed1165e5e Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 13 Jun 2022 09:25:01 -0300 Subject: [PATCH 02/25] patch for lib version --- recipe/meta.yaml | 2 ++ ...ncorrect_library_versionand_filename_in_4.9.0.path | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 recipe/patches/incorrect_library_versionand_filename_in_4.9.0.path diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b2278ee6..a6649875 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -25,6 +25,8 @@ source: - patches/do_not_use_16_processes_in_tests.patch # [ppc64le] # Revert upstream change in 4.8.1--maybe unnecessary in 4.8.2 - patches/fix_cmake.patch # [win] + # https://github.com/Unidata/netcdf-c/issues/2390 + - patches/incorrect_library_versionand_filename_in_4.9.0.path build: number: {{ build }} diff --git a/recipe/patches/incorrect_library_versionand_filename_in_4.9.0.path b/recipe/patches/incorrect_library_versionand_filename_in_4.9.0.path new file mode 100644 index 00000000..8d983da5 --- /dev/null +++ b/recipe/patches/incorrect_library_versionand_filename_in_4.9.0.path @@ -0,0 +1,11 @@ +--- netcdf-c-4.9.0.orig/CMakeLists.txt 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/CMakeLists.txt 2022-06-13 09:22:39.516181352 -0300 +@@ -39,7 +39,7 @@ + SET(PACKAGE_VERSION ${VERSION}) + + # These values should match those in configure.ac +-SET(netCDF_LIB_VERSION 19}) ++SET(netCDF_LIB_VERSION 19) + SET(netCDF_SO_VERSION 19) + + # Version of the dispatch table. This must match the value in From d12681c0cca883b0bfc30e090c3a4a423f414ec5 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 13 Jun 2022 09:27:21 -0300 Subject: [PATCH 03/25] MNT: Re-rendered with conda-build 3.21.9, conda-smithy 3.20.0, and conda-forge-pinning 2022.06.13.08.34.03 --- .azure-pipelines/azure-pipelines-win.yml | 65 +++++++---------------- .ci_support/linux_64_mpimpich.yaml | 2 - .ci_support/linux_64_mpinompi.yaml | 2 - .ci_support/linux_64_mpiopenmpi.yaml | 2 - .ci_support/linux_aarch64_mpimpich.yaml | 2 - .ci_support/linux_aarch64_mpinompi.yaml | 2 - .ci_support/linux_aarch64_mpiopenmpi.yaml | 2 - .ci_support/linux_ppc64le_mpimpich.yaml | 2 - .ci_support/linux_ppc64le_mpinompi.yaml | 2 - .ci_support/linux_ppc64le_mpiopenmpi.yaml | 2 - .ci_support/migrations/hdf51121.yaml | 7 --- .ci_support/osx_64_mpimpich.yaml | 2 - .ci_support/osx_64_mpinompi.yaml | 2 - .ci_support/osx_64_mpiopenmpi.yaml | 2 - .ci_support/osx_arm64_mpimpich.yaml | 2 - .ci_support/osx_arm64_mpinompi.yaml | 2 - .ci_support/osx_arm64_mpiopenmpi.yaml | 2 - .ci_support/win_64_.yaml | 2 - .circleci/config.yml | 3 +- README.md | 2 +- 20 files changed, 21 insertions(+), 88 deletions(-) delete mode 100644 .ci_support/migrations/hdf51121.yaml diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 88fd9c19..09ab5510 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -16,45 +16,27 @@ jobs: CONDA_BLD_PATH: D:\\bld\\ steps: - - script: | - choco install vcpython27 -fdv -y --debug - condition: contains(variables['CONFIG'], 'vs2008') - displayName: Install vcpython27.msi (if needed) - - # Cygwin's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) - # - script: rmdir C:\cygwin /s /q - # continueOnError: true - - - powershell: | - Set-PSDebug -Trace 1 - - $batchcontent = @" - ECHO ON - SET vcpython=C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0 - - DIR "%vcpython%" - - CALL "%vcpython%\vcvarsall.bat" %* - "@ - - $batchDir = "C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC" - $batchPath = "$batchDir" + "\vcvarsall.bat" - New-Item -Path $batchPath -ItemType "file" -Force - - Set-Content -Value $batchcontent -Path $batchPath + - task: PythonScript@0 + displayName: 'Download Miniforge' + inputs: + scriptSource: inline + script: | + import urllib.request + url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe' + path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe" + urllib.request.urlretrieve(url, path) - Get-ChildItem -Path $batchDir + - script: | + start /wait "" %BUILD_ARTIFACTSTAGINGDIRECTORY%\Miniforge.exe /InstallationType=JustMe /RegisterPython=0 /S /D=C:\Miniforge + displayName: Install Miniforge - Get-ChildItem -Path ($batchDir + '\..') + - powershell: Write-Host "##vso[task.prependpath]C:\Miniforge\Scripts" + displayName: Add conda to PATH - condition: contains(variables['CONFIG'], 'vs2008') - displayName: Patch vs2008 (if needed) - - task: CondaEnvironment@1 - inputs: - packageSpecs: 'python=3.9 conda-build conda pip boa conda-forge-ci-setup=3' # Optional - installOptions: "-c conda-forge" - updateConda: true - displayName: Install conda-build and activate environment + - script: | + call activate base + mamba.exe install 'python=3.9' conda-build conda pip boa 'conda-forge-ci-setup=3' -c conda-forge --strict-channel-priority --yes + displayName: Install conda-build - script: set PYTHONUNBUFFERED=1 displayName: Set PYTHONUNBUFFERED @@ -73,23 +55,12 @@ jobs: displayName: conda-forge build setup - # Special cased version setting some more things! - - script: | - call activate base - conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml - displayName: Build recipe (vs2008) - env: - VS90COMNTOOLS: "C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\bin" - PYTHONUNBUFFERED: 1 - condition: contains(variables['CONFIG'], 'vs2008') - - script: | call activate base conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables displayName: Build recipe env: PYTHONUNBUFFERED: 1 - condition: not(contains(variables['CONFIG'], 'vs2008')) - script: | set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" call activate base diff --git a/.ci_support/linux_64_mpimpich.yaml b/.ci_support/linux_64_mpimpich.yaml index d2244d7a..050bcd27 100644 --- a/.ci_support/linux_64_mpimpich.yaml +++ b/.ci_support/linux_64_mpimpich.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/linux_64_mpinompi.yaml b/.ci_support/linux_64_mpinompi.yaml index e997c439..88b16a07 100644 --- a/.ci_support/linux_64_mpinompi.yaml +++ b/.ci_support/linux_64_mpinompi.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/linux_64_mpiopenmpi.yaml b/.ci_support/linux_64_mpiopenmpi.yaml index 0b6d7c65..00e88385 100644 --- a/.ci_support/linux_64_mpiopenmpi.yaml +++ b/.ci_support/linux_64_mpiopenmpi.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/linux_aarch64_mpimpich.yaml b/.ci_support/linux_aarch64_mpimpich.yaml index 4f793fa5..ed21b57e 100644 --- a/.ci_support/linux_aarch64_mpimpich.yaml +++ b/.ci_support/linux_aarch64_mpimpich.yaml @@ -45,8 +45,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/linux_aarch64_mpinompi.yaml b/.ci_support/linux_aarch64_mpinompi.yaml index 7d14e04a..e0a0db17 100644 --- a/.ci_support/linux_aarch64_mpinompi.yaml +++ b/.ci_support/linux_aarch64_mpinompi.yaml @@ -45,8 +45,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/linux_aarch64_mpiopenmpi.yaml b/.ci_support/linux_aarch64_mpiopenmpi.yaml index 4dd52bf1..16cccb77 100644 --- a/.ci_support/linux_aarch64_mpiopenmpi.yaml +++ b/.ci_support/linux_aarch64_mpiopenmpi.yaml @@ -45,8 +45,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/linux_ppc64le_mpimpich.yaml b/.ci_support/linux_ppc64le_mpimpich.yaml index 8892a6c5..2676259e 100644 --- a/.ci_support/linux_ppc64le_mpimpich.yaml +++ b/.ci_support/linux_ppc64le_mpimpich.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/linux_ppc64le_mpinompi.yaml b/.ci_support/linux_ppc64le_mpinompi.yaml index 411f4797..68e85494 100644 --- a/.ci_support/linux_ppc64le_mpinompi.yaml +++ b/.ci_support/linux_ppc64le_mpinompi.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/linux_ppc64le_mpiopenmpi.yaml b/.ci_support/linux_ppc64le_mpiopenmpi.yaml index cc22e35d..531ddf33 100644 --- a/.ci_support/linux_ppc64le_mpiopenmpi.yaml +++ b/.ci_support/linux_ppc64le_mpiopenmpi.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/migrations/hdf51121.yaml b/.ci_support/migrations/hdf51121.yaml deleted file mode 100644 index 3f58c950..00000000 --- a/.ci_support/migrations/hdf51121.yaml +++ /dev/null @@ -1,7 +0,0 @@ -__migrator: - build_number: 1 - kind: version - migration_number: 1 -hdf5: -- 1.12.1 -migrator_ts: 1625881538.220744 diff --git a/.ci_support/osx_64_mpimpich.yaml b/.ci_support/osx_64_mpimpich.yaml index 2f049e5c..3f087e50 100644 --- a/.ci_support/osx_64_mpimpich.yaml +++ b/.ci_support/osx_64_mpimpich.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/osx_64_mpinompi.yaml b/.ci_support/osx_64_mpinompi.yaml index bc0de4f8..0613e271 100644 --- a/.ci_support/osx_64_mpinompi.yaml +++ b/.ci_support/osx_64_mpinompi.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/osx_64_mpiopenmpi.yaml b/.ci_support/osx_64_mpiopenmpi.yaml index d776f825..5a6003b6 100644 --- a/.ci_support/osx_64_mpiopenmpi.yaml +++ b/.ci_support/osx_64_mpiopenmpi.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/osx_arm64_mpimpich.yaml b/.ci_support/osx_arm64_mpimpich.yaml index c6a29cb3..ca37628b 100644 --- a/.ci_support/osx_arm64_mpimpich.yaml +++ b/.ci_support/osx_arm64_mpimpich.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/osx_arm64_mpinompi.yaml b/.ci_support/osx_arm64_mpinompi.yaml index 5242d3cb..e160c406 100644 --- a/.ci_support/osx_arm64_mpinompi.yaml +++ b/.ci_support/osx_arm64_mpinompi.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/osx_arm64_mpiopenmpi.yaml b/.ci_support/osx_arm64_mpiopenmpi.yaml index 6537c0bf..775df2a8 100644 --- a/.ci_support/osx_arm64_mpiopenmpi.yaml +++ b/.ci_support/osx_arm64_mpiopenmpi.yaml @@ -41,8 +41,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index 93ed7d0a..d86b5d75 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -33,8 +33,6 @@ pin_run_as_build: max_pin: x.x jpeg: max_pin: x - mpich: - max_pin: x.x zlib: max_pin: x.x target_platform: diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ad461b8..3e61aa24 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,8 @@ version: 2 jobs: build: working_directory: ~/test - machine: true + machine: + image: ubuntu-2004:current steps: - run: # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. diff --git a/README.md b/README.md index dd58ecdc..b7acdc03 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Summary: Libraries and data formats that support array-oriented scientific data Current build status ==================== - + From 040dfb6d840b9e58805799c96ac50bfdb821fd19 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 13 Jun 2022 09:27:35 -0300 Subject: [PATCH 04/25] mini-migrator --- recipe/conda_build_config.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 8883df93..551a34d5 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -3,14 +3,6 @@ mpi: - openmpi # [not win] - mpich # [not win] -pin_run_as_build: - openmpi: - max_pin: x.x - -pin_run_as_build: - mpich: - max_pin: x.x - # OSX Compilers 13 seem to be incompatible with osx64 # Downgrading to 11 for osx-64 # Downgrading to 11 for osx-arm as well out of an abundance of caution From 2e5d128333acdeb8e7b7e77f394935fefb79c4f6 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 13 Jun 2022 09:36:17 -0300 Subject: [PATCH 05/25] fix patch name --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a6649875..8eca4a73 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,7 +18,7 @@ source: patches: - patches/0004-Prefer-getenv-TOPSRCDIR-over-STRINGIFY-TOPSRCDIR.patch - patches/0006-Fix-tests-for-Windows-VS2008-define-__func__-as-__FU.patch - - patches/0008-Finish-the-missing-code-to-handle-VS-in-test_common..patch + - patches/0008-Finish-the-missing-code-to-handle-VS-in-test_common.patch - patches/0009-topsrcdir.patch - patches/prevent_MS_runtime_libs_being_installed_again.patch # [win] - patches/strdup.patch From ce41df93eabeac23180dc7d0ef2866f6225eecb7 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 13 Jun 2022 09:51:49 -0300 Subject: [PATCH 06/25] add zstd --- recipe/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8eca4a73..fa01da6b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -81,6 +81,7 @@ requirements: - hdf5 * {{ mpi_prefix }}_* - jpeg - libzip + - zstd run: - {{ mpi }} # [mpi != 'nompi'] - bzip2 @@ -90,6 +91,7 @@ requirements: - hdf5 * {{ mpi_prefix }}_* - jpeg - libzip + - zstd # Curl should be pulling this... Investigate it later. - libssh2 # [win] From c88695ffe6c8739a80baeb4dbb495042a0d64614 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 13 Jun 2022 10:30:49 -0300 Subject: [PATCH 07/25] refresh --- recipe/patches/fix_cmake.patch | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/recipe/patches/fix_cmake.patch b/recipe/patches/fix_cmake.patch index 59a32c5a..f4e33b19 100644 --- a/recipe/patches/fix_cmake.patch +++ b/recipe/patches/fix_cmake.patch @@ -1,19 +1,10 @@ -commit 793ae8c2b4cc651d9c6670bb03ebb0740987f4f6 -Author: Ryan May -Date: Wed Aug 25 16:29:45 2021 -0600 - - Revert "Simply version check logic" - - This reverts commit e755a08f11dc7a3b31039a912334505bdd90ecd8. - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e1b620fee..dc95eeae9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -818,11 +818,19 @@ IF(USE_HDF5) - +diff --color -Naur netcdf-c-4.9.0.orig/CMakeLists.txt netcdf-c-4.9.0/CMakeLists.txt +--- netcdf-c-4.9.0.orig/CMakeLists.txt 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/CMakeLists.txt 2022-06-13 10:29:40.177921583 -0300 +@@ -893,11 +893,19 @@ # Check to see if HDF5 library is 1.10.6 or greater. # Used to control path name conversion + #### - IF(${HDF5_VERSION} VERSION_GREATER "1.10.5") - SET(HDF5_UTF8_PATHS ON) - ELSE() @@ -33,13 +24,12 @@ index e1b620fee..dc95eeae9 100644 + SET(HDF5_UTF8_PATHS ON) + ENDIF(HDF5_VERSION_1106) - MESSAGE("-- Checking for HDF5 version 1.10.6 or later: ${HDF5_UTF8_PATHS}") + MESSAGE("-- HDF5_UTF8_PATHS (HDF5 version 1.10.6+): ${HDF5_UTF8_PATHS}") -diff --git a/nc_test4/CMakeLists.txt b/nc_test4/CMakeLists.txt -index c5c345005..d4f97bfd7 100644 ---- a/nc_test4/CMakeLists.txt -+++ b/nc_test4/CMakeLists.txt -@@ -47,10 +47,6 @@ ENDIF(ENABLE_FILTER_TESTING) +diff --color -Naur netcdf-c-4.9.0.orig/nc_test4/CMakeLists.txt netcdf-c-4.9.0/nc_test4/CMakeLists.txt +--- netcdf-c-4.9.0.orig/nc_test4/CMakeLists.txt 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/nc_test4/CMakeLists.txt 2022-06-13 10:29:54.401820897 -0300 +@@ -59,10 +59,6 @@ ENDIF(BUILD_UTILITIES) From 10b9c960c9a4ce81ec64a9ff596b5e57f72941c4 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Mon, 13 Jun 2022 11:12:59 -0300 Subject: [PATCH 08/25] apply first --- recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index fa01da6b..46b344f5 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -23,10 +23,10 @@ source: - patches/prevent_MS_runtime_libs_being_installed_again.patch # [win] - patches/strdup.patch - patches/do_not_use_16_processes_in_tests.patch # [ppc64le] - # Revert upstream change in 4.8.1--maybe unnecessary in 4.8.2 - - patches/fix_cmake.patch # [win] # https://github.com/Unidata/netcdf-c/issues/2390 - patches/incorrect_library_versionand_filename_in_4.9.0.path + # Revert upstream change in 4.8.1--maybe unnecessary in 4.8.2 + - patches/fix_cmake.patch # [win] build: number: {{ build }} From 58232ff0704d0834008a4c5f27b0801ab3278e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20M=C3=BChlbauer?= Date: Tue, 28 Jun 2022 13:58:34 +0200 Subject: [PATCH 09/25] add netcdf_json linking errors patch --- recipe/meta.yaml | 1 + .../netCDF-4.9.0-json-linking-errors.patch | 96 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 recipe/patches/netCDF-4.9.0-json-linking-errors.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 46b344f5..2f62823d 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -27,6 +27,7 @@ source: - patches/incorrect_library_versionand_filename_in_4.9.0.path # Revert upstream change in 4.8.1--maybe unnecessary in 4.8.2 - patches/fix_cmake.patch # [win] + - patches/netCDF-4.9.0-json-linking-errors.patch build: number: {{ build }} diff --git a/recipe/patches/netCDF-4.9.0-json-linking-errors.patch b/recipe/patches/netCDF-4.9.0-json-linking-errors.patch new file mode 100644 index 00000000..95ff1d2a --- /dev/null +++ b/recipe/patches/netCDF-4.9.0-json-linking-errors.patch @@ -0,0 +1,96 @@ +--- netcdf-c-4.9.0/include/netcdf_json.h.orig 2022-06-28 13:38:59.935828565 +0200 ++++ netcdf-c-4.9.0/include/netcdf_json_new.h 2022-06-28 13:42:36.411055851 +0200 +@@ -57,25 +57,25 @@ + #endif + + /* Parse a JSON string */ +-DLLEXPORT int NCJparse(const char* text, unsigned flags, NCjson** jsonp); ++DLLEXPORT static int NCJparse(const char* text, unsigned flags, NCjson** jsonp); + + /* Reclaim a JSON tree */ +-DLLEXPORT extern void NCJreclaim(NCjson* json); ++DLLEXPORT static void NCJreclaim(NCjson* json); + + /* Create a new JSON node of a given sort */ +-DLLEXPORT extern int NCJnew(int sort, NCjson** objectp); ++DLLEXPORT static int NCJnew(int sort, NCjson** objectp); + + /* Create new json object with given string content */ +-DLLEXPORT extern int NCJnewstring(int sort, const char* value, NCjson** jsonp); ++DLLEXPORT static int NCJnewstring(int sort, const char* value, NCjson** jsonp); + + /* Create new json object with given counted string content */ +-DLLEXPORT extern int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); ++DLLEXPORT static int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); + + /* Get dict key value by name */ +-DLLEXPORT extern int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); ++DLLEXPORT static int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); + + /* Convert one json sort to value of another type; don't use union so we can know when to reclaim sval */ +-DLLEXPORT extern int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); ++DLLEXPORT static int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); + + #ifndef NETCDF_JSON_H + +@@ -230,7 +230,7 @@ + + /**************************************************/ + +-int ++static int + NCJparse(const char* text, unsigned flags, NCjson** jsonp) + { + int stat = NCJ_OK; +@@ -579,7 +579,7 @@ + + /**************************************************/ + +-void ++static void + NCJreclaim(NCjson* json) + { + if(json == NULL) return; +@@ -621,7 +621,7 @@ + /**************************************************/ + /* Build Functions */ + +-int ++static int + NCJnew(int sort, NCjson** objectp) + { + int stat = NCJ_OK; +@@ -651,13 +651,13 @@ + return NCJTHROW(stat); + } + +-int ++static int + NCJnewstring(int sort, const char* value, NCjson** jsonp) + { + return NCJTHROW(NCJnewstringn(sort,strlen(value),value,jsonp)); + } + +-int ++static int + NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp) + { + int stat = NCJ_OK; +@@ -679,7 +679,7 @@ + return NCJTHROW(stat); + } + +-int ++static int + NCJdictget(const NCjson* dict, const char* key, NCjson** valuep) + { + int i,stat = NCJ_OK; +@@ -755,7 +755,7 @@ + #endif + + /* Convert a JSON value to an equivalent value of a specified sort */ +-int ++static int + NCJcvt(const NCjson* jvalue, int outsort, struct NCJconst* output) + { + int stat = NCJ_OK; From edd55b775403fd2d7ba300e48fdcbf3c1b395bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20M=C3=BChlbauer?= Date: Tue, 28 Jun 2022 14:33:28 +0200 Subject: [PATCH 10/25] fix patch --- recipe/patches/netCDF-4.9.0-json-linking-errors.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/patches/netCDF-4.9.0-json-linking-errors.patch b/recipe/patches/netCDF-4.9.0-json-linking-errors.patch index 95ff1d2a..0039c796 100644 --- a/recipe/patches/netCDF-4.9.0-json-linking-errors.patch +++ b/recipe/patches/netCDF-4.9.0-json-linking-errors.patch @@ -1,5 +1,5 @@ ---- netcdf-c-4.9.0/include/netcdf_json.h.orig 2022-06-28 13:38:59.935828565 +0200 -+++ netcdf-c-4.9.0/include/netcdf_json_new.h 2022-06-28 13:42:36.411055851 +0200 +--- netcdf-c-4.9.0.orig/include/netcdf_json.h ++++ netcdf-c-4.9.0/include/netcdf_json.h @@ -57,25 +57,25 @@ #endif From 936fb81d95c884d217e3545753822e46ba8e3178 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 29 Jun 2022 09:09:27 -0300 Subject: [PATCH 11/25] try again --- .../netCDF-4.9.0-json-linking-errors.patch | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/recipe/patches/netCDF-4.9.0-json-linking-errors.patch b/recipe/patches/netCDF-4.9.0-json-linking-errors.patch index 0039c796..7df2d183 100644 --- a/recipe/patches/netCDF-4.9.0-json-linking-errors.patch +++ b/recipe/patches/netCDF-4.9.0-json-linking-errors.patch @@ -1,5 +1,5 @@ ---- netcdf-c-4.9.0.orig/include/netcdf_json.h -+++ netcdf-c-4.9.0/include/netcdf_json.h +--- netcdf-c-4.9.0.orig/include/netcdf_json.h 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/include/netcdf_json.h 2022-06-29 09:05:37.311407278 -0300 @@ -57,25 +57,25 @@ #endif @@ -9,27 +9,27 @@ /* Reclaim a JSON tree */ -DLLEXPORT extern void NCJreclaim(NCjson* json); -+DLLEXPORT static void NCJreclaim(NCjson* json); ++DLLEXPORT static void NCJreclaim(NCjson* json); /* Create a new JSON node of a given sort */ -DLLEXPORT extern int NCJnew(int sort, NCjson** objectp); -+DLLEXPORT static int NCJnew(int sort, NCjson** objectp); ++DLLEXPORT static int NCJnew(int sort, NCjson** objectp); /* Create new json object with given string content */ -DLLEXPORT extern int NCJnewstring(int sort, const char* value, NCjson** jsonp); -+DLLEXPORT static int NCJnewstring(int sort, const char* value, NCjson** jsonp); ++DLLEXPORT static int NCJnewstring(int sort, const char* value, NCjson** jsonp); /* Create new json object with given counted string content */ -DLLEXPORT extern int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); -+DLLEXPORT static int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); ++DLLEXPORT static int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); /* Get dict key value by name */ -DLLEXPORT extern int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); -+DLLEXPORT static int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); ++DLLEXPORT static int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); /* Convert one json sort to value of another type; don't use union so we can know when to reclaim sval */ -DLLEXPORT extern int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); -+DLLEXPORT static int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); ++DLLEXPORT static int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); #ifndef NETCDF_JSON_H From b0f3baa804c29d5d55bf70e0ac2cfd492f5b5d71 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Fri, 26 Aug 2022 12:34:25 -0600 Subject: [PATCH 12/25] Update patch to fix ncjson build --- recipe/meta.yaml | 2 +- recipe/patches/fix-ncjson.patch | 834 ++++++++++++++++++ .../netCDF-4.9.0-json-linking-errors.patch | 96 -- 3 files changed, 835 insertions(+), 97 deletions(-) create mode 100644 recipe/patches/fix-ncjson.patch delete mode 100644 recipe/patches/netCDF-4.9.0-json-linking-errors.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 2f62823d..5b45cb74 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -27,7 +27,7 @@ source: - patches/incorrect_library_versionand_filename_in_4.9.0.path # Revert upstream change in 4.8.1--maybe unnecessary in 4.8.2 - patches/fix_cmake.patch # [win] - - patches/netCDF-4.9.0-json-linking-errors.patch + - patches/fix-ncjson.patch build: number: {{ build }} diff --git a/recipe/patches/fix-ncjson.patch b/recipe/patches/fix-ncjson.patch new file mode 100644 index 00000000..86b0c43c --- /dev/null +++ b/recipe/patches/fix-ncjson.patch @@ -0,0 +1,834 @@ +diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt +index 08017c7f8..224bd2bb3 100644 +--- a/include/CMakeLists.txt ++++ b/include/CMakeLists.txt +@@ -41,9 +41,9 @@ IF(ENABLE_PNETCDF OR ENABLE_PARALLEL4) + COMPONENT headers) + ENDIF() + +-#INSTALL(FILES ${netCDF_BINARY_DIR}/include/netcdf_json.h +-# DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +-# COMPONENT headers) ++INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_json.h ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++ COMPONENT headers) + + FILE(GLOB CUR_EXTRA_DIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.h) + SET(CUR_EXTRA_DIST ${CUR_EXTRA_DIST} Makefile.am CMakeLists.txt) +diff --git a/include/Makefile.am b/include/Makefile.am +index 0a4a58e05..3b7e13839 100644 +--- a/include/Makefile.am ++++ b/include/Makefile.am +@@ -32,7 +32,15 @@ endif + + EXTRA_DIST = CMakeLists.txt XGetopt.h netcdf_meta.h.in netcdf_dispatch.h.in + ++# netcdf_json.h is constructed as a header-only file for use by ++# nczarr code wrappers in the plugin directory. It is ++# constructed by joining libdispatch/ncjson.c with ++# include/ncjson.h. Additionally all the entry points are ++# marked with a macro (OPTSTATIC) that marks the entry point as ++# static inside netcdf_json.h. This is an ugly hack to avoid ++# having to reference libnetcdf in the nczarr code wrappers. ++ + # Give the recipe for rebuilding netcdf_json.h +-makencjson:: ++makepluginjson:: + sed -e 's/NCJSON_H/NETCDF_JSON_H/' -e '/ncjson.h/d' <${srcdir}/ncjson.h > netcdf_json.h + sed -e '/ncjson.h/d' < ${srcdir}/../libdispatch/ncjson.c >> netcdf_json.h +diff --git a/include/ncjson.h b/include/ncjson.h +index c065bc2ed..c4974cfb5 100644 +--- a/include/ncjson.h ++++ b/include/ncjson.h +@@ -2,9 +2,20 @@ + See the COPYRIGHT file for more information. + */ + ++ + #ifndef NCJSON_H + #define NCJSON_H 1 + ++/* ++WARNING: ++If you modify this file, ++then you need to got to ++the include/ directory ++and do the command: ++ make makepluginjson ++*/ ++ ++/* Inside libnetcdf and for plugins, export the json symbols */ + #ifndef DLLEXPORT + #ifdef _WIN32 + #define DLLEXPORT __declspec(dllexport) +@@ -13,6 +24,13 @@ + #endif + #endif + ++/* Override for plugins */ ++#ifdef NETCDF_JSON_H ++#define OPTEXPORT static ++#else ++#define OPTEXPORT DLLEXPORT ++#endif /*NETCDF_JSON_H*/ ++ + /**************************************************/ + /* Json object sorts (note use of term sort rather than e.g. type or discriminant) */ + #define NCJ_UNDEF 0 +@@ -57,48 +75,47 @@ extern "C" { + #endif + + /* Parse a string to NCjson*/ +-DLLEXPORT int NCJparse(const char* text, unsigned flags, NCjson** jsonp); ++OPTEXPORT int NCJparse(const char* text, unsigned flags, NCjson** jsonp); + + /* Parse a counted string to NCjson*/ +-DLLEXPORT int NCJparsen(size_t len, const char* text, unsigned flags, NCjson** jsonp); ++OPTEXPORT int NCJparsen(size_t len, const char* text, unsigned flags, NCjson** jsonp); + + /* Reclaim a JSON tree */ +-DLLEXPORT extern void NCJreclaim(NCjson* json); ++OPTEXPORT void NCJreclaim(NCjson* json); + + /* Create a new JSON node of a given sort */ +-DLLEXPORT extern int NCJnew(int sort, NCjson** objectp); ++OPTEXPORT int NCJnew(int sort, NCjson** objectp); + + /* Create new json object with given string content */ +-DLLEXPORT extern int NCJnewstring(int sort, const char* value, NCjson** jsonp); ++OPTEXPORT int NCJnewstring(int sort, const char* value, NCjson** jsonp); + + /* Create new json object with given counted string content */ +-DLLEXPORT extern int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); ++OPTEXPORT int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); + + /* Get dict key value by name */ +-DLLEXPORT extern int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); ++OPTEXPORT int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); + + /* Convert one json sort to value of another type; don't use union so we can know when to reclaim sval */ +-DLLEXPORT extern int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); +- +-#ifndef NETCDF_JSON_H ++OPTEXPORT int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); + + /* Insert an atomic value to an array or dict object. */ +-DLLEXPORT int NCJaddstring(NCjson* json, int sort, const char* s); ++OPTEXPORT int NCJaddstring(NCjson* json, int sort, const char* s); + + /* Append value to an array or dict object. */ +-DLLEXPORT extern int NCJappend(NCjson* object, NCjson* value); ++OPTEXPORT int NCJappend(NCjson* object, NCjson* value); + + /* Insert key-value pair into a dict object. key will be copied */ +-DLLEXPORT extern int NCJinsert(NCjson* object, char* key, NCjson* value); ++OPTEXPORT int NCJinsert(NCjson* object, char* key, NCjson* value); + + /* Unparser to convert NCjson object to text in buffer */ +-DLLEXPORT extern int NCJunparse(const NCjson* json, unsigned flags, char** textp); ++OPTEXPORT int NCJunparse(const NCjson* json, unsigned flags, char** textp); + + /* Deep clone a json object */ +-DLLEXPORT extern int NCJclone(const NCjson* json, NCjson** clonep); ++OPTEXPORT int NCJclone(const NCjson* json, NCjson** clonep); + ++#ifndef NETCDF_JSON_H + /* dump NCjson* object to output file */ +-DLLEXPORT extern void NCJdump(const NCjson* json, unsigned flags, FILE*); ++OPTEXPORT void NCJdump(const NCjson* json, unsigned flags, FILE*); + #endif + + #if defined(__cplusplus) +diff --git a/include/netcdf_json.h b/include/netcdf_json.h +index 9c6860c92..d53944a8a 100644 +--- a/include/netcdf_json.h ++++ b/include/netcdf_json.h +@@ -5,6 +5,7 @@ + #ifndef NETCDF_JSON_H + #define NETCDF_JSON_H 1 + ++/* Inside libnetcdf and for plugins, export the json symbols */ + #ifndef DLLEXPORT + #ifdef _WIN32 + #define DLLEXPORT __declspec(dllexport) +@@ -13,6 +14,13 @@ + #endif + #endif + ++/* Override for plugins */ ++#ifdef NETCDF_JSON_H ++#define OPTEXPORT static ++#else ++#define OPTEXPORT DLLEXPORT ++#endif /*NETCDF_JSON_H*/ ++ + /**************************************************/ + /* Json object sorts (note use of term sort rather than e.g. type or discriminant) */ + #define NCJ_UNDEF 0 +@@ -56,46 +64,48 @@ struct NCJconst {int bval; long long ival; double dval; char* sval;}; + extern "C" { + #endif + +-/* Parse a JSON string */ +-DLLEXPORT int NCJparse(const char* text, unsigned flags, NCjson** jsonp); ++/* Parse a string to NCjson*/ ++OPTEXPORT int NCJparse(const char* text, unsigned flags, NCjson** jsonp); ++ ++/* Parse a counted string to NCjson*/ ++OPTEXPORT int NCJparsen(size_t len, const char* text, unsigned flags, NCjson** jsonp); + + /* Reclaim a JSON tree */ +-DLLEXPORT extern void NCJreclaim(NCjson* json); ++OPTEXPORT void NCJreclaim(NCjson* json); + + /* Create a new JSON node of a given sort */ +-DLLEXPORT extern int NCJnew(int sort, NCjson** objectp); ++OPTEXPORT int NCJnew(int sort, NCjson** objectp); + + /* Create new json object with given string content */ +-DLLEXPORT extern int NCJnewstring(int sort, const char* value, NCjson** jsonp); ++OPTEXPORT int NCJnewstring(int sort, const char* value, NCjson** jsonp); + + /* Create new json object with given counted string content */ +-DLLEXPORT extern int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); ++OPTEXPORT int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); + + /* Get dict key value by name */ +-DLLEXPORT extern int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); ++OPTEXPORT int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); + + /* Convert one json sort to value of another type; don't use union so we can know when to reclaim sval */ +-DLLEXPORT extern int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); +- +-#ifndef NETCDF_JSON_H ++OPTEXPORT int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); + + /* Insert an atomic value to an array or dict object. */ +-DLLEXPORT int NCJaddstring(NCjson* json, int sort, const char* s); ++OPTEXPORT int NCJaddstring(NCjson* json, int sort, const char* s); + + /* Append value to an array or dict object. */ +-DLLEXPORT extern int NCJappend(NCjson* object, NCjson* value); ++OPTEXPORT int NCJappend(NCjson* object, NCjson* value); + + /* Insert key-value pair into a dict object. key will be copied */ +-DLLEXPORT extern int NCJinsert(NCjson* object, char* key, NCjson* value); ++OPTEXPORT int NCJinsert(NCjson* object, char* key, NCjson* value); + + /* Unparser to convert NCjson object to text in buffer */ +-DLLEXPORT extern int NCJunparse(const NCjson* json, unsigned flags, char** textp); ++OPTEXPORT int NCJunparse(const NCjson* json, unsigned flags, char** textp); + + /* Deep clone a json object */ +-DLLEXPORT extern int NCJclone(const NCjson* json, NCjson** clonep); ++OPTEXPORT int NCJclone(const NCjson* json, NCjson** clonep); + ++#ifndef NETCDF_JSON_H + /* dump NCjson* object to output file */ +-DLLEXPORT extern void NCJdump(const NCjson* json, unsigned flags, FILE*); ++OPTEXPORT void NCJdump(const NCjson* json, unsigned flags, FILE*); + #endif + + #if defined(__cplusplus) +@@ -130,8 +140,6 @@ DLLEXPORT extern void NCJdump(const NCjson* json, unsigned flags, FILE*); + TODO: make utf8 safe + */ + +-#define NCJSON_INTERNAL +- + #include + #include + #include +@@ -185,7 +193,7 @@ typedef struct NCJbuf { + + /**************************************************/ + +-#ifdef _WIN32 ++#if defined(_WIN32) && !defined(__MINGW32__) + #define strdup _strdup + #define strcasecmp _stricmp + #else +@@ -217,39 +225,58 @@ static int NCJyytext(NCJparser*, char* start, size_t pdlen); + static void NCJreclaimArray(struct NCjlist*); + static void NCJreclaimDict(struct NCjlist*); + static int NCJunescape(NCJparser* parser); ++static int unescape1(int c); + static int listappend(struct NCjlist* list, NCjson* element); + +-#ifndef NETCDF_JSON_H + static int NCJcloneArray(const NCjson* array, NCjson** clonep); + static int NCJcloneDict(const NCjson* dict, NCjson** clonep); + static int NCJunparseR(const NCjson* json, NCJbuf* buf, unsigned flags); + static int bytesappendquoted(NCJbuf* buf, const char* s); + static int bytesappend(NCJbuf* buf, const char* s); + static int bytesappendc(NCJbuf* bufp, const char c); +-#endif ++ ++/* Hide these for plugins */ ++#ifdef NETCDF_JSON_H ++#define OPTSTATIC static ++static int NCJparsen(size_t len, const char* text, unsigned flags, NCjson** jsonp); ++static int NCJnew(int sort, NCjson** objectp); ++static int NCJnewstring(int sort, const char* value, NCjson** jsonp); ++static int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); ++static int NCJclone(const NCjson* json, NCjson** clonep); ++static int NCJaddstring(NCjson* json, int sort, const char* s); ++static int NCJinsert(NCjson* object, char* key, NCjson* jvalue); ++static int NCJappend(NCjson* object, NCjson* value); ++static int NCJunparse(const NCjson* json, unsigned flags, char** textp); ++#else /*!NETCDF_JSON_H*/ ++#define OPTSTATIC ++#endif /*NETCDF_JSON_H*/ + + /**************************************************/ + +-int ++OPTSTATIC int + NCJparse(const char* text, unsigned flags, NCjson** jsonp) ++{ ++ return NCJparsen(strlen(text),text,flags,jsonp); ++} ++ ++OPTSTATIC int ++NCJparsen(size_t len, const char* text, unsigned flags, NCjson** jsonp) + { + int stat = NCJ_OK; +- size_t len; + NCJparser* parser = NULL; + NCjson* json = NULL; + + /* Need at least 1 character of input */ +- if(text == NULL || text[0] == '\0') ++ if(len == 0 || text == NULL) + {stat = NCJTHROW(NCJ_ERR); goto done;} + if(jsonp == NULL) goto done; + parser = calloc(1,sizeof(NCJparser)); + if(parser == NULL) + {stat = NCJTHROW(NCJ_ERR); goto done;} +- len = strlen(text); + parser->text = (char*)malloc(len+1+1); + if(parser->text == NULL) + {stat = NCJTHROW(NCJ_ERR); goto done;} +- strcpy(parser->text,text); ++ memcpy(parser->text,text,len); + parser->text[len] = '\0'; + parser->text[len+1] = '\0'; + parser->pos = &parser->text[0]; +@@ -457,16 +484,21 @@ NCJlex(NCJparser* parser) + c = *parser->pos; + if(c == '\0') { + token = NCJ_EOF; +- } else if(c <= ' ' || c == '\177') { ++ } else if(c <= ' ' || c == '\177') {/* ignore whitespace */ + parser->pos++; +- continue; /* ignore whitespace */ ++ continue; ++ } else if(c == NCJ_ESCAPE) { ++ parser->pos++; ++ c = *parser->pos; ++ *parser->pos = unescape1(c); ++ continue; + } else if(strchr(JSON_WORD, c) != NULL) { + start = parser->pos; + for(;;) { + c = *parser->pos++; + if(c == '\0' || strchr(JSON_WORD,c) == NULL) break; /* end of word */ + } +- /* Pushback c if not whitespace */ ++ /* Pushback c */ + parser->pos--; + count = ((parser->pos) - start); + if(NCJyytext(parser,start,count)) goto done; +@@ -579,7 +611,7 @@ NCJyytext(NCJparser* parser, char* start, size_t pdlen) + + /**************************************************/ + +-void ++OPTSTATIC void + NCJreclaim(NCjson* json) + { + if(json == NULL) return; +@@ -621,7 +653,7 @@ NCJreclaimDict(struct NCjlist* dict) + /**************************************************/ + /* Build Functions */ + +-int ++OPTSTATIC int + NCJnew(int sort, NCjson** objectp) + { + int stat = NCJ_OK; +@@ -651,13 +683,13 @@ done: + return NCJTHROW(stat); + } + +-int ++OPTSTATIC int + NCJnewstring(int sort, const char* value, NCjson** jsonp) + { + return NCJTHROW(NCJnewstringn(sort,strlen(value),value,jsonp)); + } + +-int ++OPTSTATIC int + NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp) + { + int stat = NCJ_OK; +@@ -679,7 +711,7 @@ done: + return NCJTHROW(stat); + } + +-int ++OPTSTATIC int + NCJdictget(const NCjson* dict, const char* key, NCjson** valuep) + { + int i,stat = NCJ_OK; +@@ -727,6 +759,21 @@ NCJunescape(NCJparser* parser) + return NCJTHROW(NCJ_OK); + } + ++/* Unescape a single character */ ++static int ++unescape1(int c) ++{ ++ switch (c) { ++ case 'b': c = '\b'; break; ++ case 'f': c = '\f'; break; ++ case 'n': c = '\n'; break; ++ case 'r': c = '\r'; break; ++ case 't': c = '\t'; break; ++ default: c = c; break;/* technically not Json conformant */ ++ } ++ return c; ++} ++ + #ifdef NCJDEBUG + static char* + tokenname(int token) +@@ -755,7 +802,7 @@ tokenname(int token) + #endif + + /* Convert a JSON value to an equivalent value of a specified sort */ +-int ++OPTSTATIC int + NCJcvt(const NCjson* jvalue, int outsort, struct NCJconst* output) + { + int stat = NCJ_OK; +@@ -864,9 +911,7 @@ done: + + /**************************************************/ + +-#ifndef NETCDF_JSON_H +- +-int ++OPTSTATIC int + NCJclone(const NCjson* json, NCjson** clonep) + { + int stat = NCJ_OK; +@@ -934,7 +979,7 @@ done: + return NCJTHROW(stat); + } + +-int ++OPTSTATIC int + NCJaddstring(NCjson* json, int sort, const char* s) + { + int stat = NCJ_OK; +@@ -952,7 +997,7 @@ done: + } + + /* Insert key-value pair into a dict object. key will be strdup'd */ +-int ++OPTSTATIC int + NCJinsert(NCjson* object, char* key, NCjson* jvalue) + { + int stat = NCJ_OK; +@@ -967,7 +1012,7 @@ done: + } + + /* Append value to an array or dict object. */ +-int ++OPTSTATIC int + NCJappend(NCjson* object, NCjson* value) + { + if(object == NULL || value == NULL) +@@ -986,7 +1031,7 @@ NCJappend(NCjson* object, NCjson* value) + /**************************************************/ + /* Unparser to convert NCjson object to text in buffer */ + +-int ++OPTSTATIC int + NCJunparse(const NCjson* json, unsigned flags, char** textp) + { + int stat = NCJ_OK; +@@ -1019,7 +1064,7 @@ NCJunparseR(const NCjson* json, NCJbuf* buf, unsigned flags) + if(json->list.len > 0 && json->list.contents != NULL) { + int shortlist = 0; + for(i=0;!shortlist && i < json->list.len;i+=2) { +- if(i > 0) bytesappendc(buf,NCJ_COMMA); ++ if(i > 0) {bytesappendc(buf,NCJ_COMMA);bytesappendc(buf,' ');}; + NCJunparseR(json->list.contents[i],buf,flags); /* key */ + bytesappendc(buf,NCJ_COLON); + bytesappendc(buf,' '); +@@ -1068,7 +1113,7 @@ escape(const char* text, NCJbuf* buf) + case '\n': replace = 'n'; break; + case '\r': replace = 'r'; break; + case '\t': replace = 't'; break; +- case NCJ_QUOTE: replace = '\''; break; ++ case NCJ_QUOTE: replace = '\"'; break; + case NCJ_ESCAPE: replace = '\\'; break; + default: break; + } +@@ -1090,17 +1135,6 @@ bytesappendquoted(NCJbuf* buf, const char* s) + return NCJTHROW(NCJ_OK); + } + +-void +-NCJdump(const NCjson* json, unsigned flags, FILE* out) +-{ +- char* text = NULL; +- (void)NCJunparse(json,0,&text); +- if(out == NULL) out = stderr; +- fprintf(out,"%s\n",text); +- fflush(out); +- nullfree(text); +-} +- + static int + bytesappend(NCJbuf* buf, const char* s) + { +@@ -1140,4 +1174,28 @@ bytesappendc(NCJbuf* bufp, const char c) + s[1] = '\0'; + return bytesappend(bufp,s); + } +-#endif /*!NETCDF_JSON_H*/ ++ ++OPTSTATIC void ++NCJdump(const NCjson* json, unsigned flags, FILE* out) ++{ ++ char* text = NULL; ++ (void)NCJunparse(json,0,&text); ++ if(out == NULL) out = stderr; ++ fprintf(out,"%s\n",text); ++ fflush(out); ++ nullfree(text); ++} ++ ++/* Hack to avoid static unused warning */ ++void ++netcdf_supresswarnings(void) ++{ ++ void* ignore; ++ ignore = (void*)NCJdump; ++ ignore = (void*)NCJinsert; ++ ignore = (void*)NCJaddstring; ++ ignore = (void*)NCJcvt; ++ ignore = (void*)NCJdictget; ++ ignore = (void*)NCJparse; ++ ignore = ignore; ++} +diff --git a/libdispatch/dhttp.c b/libdispatch/dhttp.c +index 250ddab17..70b8106c3 100644 +--- a/libdispatch/dhttp.c ++++ b/libdispatch/dhttp.c +@@ -482,6 +482,7 @@ setupconn(NC_HTTP_STATE* state, const char* objecturl) + cstat = curl_easy_setopt(state->curl, CURLOPT_FOLLOWLOCATION, 1); + if (cstat != CURLE_OK) goto fail; + ++ + /* Set the method */ + if((stat = nc_http_set_method(state,state->request.method))) goto done; + +diff --git a/libdispatch/drc.c b/libdispatch/drc.c +index e427eb8a7..e93689648 100644 +--- a/libdispatch/drc.c ++++ b/libdispatch/drc.c +@@ -130,6 +130,7 @@ NC_rcclear(NCRCinfo* info) + nullfree(info->rchome); + rcfreeentries(info->entries); + freeprofilelist(info->s3profiles); ++ + } + + static void +@@ -1024,6 +1025,8 @@ aws_load_credentials(NCglobalstate* gstate) + nclistpush(profiles,noprof); noprof = NULL; + } + ++ if(gstate->rcinfo->s3profiles) ++ freeprofilelist(gstate->rcinfo->s3profiles); + gstate->rcinfo->s3profiles = profiles; profiles = NULL; + + #ifdef AWSDEBUG +diff --git a/libdispatch/ncjson.c b/libdispatch/ncjson.c +index c0f85dd3f..b716fbdec 100644 +--- a/libdispatch/ncjson.c ++++ b/libdispatch/ncjson.c +@@ -6,7 +6,14 @@ + TODO: make utf8 safe + */ + +-#define NCJSON_INTERNAL ++/* ++WARNING: ++If you modify this file, ++then you need to got to ++the include/ directory ++and do the command: ++ make makenetcdfjson ++*/ + + #include + #include +@@ -97,24 +104,38 @@ static int NCJunescape(NCJparser* parser); + static int unescape1(int c); + static int listappend(struct NCjlist* list, NCjson* element); + +-#ifndef NETCDF_JSON_H + static int NCJcloneArray(const NCjson* array, NCjson** clonep); + static int NCJcloneDict(const NCjson* dict, NCjson** clonep); + static int NCJunparseR(const NCjson* json, NCJbuf* buf, unsigned flags); + static int bytesappendquoted(NCJbuf* buf, const char* s); + static int bytesappend(NCJbuf* buf, const char* s); + static int bytesappendc(NCJbuf* bufp, const char c); +-#endif ++ ++/* Hide these for plugins */ ++#ifdef NETCDF_JSON_H ++#define OPTSTATIC static ++static int NCJparsen(size_t len, const char* text, unsigned flags, NCjson** jsonp); ++static int NCJnew(int sort, NCjson** objectp); ++static int NCJnewstring(int sort, const char* value, NCjson** jsonp); ++static int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); ++static int NCJclone(const NCjson* json, NCjson** clonep); ++static int NCJaddstring(NCjson* json, int sort, const char* s); ++static int NCJinsert(NCjson* object, char* key, NCjson* jvalue); ++static int NCJappend(NCjson* object, NCjson* value); ++static int NCJunparse(const NCjson* json, unsigned flags, char** textp); ++#else /*!NETCDF_JSON_H*/ ++#define OPTSTATIC ++#endif /*NETCDF_JSON_H*/ + + /**************************************************/ + +-int ++OPTSTATIC int + NCJparse(const char* text, unsigned flags, NCjson** jsonp) + { + return NCJparsen(strlen(text),text,flags,jsonp); + } + +-int ++OPTSTATIC int + NCJparsen(size_t len, const char* text, unsigned flags, NCjson** jsonp) + { + int stat = NCJ_OK; +@@ -466,7 +487,7 @@ NCJyytext(NCJparser* parser, char* start, size_t pdlen) + + /**************************************************/ + +-void ++OPTSTATIC void + NCJreclaim(NCjson* json) + { + if(json == NULL) return; +@@ -508,7 +529,7 @@ NCJreclaimDict(struct NCjlist* dict) + /**************************************************/ + /* Build Functions */ + +-int ++OPTSTATIC int + NCJnew(int sort, NCjson** objectp) + { + int stat = NCJ_OK; +@@ -538,13 +559,13 @@ done: + return NCJTHROW(stat); + } + +-int ++OPTSTATIC int + NCJnewstring(int sort, const char* value, NCjson** jsonp) + { + return NCJTHROW(NCJnewstringn(sort,strlen(value),value,jsonp)); + } + +-int ++OPTSTATIC int + NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp) + { + int stat = NCJ_OK; +@@ -566,7 +587,7 @@ done: + return NCJTHROW(stat); + } + +-int ++OPTSTATIC int + NCJdictget(const NCjson* dict, const char* key, NCjson** valuep) + { + int i,stat = NCJ_OK; +@@ -657,7 +678,7 @@ tokenname(int token) + #endif + + /* Convert a JSON value to an equivalent value of a specified sort */ +-int ++OPTSTATIC int + NCJcvt(const NCjson* jvalue, int outsort, struct NCJconst* output) + { + int stat = NCJ_OK; +@@ -766,9 +787,7 @@ done: + + /**************************************************/ + +-#ifndef NETCDF_JSON_H +- +-int ++OPTSTATIC int + NCJclone(const NCjson* json, NCjson** clonep) + { + int stat = NCJ_OK; +@@ -836,7 +855,7 @@ done: + return NCJTHROW(stat); + } + +-int ++OPTSTATIC int + NCJaddstring(NCjson* json, int sort, const char* s) + { + int stat = NCJ_OK; +@@ -854,7 +873,7 @@ done: + } + + /* Insert key-value pair into a dict object. key will be strdup'd */ +-int ++OPTSTATIC int + NCJinsert(NCjson* object, char* key, NCjson* jvalue) + { + int stat = NCJ_OK; +@@ -869,7 +888,7 @@ done: + } + + /* Append value to an array or dict object. */ +-int ++OPTSTATIC int + NCJappend(NCjson* object, NCjson* value) + { + if(object == NULL || value == NULL) +@@ -888,7 +907,7 @@ NCJappend(NCjson* object, NCjson* value) + /**************************************************/ + /* Unparser to convert NCjson object to text in buffer */ + +-int ++OPTSTATIC int + NCJunparse(const NCjson* json, unsigned flags, char** textp) + { + int stat = NCJ_OK; +@@ -992,17 +1011,6 @@ bytesappendquoted(NCJbuf* buf, const char* s) + return NCJTHROW(NCJ_OK); + } + +-void +-NCJdump(const NCjson* json, unsigned flags, FILE* out) +-{ +- char* text = NULL; +- (void)NCJunparse(json,0,&text); +- if(out == NULL) out = stderr; +- fprintf(out,"%s\n",text); +- fflush(out); +- nullfree(text); +-} +- + static int + bytesappend(NCJbuf* buf, const char* s) + { +@@ -1042,4 +1050,29 @@ bytesappendc(NCJbuf* bufp, const char c) + s[1] = '\0'; + return bytesappend(bufp,s); + } +-#endif /*!NETCDF_JSON_H*/ ++ ++OPTSTATIC void ++NCJdump(const NCjson* json, unsigned flags, FILE* out) ++{ ++ char* text = NULL; ++ (void)NCJunparse(json,0,&text); ++ if(out == NULL) out = stderr; ++ fprintf(out,"%s\n",text); ++ fflush(out); ++ nullfree(text); ++} ++ ++/* Hack to avoid static unused warning */ ++static void ++netcdf_supresswarnings(void) ++{ ++ void* ignore; ++ ignore = (void*)netcdf_supresswarnings; ++ ignore = (void*)NCJdump; ++ ignore = (void*)NCJinsert; ++ ignore = (void*)NCJaddstring; ++ ignore = (void*)NCJcvt; ++ ignore = (void*)NCJdictget; ++ ignore = (void*)NCJparse; ++ ignore = ignore; ++} +diff --git a/nc_test4/tst_vars3.c b/nc_test4/tst_vars3.c +index 1b5a7ce79..734017c4d 100644 +--- a/nc_test4/tst_vars3.c ++++ b/nc_test4/tst_vars3.c +@@ -748,9 +748,9 @@ main(int argc, char **argv) + params[1] = NC_SZIP_EC_BPP_IN; /* pixels_per_block */ + if (nc_def_var_chunking(ncid, varid, NC_CHUNKED, NULL)) ERR; + { int stat; +- if ((stat = nc_def_var_filter(ncid, varid, H5_FILTER_SZIP, NUM_PARAMS_IN, +- params)) != NC_ENOFILTER) +- ERR; ++ stat = nc_def_var_filter(ncid, varid, H5_FILTER_SZIP, NUM_PARAMS_IN, params); ++ if(stat != NC_ENOFILTER) ++ ERR; + } + if (nc_def_var_szip(ncid, varid, NC_SZIP_NN, + NC_SZIP_EC_BPP_IN) != NC_ENOFILTER) ERR; +diff --git a/ncdump/tst_vlen_data.c b/ncdump/tst_vlen_data.c +index 9b1850e8f..ad5d18388 100644 +--- a/ncdump/tst_vlen_data.c ++++ b/ncdump/tst_vlen_data.c +@@ -28,6 +28,10 @@ The leak may be in HDF5. + #define ATT5_LEN 1 + #define NROWS 5 + ++/* Use reclaim_data */ ++#undef RECLAIM ++ ++ + int + main(int argc, char **argv) + { +@@ -64,7 +68,7 @@ main(int argc, char **argv) + if (nc_def_var(ncid, VAR5_NAME, typeid, VAR5_RANK, var_dims, &varid)) ERR; + + /* Create and write a variable attribute of the vlen type */ +-#if 0 ++#ifdef RECLAIM + /* In order to use ncaux_reclaim_data, all the interior nodes must have been alloc'd */ + missing_val.p = (float*)malloc(sizeof(missing_value)); + memcpy((void*)missing_val.p,&missing_value,sizeof(missing_value)); +@@ -74,7 +78,7 @@ main(int argc, char **argv) + missing_val.len = 1; + if (nc_put_att(ncid, varid, ATT5_NAME, typeid, ATT5_LEN, (void *) &missing_val)) ERR; + if (nc_enddef(ncid)) ERR; +-#if 0 ++#ifdef RECLAIM + /* reclaim */ + if(ncaux_reclaim_data(ncid,typeid,&missing_val,1)) ERR; + #endif +diff --git a/ncgen3/run_tests.sh b/ncgen3/run_tests.sh +index fcba7489e..8e300092c 100755 +--- a/ncgen3/run_tests.sh ++++ b/ncgen3/run_tests.sh +@@ -3,6 +3,7 @@ + # $Id: run_tests.sh,v 1.9 2009/09/24 18:19:11 dmh Exp $ + + echo "*** Testing ncgen3." ++ + set -e + + if test "x$srcdir" = x ;then srcdir=`pwd`; fi diff --git a/recipe/patches/netCDF-4.9.0-json-linking-errors.patch b/recipe/patches/netCDF-4.9.0-json-linking-errors.patch deleted file mode 100644 index 7df2d183..00000000 --- a/recipe/patches/netCDF-4.9.0-json-linking-errors.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- netcdf-c-4.9.0.orig/include/netcdf_json.h 2022-06-10 18:04:15.000000000 -0300 -+++ netcdf-c-4.9.0/include/netcdf_json.h 2022-06-29 09:05:37.311407278 -0300 -@@ -57,25 +57,25 @@ - #endif - - /* Parse a JSON string */ --DLLEXPORT int NCJparse(const char* text, unsigned flags, NCjson** jsonp); -+DLLEXPORT static int NCJparse(const char* text, unsigned flags, NCjson** jsonp); - - /* Reclaim a JSON tree */ --DLLEXPORT extern void NCJreclaim(NCjson* json); -+DLLEXPORT static void NCJreclaim(NCjson* json); - - /* Create a new JSON node of a given sort */ --DLLEXPORT extern int NCJnew(int sort, NCjson** objectp); -+DLLEXPORT static int NCJnew(int sort, NCjson** objectp); - - /* Create new json object with given string content */ --DLLEXPORT extern int NCJnewstring(int sort, const char* value, NCjson** jsonp); -+DLLEXPORT static int NCJnewstring(int sort, const char* value, NCjson** jsonp); - - /* Create new json object with given counted string content */ --DLLEXPORT extern int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); -+DLLEXPORT static int NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp); - - /* Get dict key value by name */ --DLLEXPORT extern int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); -+DLLEXPORT static int NCJdictget(const NCjson* dict, const char* key, NCjson** valuep); - - /* Convert one json sort to value of another type; don't use union so we can know when to reclaim sval */ --DLLEXPORT extern int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); -+DLLEXPORT static int NCJcvt(const NCjson* value, int outsort, struct NCJconst* output); - - #ifndef NETCDF_JSON_H - -@@ -230,7 +230,7 @@ - - /**************************************************/ - --int -+static int - NCJparse(const char* text, unsigned flags, NCjson** jsonp) - { - int stat = NCJ_OK; -@@ -579,7 +579,7 @@ - - /**************************************************/ - --void -+static void - NCJreclaim(NCjson* json) - { - if(json == NULL) return; -@@ -621,7 +621,7 @@ - /**************************************************/ - /* Build Functions */ - --int -+static int - NCJnew(int sort, NCjson** objectp) - { - int stat = NCJ_OK; -@@ -651,13 +651,13 @@ - return NCJTHROW(stat); - } - --int -+static int - NCJnewstring(int sort, const char* value, NCjson** jsonp) - { - return NCJTHROW(NCJnewstringn(sort,strlen(value),value,jsonp)); - } - --int -+static int - NCJnewstringn(int sort, size_t len, const char* value, NCjson** jsonp) - { - int stat = NCJ_OK; -@@ -679,7 +679,7 @@ - return NCJTHROW(stat); - } - --int -+static int - NCJdictget(const NCjson* dict, const char* key, NCjson** valuep) - { - int i,stat = NCJ_OK; -@@ -755,7 +755,7 @@ - #endif - - /* Convert a JSON value to an equivalent value of a specified sort */ --int -+static int - NCJcvt(const NCjson* jvalue, int outsort, struct NCJconst* output) - { - int stat = NCJ_OK; From 3c21772ec2418e43b84f003462520f5deb8ca34c Mon Sep 17 00:00:00 2001 From: Ryan May Date: Thu, 22 Sep 2022 17:23:21 -0700 Subject: [PATCH 13/25] Incorporate upstream changes to fix test --- recipe/meta.yaml | 1 + recipe/patches/fix-tests.patch | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 recipe/patches/fix-tests.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 250d568b..7538dd82 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -28,6 +28,7 @@ source: # Revert upstream change in 4.8.1--maybe unnecessary in 4.8.2 - patches/fix_cmake.patch # [win] - patches/fix-ncjson.patch + - patches/fix-tests.patch build: number: {{ build }} diff --git a/recipe/patches/fix-tests.patch b/recipe/patches/fix-tests.patch new file mode 100644 index 00000000..ea8a9503 --- /dev/null +++ b/recipe/patches/fix-tests.patch @@ -0,0 +1,33 @@ +commit 46ed3a1da720ca9ec180974f3ebfb97b4286e6ce +Author: Dennis Heimbigner +Date: Fri Sep 16 18:58:36 2022 -0600 + + Cleanup built test sources in nczarr_test + + re: https://github.com/conda-forge/libnetcdf-feedstock/pull/140 + + Some test are BUILTSOURCE in nczarr_test. But apparently + I did not do it correctly. SO try to cleanup their construction. + +diff --git a/nczarr_test/Makefile.am b/nczarr_test/Makefile.am +index 6c237d778..1798455aa 100644 +--- a/nczarr_test/Makefile.am ++++ b/nczarr_test/Makefile.am +@@ -129,7 +129,7 @@ EXTRA_DIST = CMakeLists.txt \ + run_ut_map.sh run_ut_mapapi.sh run_ut_misc.sh run_ut_chunk.sh run_ncgen4.sh \ + run_nccopyz.sh run_fillonlyz.sh run_chunkcases.sh test_nczarr.sh run_perf_chunks1.sh run_s3_cleanup.sh \ + run_purezarr.sh run_interop.sh run_misc.sh \ +-run_filter.sh run_specific_filters.sh \ ++run_filter.sh \ + run_newformat.sh run_nczarr_fill.sh run_quantize.sh \ + run_jsonconvention.sh run_nczfilter.sh run_unknown.sh \ + run_scalar.sh run_strings.sh run_nulls.sh +@@ -161,7 +161,7 @@ EXTRA_DIST += ref_power_901_constants_orig.zip ref_power_901_constants.cdl ref_q + + CLEANFILES = ut_*.txt ut*.cdl tmp*.nc tmp*.cdl tmp*.txt tmp*.dmp tmp*.zip tmp*.nc tmp*.dump tmp*.tmp tmp_ngc.c ref_zarr_test_data.cdl tst_*.nc.zip ref_quotes.zip ref_power_901_constants.zip + +-BUILT_SOURCES = test_quantize.c test_filter_avail.c run_specific_filters.sh run_filterinstall.sh ++BUILT_SOURCES = test_quantize.c test_filter_avail.c run_specific_filters.sh run_filterinstall.sh run_unknown.sh + test_quantize.c: $(top_srcdir)/nc_test4/tst_quantize.c + rm -f $@ + echo "#define TESTNCZARR" > $@ From 01d71e4bcaa26cb361031a3080ffcfd748c23e37 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Fri, 23 Sep 2022 06:45:07 -0400 Subject: [PATCH 14/25] add. DENABLE_EXTERNAL_SERVER_TESTS to Unix build --- recipe/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/build.sh b/recipe/build.sh index 0d37f3fa..8a77de7a 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -74,6 +74,7 @@ cmake ${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DENABLE_DOXYGEN=OFF \ -DENABLE_CDF5=ON \ -DENABLE_BYTERANGE=ON \ + -DENABLE_EXTERNAL_SERVER_TESTS=OFF \ ${PARALLEL} \ -DENABLE_NCZARR=on \ -DENABLE_NCZARR_S3=off \ @@ -97,6 +98,7 @@ cmake ${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DBUILD_UTILITIES=ON \ -DENABLE_DOXYGEN=OFF \ -DENABLE_CDF5=ON \ + -DENABLE_EXTERNAL_SERVER_TESTS=OFF \ ${PARALLEL} \ -DENABLE_NCZARR=on \ -DENABLE_NCZARR_S3=off \ From 357483530d8c561f91b6dc4419f081fce62d8025 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Fri, 23 Sep 2022 06:57:04 -0400 Subject: [PATCH 15/25] add DENABLE_EXTERNAL_SERVER_TESTS off in windows builds --- recipe/bld.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/bld.bat b/recipe/bld.bat index 86d177d9..87a0864a 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -22,6 +22,7 @@ cmake -LAH -G "NMake Makefiles" ^ -DENABLE_NCZARR=on ^ -DENABLE_NCZARR_S3=off ^ -DENABLE_NCZARR_S3_TESTS=off ^ + -DENABLE_EXTERNAL_SERVER_TESTS=OFF ^ %SRC_DIR% if errorlevel 1 exit \b 1 From 614c74dfd26ff10352128f0393ce63203c21d4a3 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 27 Sep 2022 13:29:47 -0600 Subject: [PATCH 16/25] Convert in-source-tree builds to out-of-source-tree builds. --- recipe/build.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/recipe/build.sh b/recipe/build.sh index 8a77de7a..4ddd18aa 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -59,6 +59,12 @@ fi # DAP Remote tests are causing spurious failures at the momment # https://github.com/Unidata/netcdf-c/issues/2188#issuecomment-1015927961 # -DENABLE_DAP_REMOTE_TESTS=OFF + +# 2022/09/27 +# Cmake discourages in-source-tree builds, so moving to out-of-source-tree builds. +# +mkdir build-static +cd build-static # Build static. cmake ${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DCMAKE_INSTALL_LIBDIR="lib" \ @@ -83,7 +89,11 @@ cmake ${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${PREFIX} \ # ctest # Run only for the shared lib build to save time. make install -j${CPU_COUNT} ${VERBOSE_CM} make clean +cd .. + +mkdir build-shared +cd build-shared # Build shared. cmake ${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DCMAKE_INSTALL_LIBDIR="lib" \ @@ -112,6 +122,13 @@ if [[ "${CONDA_BUILD_CROSS_COMPILATION:-}" != "1" || "${CROSSCOMPILING_EMULATOR} ctest -VV --output-on-failure -j${CPU_COUNT} ${SKIP} fi +# +# Clean up build directories +# +cd .. +rm -rf build-static +rm -rf build-shared + # Fix build paths in cmake artifacts for fname in `ls ${PREFIX}/lib/cmake/netCDF/*`; do sed -i.bak "s#${CONDA_BUILD_SYSROOT}/usr/lib/lib\([a-z]*\).so#\1#g" ${fname} From 67360717dc519b46b69320d81c7abd114ef0639f Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 27 Sep 2022 13:33:55 -0600 Subject: [PATCH 17/25] Patch in the option to disable external server tests. --- recipe/patches/fix-tests.patch | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/recipe/patches/fix-tests.patch b/recipe/patches/fix-tests.patch index ea8a9503..c7bd2fd1 100644 --- a/recipe/patches/fix-tests.patch +++ b/recipe/patches/fix-tests.patch @@ -31,3 +31,63 @@ index 6c237d778..1798455aa 100644 test_quantize.c: $(top_srcdir)/nc_test4/tst_quantize.c rm -f $@ echo "#define TESTNCZARR" > $@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ba66a6d..f987eb5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1057,17 +1078,26 @@ OPTION(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." OFF) + # Check for the math library so it can be explicitly linked. + IF(NOT WIN32) + FIND_LIBRARY(HAVE_LIBM NAMES math m libm) +- MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + IF(NOT HAVE_LIBM) +- MESSAGE(FATAL_ERROR "Unable to find the math library.") ++ CHECK_FUNCTION_EXISTS(exp HAVE_LIBM_FUNC) ++ IF(NOT HAVE_LIBM_FUNC) ++ MESSAGE(FATAL_ERROR "Unable to find the math library.") ++ ELSE(NOT HAVE_LIBM_FUNC) ++ SET(HAVE_LIBM "") ++ ENDIF() ++ ELSE(NOT HAVE_LIBM) ++ MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + ENDIF() + ENDIF() + + # Option to Enable DAP long tests, remote tests. + OPTION(ENABLE_DAP_REMOTE_TESTS "Enable DAP remote tests." ON) ++OPTION(ENABLE_EXTERNAL_SERVER_TESTS "Enable external Server remote tests." OFF) + OPTION(ENABLE_DAP_LONG_TESTS "Enable DAP long tests." OFF) + SET(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test") + ++SET(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test") ++ + # See if we have zlib + FIND_PACKAGE(ZLIB) + @@ -1057,17 +1078,26 @@ OPTION(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." OFF) + # Check for the math library so it can be explicitly linked. + IF(NOT WIN32) + FIND_LIBRARY(HAVE_LIBM NAMES math m libm) +- MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + IF(NOT HAVE_LIBM) +- MESSAGE(FATAL_ERROR "Unable to find the math library.") ++ CHECK_FUNCTION_EXISTS(exp HAVE_LIBM_FUNC) ++ IF(NOT HAVE_LIBM_FUNC) ++ MESSAGE(FATAL_ERROR "Unable to find the math library.") ++ ELSE(NOT HAVE_LIBM_FUNC) ++ SET(HAVE_LIBM "") ++ ENDIF() ++ ELSE(NOT HAVE_LIBM) ++ MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}") + ENDIF() + ENDIF() + + # Option to Enable DAP long tests, remote tests. + OPTION(ENABLE_DAP_REMOTE_TESTS "Enable DAP remote tests." ON) ++OPTION(ENABLE_EXTERNAL_SERVER_TESTS "Enable external Server remote tests." OFF) + OPTION(ENABLE_DAP_LONG_TESTS "Enable DAP long tests." OFF) + SET(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test") + ++SET(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test") ++ + # See if we have zlib + FIND_PACKAGE(ZLIB) \ No newline at end of file From 0d8db1422b12f1fd8716b1fd9502c773efbf7666 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 28 Sep 2022 09:28:39 -0600 Subject: [PATCH 18/25] Renamed .path file to .patch. --- recipe/meta.yaml | 2 +- ...ibrary_versionand_filename_in_4.9.0.patch} | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) rename recipe/patches/{incorrect_library_versionand_filename_in_4.9.0.path => incorrect_library_versionand_filename_in_4.9.0.patch} (97%) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 7538dd82..fc7174d6 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -24,7 +24,7 @@ source: - patches/strdup.patch - patches/do_not_use_16_processes_in_tests.patch # [ppc64le] # https://github.com/Unidata/netcdf-c/issues/2390 - - patches/incorrect_library_versionand_filename_in_4.9.0.path + - patches/incorrect_library_versionand_filename_in_4.9.0.patch # Revert upstream change in 4.8.1--maybe unnecessary in 4.8.2 - patches/fix_cmake.patch # [win] - patches/fix-ncjson.patch diff --git a/recipe/patches/incorrect_library_versionand_filename_in_4.9.0.path b/recipe/patches/incorrect_library_versionand_filename_in_4.9.0.patch similarity index 97% rename from recipe/patches/incorrect_library_versionand_filename_in_4.9.0.path rename to recipe/patches/incorrect_library_versionand_filename_in_4.9.0.patch index 8d983da5..c5feb5f2 100644 --- a/recipe/patches/incorrect_library_versionand_filename_in_4.9.0.path +++ b/recipe/patches/incorrect_library_versionand_filename_in_4.9.0.patch @@ -1,11 +1,11 @@ ---- netcdf-c-4.9.0.orig/CMakeLists.txt 2022-06-10 18:04:15.000000000 -0300 -+++ netcdf-c-4.9.0/CMakeLists.txt 2022-06-13 09:22:39.516181352 -0300 -@@ -39,7 +39,7 @@ - SET(PACKAGE_VERSION ${VERSION}) - - # These values should match those in configure.ac --SET(netCDF_LIB_VERSION 19}) -+SET(netCDF_LIB_VERSION 19) - SET(netCDF_SO_VERSION 19) - - # Version of the dispatch table. This must match the value in +--- netcdf-c-4.9.0.orig/CMakeLists.txt 2022-06-10 18:04:15.000000000 -0300 ++++ netcdf-c-4.9.0/CMakeLists.txt 2022-06-13 09:22:39.516181352 -0300 +@@ -39,7 +39,7 @@ + SET(PACKAGE_VERSION ${VERSION}) + + # These values should match those in configure.ac +-SET(netCDF_LIB_VERSION 19}) ++SET(netCDF_LIB_VERSION 19) + SET(netCDF_SO_VERSION 19) + + # Version of the dispatch table. This must match the value in From 4226a222ea426333749a352eab899bebacb2bcef Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 28 Sep 2022 09:59:35 -0600 Subject: [PATCH 19/25] Combine CMakeLists.txt patches, eliminate patch file throwing a very strange error. See if the error follows the patch or if it was tied to the file. --- recipe/meta.yaml | 2 +- recipe/patches/fix_cmake.patch | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index fc7174d6..accde1ca 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -24,7 +24,7 @@ source: - patches/strdup.patch - patches/do_not_use_16_processes_in_tests.patch # [ppc64le] # https://github.com/Unidata/netcdf-c/issues/2390 - - patches/incorrect_library_versionand_filename_in_4.9.0.patch + # patches/incorrect_library_versionand_filename_in_4.9.0.patch # Revert upstream change in 4.8.1--maybe unnecessary in 4.8.2 - patches/fix_cmake.patch # [win] - patches/fix-ncjson.patch diff --git a/recipe/patches/fix_cmake.patch b/recipe/patches/fix_cmake.patch index f4e33b19..7f40c2eb 100644 --- a/recipe/patches/fix_cmake.patch +++ b/recipe/patches/fix_cmake.patch @@ -1,6 +1,15 @@ diff --color -Naur netcdf-c-4.9.0.orig/CMakeLists.txt netcdf-c-4.9.0/CMakeLists.txt --- netcdf-c-4.9.0.orig/CMakeLists.txt 2022-06-10 18:04:15.000000000 -0300 +++ netcdf-c-4.9.0/CMakeLists.txt 2022-06-13 10:29:40.177921583 -0300 +@@ -39,7 +39,7 @@ + SET(PACKAGE_VERSION ${VERSION}) + + # These values should match those in configure.ac +-SET(netCDF_LIB_VERSION 19}) ++SET(netCDF_LIB_VERSION 19) + SET(netCDF_SO_VERSION 19) + + # Version of the dispatch table. This must match the value in @@ -893,11 +893,19 @@ # Check to see if HDF5 library is 1.10.6 or greater. # Used to control path name conversion From 2b174174572eb4cdb243a4a79939f748742b0285 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 28 Sep 2022 10:23:42 -0600 Subject: [PATCH 20/25] Add a patch to fix a race condition in one of the nccopy tests. --- recipe/meta.yaml | 1 + recipe/patches/fix-ncdump-tests-prereq.patch | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 recipe/patches/fix-ncdump-tests-prereq.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index accde1ca..a5a4365b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -29,6 +29,7 @@ source: - patches/fix_cmake.patch # [win] - patches/fix-ncjson.patch - patches/fix-tests.patch + - patches/fix-ncdump-tests-prereq.patch build: number: {{ build }} diff --git a/recipe/patches/fix-ncdump-tests-prereq.patch b/recipe/patches/fix-ncdump-tests-prereq.patch new file mode 100644 index 00000000..6f7d225e --- /dev/null +++ b/recipe/patches/fix-ncdump-tests-prereq.patch @@ -0,0 +1,14 @@ +--- netcdf-c-v4.9.0/ncdump/CMakeLists.txt 2022-09-28 10:19:24.000000000 -0600 ++++ netcdf-c-fixed/ncdump/CMakeLists.txt 2022-09-28 10:20:19.000000000 -0600 +@@ -256,7 +256,7 @@ + add_sh_test(ncdump tst_netcdf4_4) + add_sh_test(ncdump tst_nccopy4) + +- SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS +"ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2") ++ SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS +"ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_sh_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2") + SET_TESTS_PROPERTIES(ncdump_tst_nccopy5 PROPERTIES DEPENDS "ncdump_tst_nccopy4") + + ENDIF(USE_HDF5) + From 9d23daeed8ab824393eab8b86730e9edeb9248c6 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 28 Sep 2022 10:32:14 -0600 Subject: [PATCH 21/25] Hopefully correct malformed patch file. --- recipe/patches/fix-ncdump-tests-prereq.patch | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/recipe/patches/fix-ncdump-tests-prereq.patch b/recipe/patches/fix-ncdump-tests-prereq.patch index 6f7d225e..ddff2b31 100644 --- a/recipe/patches/fix-ncdump-tests-prereq.patch +++ b/recipe/patches/fix-ncdump-tests-prereq.patch @@ -1,14 +1,15 @@ ---- netcdf-c-v4.9.0/ncdump/CMakeLists.txt 2022-09-28 10:19:24.000000000 -0600 -+++ netcdf-c-fixed/ncdump/CMakeLists.txt 2022-09-28 10:20:19.000000000 -0600 -@@ -256,7 +256,7 @@ +diff --git a/netcdf-c-v4.9.0/ncdump/CMakeLists.txt b/netcdf-c-fixed/ncdump/CMakeLists.txt +index 056810f..27f9e49 100644 +--- a/netcdf-c-v4.9.0/ncdump/CMakeLists.txt ++++ b/netcdf-c-fixed/ncdump/CMakeLists.txt +@@ -256,7 +256,7 @@ endif() add_sh_test(ncdump tst_netcdf4_4) add_sh_test(ncdump tst_nccopy4) -- SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS -"ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2") -+ SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS -"ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_sh_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2") +- SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS "ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2") ++ SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS "ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_sh_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2") SET_TESTS_PROPERTIES(ncdump_tst_nccopy5 PROPERTIES DEPENDS "ncdump_tst_nccopy4") ENDIF(USE_HDF5) + From 2ea5f200e20bf20cb9a66465ab2e168171b085ab Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 28 Sep 2022 10:47:20 -0600 Subject: [PATCH 22/25] Added a dependency to tst_nans to tst_nccopy4 --- recipe/patches/fix-ncdump-tests-prereq.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipe/patches/fix-ncdump-tests-prereq.patch b/recipe/patches/fix-ncdump-tests-prereq.patch index ddff2b31..bd99e09b 100644 --- a/recipe/patches/fix-ncdump-tests-prereq.patch +++ b/recipe/patches/fix-ncdump-tests-prereq.patch @@ -1,5 +1,5 @@ diff --git a/netcdf-c-v4.9.0/ncdump/CMakeLists.txt b/netcdf-c-fixed/ncdump/CMakeLists.txt -index 056810f..27f9e49 100644 +index 056810f..feab56d 100644 --- a/netcdf-c-v4.9.0/ncdump/CMakeLists.txt +++ b/netcdf-c-fixed/ncdump/CMakeLists.txt @@ -256,7 +256,7 @@ endif() @@ -7,9 +7,11 @@ index 056810f..27f9e49 100644 add_sh_test(ncdump tst_nccopy4) - SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS "ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2") -+ SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS "ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_sh_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2") ++ SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS "ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_sh_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2;tst_nans") SET_TESTS_PROPERTIES(ncdump_tst_nccopy5 PROPERTIES DEPENDS "ncdump_tst_nccopy4") ENDIF(USE_HDF5) + + From b62fb512f6160a7a7be87f293679d1b6a252f72e Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 28 Sep 2022 11:06:24 -0600 Subject: [PATCH 23/25] Add more dependencies to whack more race condition moles. --- recipe/patches/fix-ncdump-tests-prereq.patch | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/recipe/patches/fix-ncdump-tests-prereq.patch b/recipe/patches/fix-ncdump-tests-prereq.patch index bd99e09b..d820d88c 100644 --- a/recipe/patches/fix-ncdump-tests-prereq.patch +++ b/recipe/patches/fix-ncdump-tests-prereq.patch @@ -1,5 +1,5 @@ diff --git a/netcdf-c-v4.9.0/ncdump/CMakeLists.txt b/netcdf-c-fixed/ncdump/CMakeLists.txt -index 056810f..feab56d 100644 +index 056810f..52dae3b 100644 --- a/netcdf-c-v4.9.0/ncdump/CMakeLists.txt +++ b/netcdf-c-fixed/ncdump/CMakeLists.txt @@ -256,7 +256,7 @@ endif() @@ -7,11 +7,7 @@ index 056810f..feab56d 100644 add_sh_test(ncdump tst_nccopy4) - SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS "ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2") -+ SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS "ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_sh_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2;tst_nans") ++ SET_TESTS_PROPERTIES(ncdump_tst_nccopy4 PROPERTIES DEPENDS "ncdump_run_ncgen_tests;ncdump_tst_output;ncdump_tst_ncgen4;ncdump_sh_tst_fillbug;ncdump_tst_netcdf4_4;ncdump_tst_h_scalar;tst_comp;tst_comp2;tst_nans;tst_opaque_data;tst_create_files;tst_special_atts") SET_TESTS_PROPERTIES(ncdump_tst_nccopy5 PROPERTIES DEPENDS "ncdump_tst_nccopy4") - ENDIF(USE_HDF5) - - - - + ENDIF(USE_HDF5) \ No newline at end of file From 08bd865a4342701abf851cb166c21d9de5c101d3 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Thu, 29 Sep 2022 17:03:07 -0400 Subject: [PATCH 24/25] remove static builds --- recipe/build.sh | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/recipe/build.sh b/recipe/build.sh index 4ddd18aa..449d764c 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -60,38 +60,6 @@ fi # https://github.com/Unidata/netcdf-c/issues/2188#issuecomment-1015927961 # -DENABLE_DAP_REMOTE_TESTS=OFF -# 2022/09/27 -# Cmake discourages in-source-tree builds, so moving to out-of-source-tree builds. -# -mkdir build-static -cd build-static -# Build static. -cmake ${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${PREFIX} \ - -DCMAKE_INSTALL_LIBDIR="lib" \ - -DCMAKE_PREFIX_PATH=${PREFIX} \ - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ - -DENABLE_DAP=ON \ - -DENABLE_DAP_REMOTE_TESTS=OFF \ - -DENABLE_HDF4=ON \ - -DENABLE_NETCDF_4=ON \ - -DBUILD_SHARED_LIBS=OFF \ - -DENABLE_TESTS=ON \ - -DBUILD_UTILITIES=ON \ - -DENABLE_DOXYGEN=OFF \ - -DENABLE_CDF5=ON \ - -DENABLE_BYTERANGE=ON \ - -DENABLE_EXTERNAL_SERVER_TESTS=OFF \ - ${PARALLEL} \ - -DENABLE_NCZARR=on \ - -DENABLE_NCZARR_S3=off \ - -DENABLE_NCZARR_S3_TESTS=off \ - ${SRC_DIR} -# ctest # Run only for the shared lib build to save time. -make install -j${CPU_COUNT} ${VERBOSE_CM} -make clean -cd .. - - mkdir build-shared cd build-shared # Build shared. @@ -126,7 +94,6 @@ fi # Clean up build directories # cd .. -rm -rf build-static rm -rf build-shared # Fix build paths in cmake artifacts From 5756b3b1ff61d24710b914bed21e8b95ff4eca7a Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Thu, 29 Sep 2022 17:03:48 -0400 Subject: [PATCH 25/25] disable static builds --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a5a4365b..59a3875c 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -92,7 +92,7 @@ requirements: test: commands: - - test -f ${PREFIX}/lib/libnetcdf.a # [not win] + - test ! -f ${PREFIX}/lib/libnetcdf.a # [not win] - test -f ${PREFIX}/lib/libnetcdf${SHLIB_EXT} # [not win] - nc-config --all # [not win]
Travis