From 39559adb822eac02a21c00304bcbae42cf516cac Mon Sep 17 00:00:00 2001 From: Alexander Barth Date: Mon, 13 Jun 2022 09:32:06 +0200 Subject: [PATCH] update to NetCDF v4.9.0 --- N/NetCDF/NetCDF@julia-1.8/build_tarballs.jl | 4 +- ...001-Fix-a-number-of-OS-specific-bugs.patch | 675 ------------------ ...ar_fletcher32-see-https-github.com-U.patch | 26 + .../0002-include-getopt.h-if-available.patch | 26 - .../0003-_fpclass-not-defined-on-mingw.patch | 25 - ...ave-rc-in-globalstate-rcinfo.triples.patch | 24 - N/NetCDF/common.jl | 27 +- 7 files changed, 42 insertions(+), 765 deletions(-) delete mode 100644 N/NetCDF/bundled/patches/0001-Fix-a-number-of-OS-specific-bugs.patch create mode 100644 N/NetCDF/bundled/patches/0001-fix-for-nc_def_var_fletcher32-see-https-github.com-U.patch delete mode 100644 N/NetCDF/bundled/patches/0002-include-getopt.h-if-available.patch delete mode 100644 N/NetCDF/bundled/patches/0003-_fpclass-not-defined-on-mingw.patch delete mode 100644 N/NetCDF/bundled/patches/0004-save-rc-in-globalstate-rcinfo.triples.patch diff --git a/N/NetCDF/NetCDF@julia-1.8/build_tarballs.jl b/N/NetCDF/NetCDF@julia-1.8/build_tarballs.jl index c5a15f5533b..c3e0362c686 100644 --- a/N/NetCDF/NetCDF@julia-1.8/build_tarballs.jl +++ b/N/NetCDF/NetCDF@julia-1.8/build_tarballs.jl @@ -2,11 +2,11 @@ include("../common.jl") # Offset to add to the version number. Remember to always bump this. -version_offset = v"0.2.3" +version_offset = v"0.2.4" # Minimum Julia version supported: this is important to decide which versions of # the dependencies to use, in particular the JLL stdlibs. min_julia_version = v"1.8" # Build the tarballs, and possibly a `build.jl` as well. -build_tarballs(ARGS, configure(version_offset, min_julia_version)...; julia_compat="1.8") +build_tarballs(ARGS, configure(version_offset, min_julia_version)...; julia_compat="1.8", preferred_gcc_version=v"5") diff --git a/N/NetCDF/bundled/patches/0001-Fix-a-number-of-OS-specific-bugs.patch b/N/NetCDF/bundled/patches/0001-Fix-a-number-of-OS-specific-bugs.patch deleted file mode 100644 index 5be97e80a78..00000000000 --- a/N/NetCDF/bundled/patches/0001-Fix-a-number-of-OS-specific-bugs.patch +++ /dev/null @@ -1,675 +0,0 @@ -From fcf179c6c799020871eed3ecbcc4dd34a9663c3b Mon Sep 17 00:00:00 2001 -From: Alexander Barth -Date: Wed, 2 Mar 2022 10:47:41 +0100 -Subject: [PATCH 1/3] Fix a number of OS specific bugs - ---- - configure.ac | 3 ++ - include/ncconfigure.h | 3 -- - include/ncrc.h | 2 + - libdispatch/dpathmgr.c | 8 ++-- - libdispatch/drc.c | 33 ++++++++++++---- - libdispatch/dutil.c | 7 +++- - libsrc/memio.c | 70 +++++---------------------------- - ncdump/CMakeLists.txt | 37 +++++++++++------- - ncdump/Makefile.am | 25 +++++++----- - ncdump/ref_rcmerge1.txt | 6 +-- - ncdump/ref_rcmerge2.txt | 2 +- - ncdump/ref_rcmerge3.txt | 2 +- - ncdump/test_rcmerge.sh | 87 +++++++++++++++++++++++++---------------- - ncgen/ncgen.l | 1 - - test_common.in | 8 ++++ - unit_test/tst_xcache.c | 2 +- - 16 files changed, 156 insertions(+), 140 deletions(-) - -diff --git a/configure.ac b/configure.ac -index b54096da..48faf27b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1117,14 +1117,17 @@ case "`uname`" in - CYGWIN*) ISCYGWIN=yes;; - Darwin*) ISOSX=yes;; - WIN*) ISMSVC=yes;; -+ MINGW*) ISMINGW=yes;; - esac - AM_CONDITIONAL(ISCYGWIN, [test "x$ISCYGWIN" = xyes]) - AM_CONDITIONAL(ISMSVC, [test "x$ISMSVC" = xyes]) - AM_CONDITIONAL(ISOSX, [test "x$ISOSX" = xyes]) -+AM_CONDITIONAL(ISMINGW, [test "x$ISMINGW" = xyes]) - - AC_SUBST([ISMSVC], [${ISMSVC}]) - AC_SUBST([ISCYGWIN], [${ISCYGWIN}]) - AC_SUBST([ISOSX], [${ISOSX}]) -+AC_SUBST([ISMINGW], [${ISMINGW}]) - - ### - # Crude hack to work around an issue -diff --git a/include/ncconfigure.h b/include/ncconfigure.h -index 2b4375ea..0f334ebf 100644 ---- a/include/ncconfigure.h -+++ b/include/ncconfigure.h -@@ -60,9 +60,6 @@ extern long long int strtoll(const char*, char**, int); - #ifndef strtoull - extern unsigned long long int strtoull(const char*, char**, int); - #endif --#ifndef fileno --extern int fileno(FILE*); --#endif - - #endif /*STDC*/ - #endif /*!_WIN32*/ -diff --git a/include/ncrc.h b/include/ncrc.h -index da9e3dc3..75d28042 100644 ---- a/include/ncrc.h -+++ b/include/ncrc.h -@@ -19,6 +19,7 @@ and accessing rc files (e.g. .daprc). - /* getenv() keys */ - #define NCRCENVIGNORE "NCRCENV_IGNORE" - #define NCRCENVRC "NCRCENV_RC" -+#define NCRCENVHOME "NCRCENV_HOME" - - - typedef struct NCTriple { -@@ -33,6 +34,7 @@ typedef struct NCRCinfo { - int loaded; /* 1 => already loaded */ - NClist* triples; /* the rc file triple store fields*/ - char* rcfile; /* specified rcfile; overrides anything else */ -+ char* rchome; /* Overrides $HOME when looking for .rc files */ - } NCRCinfo; - - /* Collect global state info in one place */ -diff --git a/libdispatch/dpathmgr.c b/libdispatch/dpathmgr.c -index eb450534..35bc0065 100644 ---- a/libdispatch/dpathmgr.c -+++ b/libdispatch/dpathmgr.c -@@ -859,10 +859,12 @@ getlocalpathkind(void) - int kind = NCPD_UNKNOWN; - #ifdef __CYGWIN__ - kind = NCPD_CYGWIN; --#elif __MSYS__ -- kind = NCPD_MSYS; --#elif _MSC_VER /* not _WIN32 */ -+#elif defined __MINGW32__ -+ kind = NCPD_WIN; -+#elif defined _MSC_VER /* not _WIN32 */ - kind = NCPD_WIN; -+#elif defined __MSYS__ -+ kind = NCPD_MSYS; - #else - kind = NCPD_NIX; - #endif -diff --git a/libdispatch/drc.c b/libdispatch/drc.c -index 64d34bd5..e6447f66 100644 ---- a/libdispatch/drc.c -+++ b/libdispatch/drc.c -@@ -13,6 +13,7 @@ See COPYRIGHT for license information. - #include - #include - #include -+#include - #include "netcdf.h" - #include "ncbytes.h" - #include "ncuri.h" -@@ -71,6 +72,18 @@ ncrc_initialize(void) - NCRCinitialized = 1; - } - -+static void -+ncrc_setrchome(void) -+{ -+ const char* tmp = NULL; -+ if(ncrc_globalstate->rcinfo.rchome) return; -+ assert(ncrc_globalstate && ncrc_globalstate->home); -+ tmp = getenv(NCRCENVHOME); -+ if(tmp == NULL || strlen(tmp) == 0) -+ tmp = ncrc_globalstate->home; -+ ncrc_globalstate->rcinfo.rchome = strdup(tmp); -+} -+ - /* Get global state */ - NCRCglobalstate* - ncrc_getglobalstate(void) -@@ -136,12 +149,12 @@ NC_rcload(void) - /* locate the configuration files in order of use: - 1. Specified by NCRCENV_RC environment variable. - 2. If NCRCENV_RC is not set then merge the set of rc files in this order: -- 1. $HOME/.ncrc -- 2. $HOME/.daprc -- 3. $HOME/.docsrc -- 4. $CWD/.ncrc -- 5. $CWD/.daprc -- 6. $CWD/.docsrc -+ 1. $RCHOME/.ncrc -+ 2. $RCHOME/.daprc -+ 3. $RCHOME/.docsrc -+ 4. $CWD/.ncrc -+ 5. $CWD/.daprc -+ 6. $CWD/.docsrc - Entries in later files override any of the earlier files - */ - if(globalstate->rcinfo.rcfile != NULL) { /* always use this */ -@@ -150,8 +163,12 @@ NC_rcload(void) - const char** rcname; - const char* dirnames[3]; - const char** dir; -- -- dirnames[0] = globalstate->home; -+ -+ -+ /* Make sure rcinfo.rchome is defined */ -+ ncrc_setrchome(); -+ -+ dirnames[0] = globalstate->rcinfo.rchome; - dirnames[1] = globalstate->cwd; - dirnames[2] = NULL; - -diff --git a/libdispatch/dutil.c b/libdispatch/dutil.c -index 1c42abcd..48c17763 100644 ---- a/libdispatch/dutil.c -+++ b/libdispatch/dutil.c -@@ -257,6 +257,8 @@ NC_writefile(const char* filename, size_t size, void* content) - void* p; - size_t remain; - -+ if(content == NULL) {content = ""; size = 0;} -+ - #ifdef _WIN32 - stream = NCfopen(filename,"wb"); - #else -@@ -346,7 +348,8 @@ done: - return found; - } - --#ifdef __APPLE__ -+#if ! defined __INTEL_COMPILER -+#if defined __APPLE__ - int isinf(double x) - { - union { unsigned long long u; double f; } ieee754; -@@ -364,4 +367,6 @@ int isnan(double x) - } - - #endif /*APPLE*/ -+#endif /*!_INTEL_COMPILER*/ -+ - -diff --git a/libsrc/memio.c b/libsrc/memio.c -index 3695682b..dd7745ca 100644 ---- a/libsrc/memio.c -+++ b/libsrc/memio.c -@@ -28,6 +28,8 @@ - #include "nc3internal.h" - #include "netcdf_mem.h" - #include "ncpathmgr.h" -+#include "ncrc.h" -+#include "ncbytes.h" - - #undef DEBUG - -@@ -704,48 +706,16 @@ readfile(const char* path, NC_memio* memio) - { - int status = NC_NOERR; - FILE* f = NULL; -- size_t filesize = 0; -- size_t count = 0; -- char* memory = NULL; -- char* p = NULL; -- -- /* Open the file for reading */ --#ifdef _MSC_VER -- f = NCfopen(path,"rb"); --#else -- f = NCfopen(path,"r"); --#endif -- if(f == NULL) -- {status = errno; goto done;} -- /* get current filesize */ -- if(fseek(f,0,SEEK_END) < 0) -- {status = errno; goto done;} -- filesize = (size_t)ftell(f); -- /* allocate memory */ -- memory = malloc((size_t)filesize); -- if(memory == NULL) -- {status = NC_ENOMEM; goto done;} -- /* move pointer back to beginning of file */ -- rewind(f); -- count = filesize; -- p = memory; -- while(count > 0) { -- size_t actual; -- actual = fread(p,1,count,f); -- if(actual == 0 || ferror(f)) -- {status = NC_EIO; goto done;} -- count -= actual; -- p += actual; -- } -+ NCbytes* buf = ncbytesnew(); -+ -+ if((status = NC_readfile(path,buf))) goto done; - if(memio) { -- memio->size = (size_t)filesize; -- memio->memory = memory; -- memory = NULL; -+ memio->size = ncbyteslength(buf); -+ memio->memory = ncbytesextract(buf); - } - - done: -- if(memory != NULL) -- free(memory); -+ ncbytesfree(buf); - if(f != NULL) fclose(f); - return status; - } -@@ -755,30 +725,10 @@ static int - writefile(const char* path, NCMEMIO* memio) - { - int status = NC_NOERR; -- FILE* f = NULL; -- size_t count = 0; -- char* p = NULL; - -- /* Open/create the file for writing*/ --#ifdef _MSC_VER -- f = NCfopen(path,"wb"); --#else -- f = NCfopen(path,"w"); --#endif -- if(f == NULL) -- {status = errno; goto done;} -- rewind(f); -- count = memio->size; -- p = memio->memory; -- while(count > 0) { -- size_t actual; -- actual = fwrite(p,1,count,f); -- if(actual == 0 || ferror(f)) -- {status = NC_EIO; goto done;} -- count -= actual; -- p += actual; -+ if(memio) { -+ if((status = NC_writefile(path,memio->size,memio->memory))) goto done; - } - done: -- if(f != NULL) fclose(f); - return status; - } -diff --git a/ncdump/CMakeLists.txt b/ncdump/CMakeLists.txt -index 4ef660d1..81c6fc39 100644 ---- a/ncdump/CMakeLists.txt -+++ b/ncdump/CMakeLists.txt -@@ -181,7 +181,6 @@ IF(ENABLE_TESTS) - add_sh_test(ncdump tst_64bit) - add_bin_test_no_prefix(ref_ctest) - add_bin_test_no_prefix(ref_ctest64) -- add_sh_test(ncdump tst_output) - add_sh_test(ncdump tst_lengths) - add_sh_test(ncdump tst_calendars) - build_bin_test_no_prefix(tst_utf8) -@@ -192,15 +191,21 @@ IF(ENABLE_TESTS) - add_sh_test(ncdump tst_hdf5_offset) - ENDIF(USE_HDF5) - -+ IF(NOT MSVC AND NOT MINGW) -+ add_sh_test(ncdump tst_output) -+ ENDIF() -+ - add_sh_test(ncdump tst_null_byte_padding) - IF(USE_STRICT_NULL_BYTE_HEADER_PADDING) - SET_TESTS_PROPERTIES(ncdump_tst_null_byte_padding PROPERTIES WILL_FAIL TRUE) - ENDIF(USE_STRICT_NULL_BYTE_HEADER_PADDING) - -- add_sh_test(ncdump tst_nccopy3) -- IF(HAVE_BASH) -- SET_TESTS_PROPERTIES(ncdump_tst_nccopy3 PROPERTIES RUN_SERIAL TRUE) -- ENDIF(HAVE_BASH) -+ IF(NOT MSVC AND NOT MINGW) -+ add_sh_test(ncdump tst_nccopy3) -+ IF(HAVE_BASH) -+ SET_TESTS_PROPERTIES(ncdump_tst_nccopy3 PROPERTIES RUN_SERIAL TRUE) -+ ENDIF(HAVE_BASH) -+ ENDIF() - - add_sh_test(ncdump tst_nccopy3_subset) - add_sh_test(ncdump tst_charfill) -@@ -248,10 +253,11 @@ IF(ENABLE_TESTS) - # formatting omits a 0. - ### - IF(EXTRA_TESTS) -- add_sh_test(ncdump run_back_comp_tests) -- IF(MSVC) -- SET_TESTS_PROPERTIES(ncdump_run_back_comp_tests PROPERTIES WILL_FAIL TRUE) -- ENDIF(MSVC) -+ IF(USE_HDF5) -+ IF(NOT MSVC AND NOT MINGW) -+ add_sh_test(ncdump run_back_comp_tests) -+ ENDIF() -+ ENDIF() - ENDIF(EXTRA_TESTS) - - # Known failure on MSVC; the number of 0's padding -@@ -264,10 +270,11 @@ IF(ENABLE_TESTS) - build_bin_test_no_prefix(tst_fillbug) - add_sh_test(ncdump_sh tst_fillbug) - -- add_sh_test(ncdump tst_netcdf4_4) -- IF(MSVC AND HAVE_BASH) -- SET_TESTS_PROPERTIES(ncdump_tst_netcdf4_4 PROPERTIES WILL_FAIL TRUE) -- ENDIF(MSVC AND HAVE_BASH) -+ IF(HAVE_BASH) -+ IF(NOT MSVC AND NOT MINGW) -+ add_sh_test(ncdump tst_netcdf4_4) -+ ENDIF() -+ ENDIF(HAVE_BASH) - - ### - # Some test reordering was required to ensure these tests -@@ -316,11 +323,11 @@ IF(ENABLE_TESTS) - IF(USE_HDF5) - IF(HAVE_BASH) - build_bin_test_no_prefix(tst_unicode) -- IF(NOT MSVC) -+ IF(NOT MSVC AND NOT MINGW) - # These tests do not work under windows - add_sh_test(ncdump test_unicode_directory) - add_sh_test(ncdump test_unicode_path) -- ENDIF(NOT MSVC) -+ ENDIF() - ENDIF(HAVE_BASH) - ENDIF(USE_HDF5) - -diff --git a/ncdump/Makefile.am b/ncdump/Makefile.am -index 8b527aa6..1d0f8d22 100644 ---- a/ncdump/Makefile.am -+++ b/ncdump/Makefile.am -@@ -72,8 +72,8 @@ bom tst_dimsizes nctrunc tst_rcmerge - - # Tests for classic and 64-bit offset files. - TESTS = tst_inttags.sh run_tests.sh tst_64bit.sh ref_ctest \ --ref_ctest64 tst_output.sh tst_lengths.sh tst_calendars.sh \ --run_utf8_tests.sh tst_nccopy3.sh tst_nccopy3_subset.sh \ -+ref_ctest64 tst_lengths.sh tst_calendars.sh \ -+run_utf8_tests.sh tst_nccopy3_subset.sh \ - tst_charfill.sh tst_iter.sh tst_formatx3.sh tst_bom.sh \ - tst_dimsizes.sh run_ncgen_tests.sh tst_ncgen4_classic.sh test_radix.sh test_rcmerge.sh - -@@ -87,10 +87,6 @@ if USE_STRICT_NULL_BYTE_HEADER_PADDING - XFAIL_TESTS += tst_null_byte_padding.sh - endif - --if ! ISCYGWIN --TESTS += test_unicode_directory.sh test_unicode_path.sh --endif -- - if LARGE_FILE_TESTS - TESTS += tst_iter.sh - endif -@@ -107,9 +103,9 @@ check_PROGRAMS += tst_vlen_demo - - # Tests for netCDF-4 behavior. - TESTS += tst_fileinfo.sh tst_hdf5_offset.sh tst_inttags4.sh \ --tst_netcdf4.sh tst_fillbug.sh tst_netcdf4_4.sh tst_nccopy4.sh \ -+tst_netcdf4.sh tst_fillbug.sh tst_nccopy4.sh \ - tst_nccopy5.sh tst_grp_spec.sh tst_mud.sh tst_h_scalar.sh tst_formatx4.sh \ --run_utf8_nc4_tests.sh run_back_comp_tests.sh run_ncgen_nc4_tests.sh \ -+run_utf8_nc4_tests.sh run_ncgen_nc4_tests.sh \ - tst_ncgen4.sh test_scope.sh - - # Record interscript dependencies so parallel builds work. -@@ -133,6 +129,16 @@ if ENABLE_CDF5 - TESTS += test_keywords.sh - endif - -+if !ISMINGW -+if !ISCYGWIN -+TESTS += tst_output.sh tst_nccopy3.sh -+TESTS += test_unicode_directory.sh test_unicode_path.sh -+if USE_HDF5 -+TESTS += run_back_comp_tests.sh tst_netcdf4_4.sh -+endif -+endif -+endif -+ - endif BUILD_TESTSETS - - # These files all have to be included with the distribution. -@@ -220,4 +226,5 @@ scope_*.nc copy_scope_*.cdl - - # Remove directories - clean-local: -- rm -fr rcmergedir -+ rm -fr rcmergedir rchome -+ -diff --git a/ncdump/ref_rcmerge1.txt b/ncdump/ref_rcmerge1.txt -index edc234b5..01468de3 100644 ---- a/ncdump/ref_rcmerge1.txt -+++ b/ncdump/ref_rcmerge1.txt -@@ -1,6 +1,6 @@ --|ncrc_home|->|ncrc| - |daprc_home|->|daprc| --|dodsrc_home|->|dodsrc| --|ncrc_local|->|ncrc| - |daprc_local|->|daprc| -+|dodsrc_home|->|dodsrc| - |dodsrc_local|->|dodsrc| -+|ncrc_home|->|ncrc| -+|ncrc_local|->|ncrc| -diff --git a/ncdump/ref_rcmerge2.txt b/ncdump/ref_rcmerge2.txt -index 6aeae129..45242449 100644 ---- a/ncdump/ref_rcmerge2.txt -+++ b/ncdump/ref_rcmerge2.txt -@@ -1,3 +1,3 @@ --|ncrc|->|ncrc| - |daprc|->|daprc| - |dodsrc|->|dodsrc| -+|ncrc|->|ncrc| -diff --git a/ncdump/ref_rcmerge3.txt b/ncdump/ref_rcmerge3.txt -index 2fd622d5..ea693b4f 100644 ---- a/ncdump/ref_rcmerge3.txt -+++ b/ncdump/ref_rcmerge3.txt -@@ -1,3 +1,3 @@ -+|daprc|->|daprc| - |ncrc|->|ncrc2| - |ncrcx|->|ncrcy| --|daprc|->|daprc| -diff --git a/ncdump/test_rcmerge.sh b/ncdump/test_rcmerge.sh -index 3f97bb0b..d1668a17 100755 ---- a/ncdump/test_rcmerge.sh -+++ b/ncdump/test_rcmerge.sh -@@ -8,13 +8,14 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi - # - # 1. Use NCRCENV_RC environment variable exclusively if defined - # 2. If NCRCENV_RC is not defined then merge the set of rc files in this order: --# 1. $HOME/.ncrc --# 2. $HOME/.daprc --# 3. $HOME/.docsrc -+# 1. $RCHOME/.ncrc -+# 2. $RCHOME/.daprc -+# 3. $RCHOME/.docsrc - # 4. $CWD/.ncrc - # 5. $CWD/.daprc - # 6. $CWD/.docsrc - # Entries in later files override any of the >earlier >files -+# RCHOME overrides HOME when searching for .rc files. - - # Since this involves a shared resource: the .rc files in current working directory, - # we need to isolate from any other test. -@@ -24,6 +25,21 @@ WD=`pwd` - cd $srcdir ; abs_srcdir=`pwd` ; cd $WD - cd $execdir ; abs_execdir=`pwd` ; cd $WD - -+#DEBUG=1 -+#TRUEHOME=1 -+ -+# Create RCHOME -+if test "x$TRUEHOME" = x1 ; then -+RCHOME="$HOME" -+else -+rm -fr rchome -+mkdir rchome -+cd rchome -+RCHOME=`pwd` -+cd .. -+export NCRCENV_HOME="$RCHOME" -+fi -+ - # Now create a special directory - # And enter it to execute tests - rm -fr rcmergedir -@@ -31,36 +47,40 @@ mkdir rcmergedir - cd rcmergedir - WD=`pwd` - --if test "x$NCAUTH_HOMETEST" != x ; then -- RCHOME=1 --fi -- --HOMERCFILES="$HOME/.ncrc $HOME/.daprc $HOME/.dodsrc" -+HOMERCFILES="$RCHOME/.ncrc $RCHOME/.daprc $RCHOME/.dodsrc" - LOCALRCFILES="$WD/.ncrc $WD/.daprc $WD/.dodsrc" - - resetrc() { -- if test "x$RCHOME" = x1 ; then -- rm -f $HOMERCFILES -- fi -+ rm -fr $HOMERCFILES - rm -f $LOCALRCFILES - unset NCRCENV_RC -+ rm -f tmpoutput.txt -+ rm -f allfiles1 allfiles2 allfiles3 -+} -+ -+union() { -+if test "x$DEBUG" = x1 ; then -+ rm -f ../allfiles$1 -+ for f in $HOMERCFILES $LOCALRCFILES; do -+ if test -f $f ; then cat $f >> ../allfiles$1 ; fi -+ done -+fi - } - - mergecase1() { - # create everything with different keys to test merge - resetrc - rm -f tmp_rcmerge.txt tmpoutput.txt -- for r in "ncrc" "daprc" "dodsrc" ; do -- if test "x$RCHOME" = x1 ; then echo "${r}_home=${r}" >> $HOME/".${r}"; fi -+ echo "for r=ncrc daprc dodsrc" -+ for r in "ncrc" "daprc" "dodsrc"; do -+ echo "${r}_home=${r}" >> $RCHOME/".${r}"; - echo "${r}_local=${r}" >> $WD/".${r}" - done; -- ${abs_execdir}/tst_rcmerge > tmpoutput.txt -- if test "x$RCHOME" = x1 ; then -- cp ${abs_srcdir}/ref_rcmerge1.txt tmp_rcmerge1.txt -- else -- sed -e '/_local/p' -e d <${abs_srcdir}/ref_rcmerge1.txt > tmp_rcmerge1.txt -- fi -- diff -b tmp_rcmerge1.txt tmpoutput.txt -+ union 1 -+ ${abs_execdir}/tst_rcmerge |sort > tmpoutput.txt -+# echo ">>merge1"; cat ${abs_srcdir}/ref_rcmerge1.txt; -+# echo "====="; cat tmpoutput.txt -+ diff -b ${abs_srcdir}/ref_rcmerge1.txt tmpoutput.txt - } - - mergecase2() { -@@ -68,10 +88,11 @@ mergecase2() { - resetrc - rm -f tmp_rcmerge.txt tmpoutput.txt - for r in "ncrc" "daprc" "dodsrc" ; do -- if test "x$RCHOME" = x1 ; then echo "${r}=${r}" >> $HOME/".${r}"; fi -+ echo "${r}=${r}" >> $RCHOME/".${r}"; - echo "${r}=${r}" >> $WD/".${r}" - done; -- ${abs_execdir}/tst_rcmerge > tmpoutput.txt -+ union 2 -+ ${abs_execdir}/tst_rcmerge |sort > tmpoutput.txt - diff -b ${abs_srcdir}/ref_rcmerge2.txt tmpoutput.txt - } - -@@ -79,20 +100,18 @@ mergecase3() { - # Test cross file overrides - resetrc - rm -f tmp_rcmerge.txt tmpoutput.txt -- if test "x$RCHOME" = x1 ; then -- echo "ncrc=ncrc1" >> $HOME/.ncrc -- echo "ncrcx=ncrcx" >> $HOME/.ncrc -- echo "ncrc=ncrc2" >> $HOME/.dodsrc -- echo "daprc=daprc" >> $HOME/.daprc -- else -- echo "ncrc=ncrc1" >> $WD/.ncrc -- echo "ncrcx=ncrcx" >> $WD/.ncrc -- echo "ncrc=ncrc2" >> $WD/.dodsrc -- echo "daprc=daprc" >> $WD/.daprc -- fi -+ echo "ncrc=ncrc1" >> $HOME/.ncrc -+ echo "ncrcx=ncrcx" >> $RCHOME/.ncrc -+ echo "ncrc=ncrc2" >> $RCHOME/.dodsrc -+ echo "daprc=daprc" >> $RCHOME/.daprc -+ echo "ncrc=ncrc1" >> $WD/.ncrc -+ echo "ncrcx=ncrcx" >> $WD/.ncrc -+ echo "ncrc=ncrc2" >> $WD/.dodsrc -+ echo "daprc=daprc" >> $WD/.daprc - echo "daprc=daprc" >> $WD/.dodsrc - echo "ncrcx=ncrcy" >> $WD/.dodsrc -- ${abs_execdir}/tst_rcmerge > tmpoutput.txt -+ union 3 -+ ${abs_execdir}/tst_rcmerge |sort -d > tmpoutput.txt - diff -b ${abs_srcdir}/ref_rcmerge3.txt tmpoutput.txt - } - -diff --git a/ncgen/ncgen.l b/ncgen/ncgen.l -index 821b0e38..81251ae5 100644 ---- a/ncgen/ncgen.l -+++ b/ncgen/ncgen.l -@@ -672,7 +672,6 @@ Return the value. - static unsigned long long - parseULL(int radix, char* text, int* failp) - { -- extern int errno; - char* endptr; - unsigned long long uint64 = 0; - -diff --git a/test_common.in b/test_common.in -index 5e36b301..e3fedc3b 100644 ---- a/test_common.in -+++ b/test_common.in -@@ -11,6 +11,7 @@ TOPBUILDDIR='@abs_top_builddir@' - FP_ISCMAKE=@ISCMAKE@ - FP_ISMSVC=@ISMSVC@ - FP_ISCYGWIN=@ISCYGWIN@ -+FP_ISMINGW=@ISMINGW@ - - # Feature flags - FEATURE_HDF5=@HAS_HDF5@ -@@ -73,6 +74,13 @@ set -e - # Allow global set -x mechanism for debugging. - if test "x$SETX" = x1 ; then set -x ; fi - -+# On MINGW, bash and other POSIX utilities use a mounted root directory, -+# but executables compiled for Windows do not recognise the mount point. -+# Here we ensure that Windows paths are used in tests of Windows executables. -+if test "x@ISMINGW@" = xyes; then -+ alias pwd='pwd -W' -+fi -+ - # We assume that TOPSRCDIR and TOPBUILDDIR are defined - # At the top of this shell script - top_srcdir="$TOPSRCDIR" -diff --git a/unit_test/tst_xcache.c b/unit_test/tst_xcache.c -index 0c61dd83..d527fcd5 100644 ---- a/unit_test/tst_xcache.c -+++ b/unit_test/tst_xcache.c -@@ -93,7 +93,7 @@ generatestrings(int n, unsigned seed) - len = rnd % MAXSTRLEN; - /* generate the characters */ - for(k=0;k ' ' && rnd < 127); - s[k] = (char)rnd; - } --- -2.25.1 - diff --git a/N/NetCDF/bundled/patches/0001-fix-for-nc_def_var_fletcher32-see-https-github.com-U.patch b/N/NetCDF/bundled/patches/0001-fix-for-nc_def_var_fletcher32-see-https-github.com-U.patch new file mode 100644 index 00000000000..f781dd3fa8b --- /dev/null +++ b/N/NetCDF/bundled/patches/0001-fix-for-nc_def_var_fletcher32-see-https-github.com-U.patch @@ -0,0 +1,26 @@ +From 88e04a2800aac7a672fae3676ec2e503ecdf6bf0 Mon Sep 17 00:00:00 2001 +From: Alexander Barth +Date: Tue, 14 Jun 2022 10:25:06 +0200 +Subject: [PATCH] fix for nc_def_var_fletcher32; see + https://github.com/Unidata/netcdf-c/issues/2401#issuecomment-1154126178 + +--- + libhdf5/hdf5var.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libhdf5/hdf5var.c b/libhdf5/hdf5var.c +index 287d5dfe..0dfd9ef8 100644 +--- a/libhdf5/hdf5var.c ++++ b/libhdf5/hdf5var.c +@@ -542,7 +542,7 @@ nc_def_var_extra(int ncid, int varid, int *shuffle, int *unused1, + } + + /* Fletcher32 checksum error protection? */ +- if (fletcher32 && fletcher32) { ++ if (fletcher32 && *fletcher32) { + retval = nc_inq_var_filter_info(ncid,varid,H5Z_FILTER_FLETCHER32,NULL,NULL); + if(!retval || retval == NC_ENOFILTER) { + if((retval = nc_def_var_filter(ncid,varid,H5Z_FILTER_FLETCHER32,0,NULL))) return retval; +-- +2.17.1 + diff --git a/N/NetCDF/bundled/patches/0002-include-getopt.h-if-available.patch b/N/NetCDF/bundled/patches/0002-include-getopt.h-if-available.patch deleted file mode 100644 index 9b23d7c6542..00000000000 --- a/N/NetCDF/bundled/patches/0002-include-getopt.h-if-available.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 86baf9cd28c20ad3589546639b44b776edef1684 Mon Sep 17 00:00:00 2001 -From: Alexander Barth -Date: Wed, 2 Mar 2022 14:24:23 +0100 -Subject: [PATCH 2/3] include getopt.h if available - ---- - ncdump/ncvalidator.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/ncdump/ncvalidator.c b/ncdump/ncvalidator.c -index dead0d03..8f275b10 100644 ---- a/ncdump/ncvalidator.c -+++ b/ncdump/ncvalidator.c -@@ -60,6 +60,9 @@ THIS SOFTWARE. - */ - - #include "config.h" -+#ifdef HAVE_GETOPT_H -+#include -+#endif - #include - #include - #include /* open() */ --- -2.25.1 - diff --git a/N/NetCDF/bundled/patches/0003-_fpclass-not-defined-on-mingw.patch b/N/NetCDF/bundled/patches/0003-_fpclass-not-defined-on-mingw.patch deleted file mode 100644 index f7aace9d11a..00000000000 --- a/N/NetCDF/bundled/patches/0003-_fpclass-not-defined-on-mingw.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b7766b6cf56c4792c29d8573c190fb84c8119b59 Mon Sep 17 00:00:00 2001 -From: Alexander Barth -Date: Wed, 2 Mar 2022 15:37:16 +0100 -Subject: [PATCH 3/3] _fpclass not defined on mingw - ---- - libnczarr/zcvt.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libnczarr/zcvt.c b/libnczarr/zcvt.c -index 374eda5b..28f5d223 100644 ---- a/libnczarr/zcvt.c -+++ b/libnczarr/zcvt.c -@@ -347,7 +347,7 @@ NCZ_stringconvert(nc_type typeid, size_t len, void* data0, NCjson** jdatap) - d = (double)(*((float*)src)); - else - d = *((double*)src); --#ifdef _WIN32 -+#ifdef _MSC_VER - switch (_fpclass(d)) { - case _FPCLASS_SNAN: case _FPCLASS_QNAN: - special = "Nan"; break; --- -2.25.1 - diff --git a/N/NetCDF/bundled/patches/0004-save-rc-in-globalstate-rcinfo.triples.patch b/N/NetCDF/bundled/patches/0004-save-rc-in-globalstate-rcinfo.triples.patch deleted file mode 100644 index ea02dd7c9b1..00000000000 --- a/N/NetCDF/bundled/patches/0004-save-rc-in-globalstate-rcinfo.triples.patch +++ /dev/null @@ -1,24 +0,0 @@ -From bdafbf13ade3d75feeed07b9190c718e092ac3f6 Mon Sep 17 00:00:00 2001 -From: Alexander Barth -Date: Fri, 13 May 2022 13:44:35 +0200 -Subject: [PATCH] save rc in globalstate->rcinfo.triples - ---- - libdispatch/drc.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libdispatch/drc.c b/libdispatch/drc.c -index 64d34bd5..d39f133a 100644 ---- a/libdispatch/drc.c -+++ b/libdispatch/drc.c -@@ -513,6 +513,7 @@ NC_rcfile_insert(const char* key, const char* value, const char* hostport) - - if(rc == NULL) { - rc = nclistnew(); -+ globalstate->rcinfo.triples = rc; - if(rc == NULL) {ret = NC_ENOMEM; goto done;} - } - triple = rclocate(key,hostport); --- -2.25.1 - diff --git a/N/NetCDF/common.jl b/N/NetCDF/common.jl index a6094cdba55..d5d0cc98d21 100644 --- a/N/NetCDF/common.jl +++ b/N/NetCDF/common.jl @@ -9,7 +9,7 @@ function configure(version_offset, min_julia_version) # So for example version 2.6.3 would become 200.600.300. name = "NetCDF" - upstream_version = v"4.8.1" + upstream_version = v"4.9.0" version = VersionNumber(upstream_version.major * 100 + version_offset.major, upstream_version.minor * 100 + version_offset.minor, upstream_version.patch * 100 + version_offset.patch) @@ -17,7 +17,7 @@ function configure(version_offset, min_julia_version) # Collection of sources required to build NetCDF sources = [ ArchiveSource("https://github.com/Unidata/netcdf-c/archive/v$(upstream_version).zip", - "e4e75523466de4187cff29784ff12755925f17e753bff0c9c46cd670ca63c6b2"), + "76fbe29d8baa37073a3e465f3a71bb063849906067f9867b24f6a6d67281281c"), DirectorySource("../bundled"), ] @@ -42,10 +42,9 @@ if [[ ${target} == *-mingw* ]]; then # unless -no-undefined is added to LDFLAGS LDFLAGS_MAKE="${LDFLAGS} ${LIBS} -no-undefined -Wl,--export-all-symbols" - # testset fails on mingw (NetCDF 4.8.1) - # libtool: link: cc -fno-strict-aliasing -o .libs/pathcvt.exe pathcvt.o -L/workspace/destdir/bin ../liblib/.libs/libnetcdf.dll.a -lhdf5-0 -lhdf5_hl-0 -lcurl-4 -lz -L/workspace/destdir/lib - # pathcvt.o:pathcvt.c:(.text+0x15c): undefined reference to `NCpathcvt' - CONFIGURE_OPTIONS="--disable-testsets" + # additional configure options from + # https://github.com/Unidata/netcdf-c/blob/5df5539576c5b2aa8f31d4b50c4f8258925589dd/.github/workflows/run_tests_win_mingw.yml#L38 + CONFIGURE_OPTIONS="--disable-plugins --disable-byterange" elif [[ "${target}" == *-apple-* ]]; then # this file is referenced by hdf.h by not installed touch ${includedir}/features.h @@ -69,7 +68,9 @@ if [[ ${target} == x86_64-linux-gnu ]]; then make check fi + make install + nc-config --all """ @@ -84,9 +85,8 @@ nc-config --all # Platform("armv7l", "linux"; libc="glibc"), Platform("aarch64", "linux"; libc="glibc"), Platform("x86_64", "macos"), - # Windows build is known to fail with HDF5 1.12.1 - #Platform("x86_64", "windows"), - #Platform("i686", "windows"), + Platform("x86_64", "windows"), + Platform("i686", "windows"), ] if min_julia_version ≥ v"1.6" push!(platforms, Platform("aarch64","macos")) @@ -98,19 +98,20 @@ nc-config --all # Dependencies that must be installed before this package can be built dependencies = [ - Dependency(PackageSpec(name="HDF5_jll"), compat="1.12.1"), + Dependency(PackageSpec(name="HDF5_jll"), compat="1.12.2"), Dependency("Zlib_jll"), + Dependency("XML2_jll"), ] jll_stdlibs = Dict( v"1.3" => [ - Dependency("LibCURL_jll", v"7.71.1"), + Dependency("LibCURL_jll"; compat = "~7.71.1"), ], v"1.6" => [ - Dependency("LibCURL_jll", v"7.73.0"), + Dependency("LibCURL_jll"; compat = "~7.73.0"), ], v"1.8" => [ - Dependency("LibCURL_jll", v"7.81.0"), + Dependency("LibCURL_jll"; compat = "~7.84.0"), ] )