Skip to content

Commit

Permalink
Merge pull request #140 from ocefpaf/v4.9.0
Browse files Browse the repository at this point in the history
V4.9.0
  • Loading branch information
dopplershift authored Sep 29, 2022
2 parents 995ba0c + 5756b3b commit 9d949bf
Show file tree
Hide file tree
Showing 11 changed files with 1,014 additions and 98 deletions.
1 change: 1 addition & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
32 changes: 9 additions & 23 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,9 @@ 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
# 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 \
${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

mkdir build-shared
cd build-shared
# Build shared.
cmake ${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_INSTALL_LIBDIR="lib" \
Expand All @@ -97,6 +76,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 \
Expand All @@ -110,6 +90,12 @@ 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-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}
Expand Down
18 changes: 11 additions & 7 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = "4.8.1" %}
{% set build = 4 %}
{% set version = "4.9.0" %}
{% set build = 0 %}

# recipe-lint fails if mpi is undefined
{% set mpi = mpi or 'nompi' %}
Expand All @@ -14,19 +14,22 @@ 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
- 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
- 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
# 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
- patches/fix-ncjson.patch
- patches/fix-tests.patch
- patches/fix-ncdump-tests-prereq.patch

build:
number: {{ build }}
Expand Down Expand Up @@ -81,14 +84,15 @@ requirements:
- hdf5 * {{ mpi_prefix }}_*
- jpeg
- libzip
- zstd
run:
- {{ mpi }} # [mpi != 'nompi']
- curl
- hdf5 * {{ mpi_prefix }}_*

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]

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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}")
Expand All @@ -14,21 +14,21 @@ 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])
+AC_SUBST(VS_CONFIGURATION,[])
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 $
Expand All @@ -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"

Expand All @@ -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}"

Expand Down
13 changes: 13 additions & 0 deletions recipe/patches/fix-ncdump-tests-prereq.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/netcdf-c-v4.9.0/ncdump/CMakeLists.txt b/netcdf-c-fixed/ncdump/CMakeLists.txt
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()
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;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)
Loading

0 comments on commit 9d949bf

Please sign in to comment.