From cca0f8d46ec6ad2bb9740c82f1718305b77e74ab Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 8 Oct 2019 10:27:32 -0600 Subject: [PATCH 1/4] Moved code of conduct and contributing to .github folder. --- .../CODE_OF_CONDUCT.md | 0 CONTRIBUTING.md => .github/CONTRIBUTING.md | 0 COMPILE.cmake.txt | 93 ------------------- 3 files changed, 93 deletions(-) rename CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md (100%) rename CONTRIBUTING.md => .github/CONTRIBUTING.md (100%) delete mode 100644 COMPILE.cmake.txt diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/COMPILE.cmake.txt b/COMPILE.cmake.txt deleted file mode 100644 index a8b3952440..0000000000 --- a/COMPILE.cmake.txt +++ /dev/null @@ -1,93 +0,0 @@ -************************** -Building NetCDF with CMake -************************** - -This document describes how to use CMake to configure and build the -NetCDF-C libraries across different platforms. - -************ -Introduction -************ - -We have recently introduced CMake support into the NetCDF trunk. Using -CMake, it is possible to build the NetCDF libraries natively on -Windows using Visual Studio. CMake also provides an alternative build -system to autotools. CMake works on Unix, Linux and Windows system, -and will generate files for a variety of build systems. - -- Operating System: Any/All: Unix Makefiles, CodeBlocks, Eclipse CDT -- Windows: Borland Makefiles, MSYS Makefiles, MinGW Makefiles, Visual -- Studio Projects (Versions 6+) Linux: Ninja, KDevelop3 OSX: Xcode - -************************************ -Requirements for building with CMake -************************************ - -1. NetCDF (4.2.x) with CMake support: -a) Subversion: svn co - http://svn.unidata.ucar.edu/repos/netcdf/trunk netcdf -2. CMake 2.8.8+ for your platform of choice. http://www.cmake.org - -*********** -Using CMake -*********** - -Out-of-source Builds -******************** - -The CMake build system discourages 'in-source' builds. Instead, a -build directory is created and used to contain the output of the build -process. From the command line, this may be achieved as follows: - -developer@dummy-machine:/netcdf$ mkdir build_dir -developer@dummy-machine:/netcdf$ cd build_dir -developer@dummy-machine:/netcdf/build_dir$ cmake .. - - -Compiling and Testing the NetCDF Libraries and Utilities -******************************************************** - -CMake provides different 'Generators'; these define the build system -which will be used to build the NetCDF libraries. On Unix/Linux, the -default generator is 'Unix Makefiles': - -developer@dummy-machine:/netcdf/build_dir$ cmake .. -developer@dummy-machine:/netcdf/build_dir$ make -developer@dummy-machine:/netcdf/build_dir$ make test - -On windows, the default generator is for Visual Studio based -builds. CMake is invoked the same way: C:\netcdf\build_dir>cmake .. - -The resulting project files can be opened in Visual Studio, or you -can compile from the command line using CMake as an intermediary: - -C:\netcdf\build_dir>cmake --build . - -Note: If you want to use a different generator than the default, you -would specify it with the '-G' flag. - -Common NetCDF/CMake Options -********************* - -- ENABLE_NETCDF_4 (On by Default) -- ENABLE_DAP (On by Default) -- BUILD_SHARED_LIBS (Off by Default for Windows, - On by Default for Unix/Linux) -- ENABLE_DLL (Windows Only, Off by Default) -- CMAKE_PREFIX_PATH (Specify list of - -This is just a partial list of options available. To see a full list -of options, run 'cmake -L' from the command line, or use a CMake GUI. - -To specify an option with CMake, you would use the following syntax: - -developer@dummy-machine:/netcdf/build_dir$ cmake .. -D"ENABLE_NETCDF_4=ON" - -D"BUILD_SHARED_LIBS=ON" -D"USE_HDF5=OFF" - -Additional References -********************* - -CMake is a very robust build system. For additional syntax and -options, see the CMake website, FAQ and Wiki available at -. - From d001ec8590122de8ea3fb9c46fced9e453ccdf35 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 9 Oct 2019 17:18:48 -0600 Subject: [PATCH 2/4] Removing a problematic const causing issues on OSX. --- include/ncdispatch.h | 6 +++--- libdispatch/ddispatch.c | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/ncdispatch.h b/include/ncdispatch.h index 9e064aa507..a87d8e1732 100644 --- a/include/ncdispatch.h +++ b/include/ncdispatch.h @@ -231,9 +231,9 @@ extern int NC_inq_recvar(int ncid, int varid, int* nrecdims, int* is_recdim); #endif /* Vectors of ones and zeros */ -extern const size_t NC_coord_zero[NC_MAX_VAR_DIMS]; -extern const size_t NC_coord_one[NC_MAX_VAR_DIMS]; -extern const ptrdiff_t NC_stride_one[NC_MAX_VAR_DIMS]; +extern size_t NC_coord_zero[NC_MAX_VAR_DIMS]; +extern size_t NC_coord_one[NC_MAX_VAR_DIMS]; +extern ptrdiff_t NC_stride_one[NC_MAX_VAR_DIMS]; extern int NC_initialized; diff --git a/libdispatch/ddispatch.c b/libdispatch/ddispatch.c index a9f75fbc92..21837a4367 100644 --- a/libdispatch/ddispatch.c +++ b/libdispatch/ddispatch.c @@ -27,9 +27,9 @@ See LICENSE.txt for license information. #endif /* Define vectors of zeros and ones for use with various nc_get_varX function*/ -const size_t NC_coord_zero[NC_MAX_VAR_DIMS]; -const size_t NC_coord_one[NC_MAX_VAR_DIMS]; -const ptrdiff_t NC_stride_one[NC_MAX_VAR_DIMS]; +size_t NC_coord_zero[NC_MAX_VAR_DIMS] = {0}; +size_t NC_coord_one[NC_MAX_VAR_DIMS] = {1}; +ptrdiff_t NC_stride_one[NC_MAX_VAR_DIMS] = {1}; NCRCglobalstate ncrc_globalstate; @@ -127,7 +127,7 @@ NCDISPATCH_initialize(void) /* Initialize curl if it is being used */ #if defined(ENABLE_BYTERANGE) || defined(ENABLE_DAP) || defined(ENABLE_DAP4) - { + { CURLcode cstat = curl_global_init(CURL_GLOBAL_ALL); if(cstat != CURLE_OK) status = NC_ECURL; @@ -146,4 +146,3 @@ NCDISPATCH_finalize(void) #endif return status; } - From 9b4a930bde9e67d9e411ffa38378a81752fc0e7c Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Thu, 10 Oct 2019 13:30:05 -0600 Subject: [PATCH 3/4] Restoring CMake compilation document. --- COMPILE.cmake.txt | 93 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 COMPILE.cmake.txt diff --git a/COMPILE.cmake.txt b/COMPILE.cmake.txt new file mode 100644 index 0000000000..a8b3952440 --- /dev/null +++ b/COMPILE.cmake.txt @@ -0,0 +1,93 @@ +************************** +Building NetCDF with CMake +************************** + +This document describes how to use CMake to configure and build the +NetCDF-C libraries across different platforms. + +************ +Introduction +************ + +We have recently introduced CMake support into the NetCDF trunk. Using +CMake, it is possible to build the NetCDF libraries natively on +Windows using Visual Studio. CMake also provides an alternative build +system to autotools. CMake works on Unix, Linux and Windows system, +and will generate files for a variety of build systems. + +- Operating System: Any/All: Unix Makefiles, CodeBlocks, Eclipse CDT +- Windows: Borland Makefiles, MSYS Makefiles, MinGW Makefiles, Visual +- Studio Projects (Versions 6+) Linux: Ninja, KDevelop3 OSX: Xcode + +************************************ +Requirements for building with CMake +************************************ + +1. NetCDF (4.2.x) with CMake support: +a) Subversion: svn co + http://svn.unidata.ucar.edu/repos/netcdf/trunk netcdf +2. CMake 2.8.8+ for your platform of choice. http://www.cmake.org + +*********** +Using CMake +*********** + +Out-of-source Builds +******************** + +The CMake build system discourages 'in-source' builds. Instead, a +build directory is created and used to contain the output of the build +process. From the command line, this may be achieved as follows: + +developer@dummy-machine:/netcdf$ mkdir build_dir +developer@dummy-machine:/netcdf$ cd build_dir +developer@dummy-machine:/netcdf/build_dir$ cmake .. + + +Compiling and Testing the NetCDF Libraries and Utilities +******************************************************** + +CMake provides different 'Generators'; these define the build system +which will be used to build the NetCDF libraries. On Unix/Linux, the +default generator is 'Unix Makefiles': + +developer@dummy-machine:/netcdf/build_dir$ cmake .. +developer@dummy-machine:/netcdf/build_dir$ make +developer@dummy-machine:/netcdf/build_dir$ make test + +On windows, the default generator is for Visual Studio based +builds. CMake is invoked the same way: C:\netcdf\build_dir>cmake .. + +The resulting project files can be opened in Visual Studio, or you +can compile from the command line using CMake as an intermediary: + +C:\netcdf\build_dir>cmake --build . + +Note: If you want to use a different generator than the default, you +would specify it with the '-G' flag. + +Common NetCDF/CMake Options +********************* + +- ENABLE_NETCDF_4 (On by Default) +- ENABLE_DAP (On by Default) +- BUILD_SHARED_LIBS (Off by Default for Windows, + On by Default for Unix/Linux) +- ENABLE_DLL (Windows Only, Off by Default) +- CMAKE_PREFIX_PATH (Specify list of + +This is just a partial list of options available. To see a full list +of options, run 'cmake -L' from the command line, or use a CMake GUI. + +To specify an option with CMake, you would use the following syntax: + +developer@dummy-machine:/netcdf/build_dir$ cmake .. -D"ENABLE_NETCDF_4=ON" + -D"BUILD_SHARED_LIBS=ON" -D"USE_HDF5=OFF" + +Additional References +********************* + +CMake is a very robust build system. For additional syntax and +options, see the CMake website, FAQ and Wiki available at +. + From 568c1067e3da8c74cb637bb581b2760a97da526d Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Thu, 10 Oct 2019 17:31:37 -0600 Subject: [PATCH 4/4] Updated release notes to reference https://github.com/Unidata/netcdf-c/issues/1486 --- RELEASE_NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0ec05a00b3..7b9e8a032c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release ## 4.7.2 - TBD +* [Bug Fix][Enhancement] Corrected an issue where protected memory was being written to with some pointer slight-of-hand. This has been in the code for a while, but appears to be caught by the compiler on OSX, under circumstances yet to be completely nailed down. See [GitHub #1486](https://github.com/Unidata/netcdf-c/issues/1486) for more information. * [Enhancement] [Parallel IO] Added support for parallel functions in MSVC. See [Github #1492](https://github.com/Unidata/netcdf-c/pull/1492) for more information. * [Enhancement] Added a function for changing the ncid of an open file. This function should only be used if you know what you are doing, and is meant to be used primarily with PIO integration. See [GitHub #1483](https://github.com/Unidata/netcdf-c/pull/1483) and [GitHub #1487](https://github.com/Unidata/netcdf-c/pull/1487) for more information.