Skip to content

Commit 2960f56

Browse files
authored
Merge pull request #2923 from DennisHeimbigner/optionchange.dmh
Convert the ENABLE_XXX options to NETCDF_ENABLE_XXX options for NCZarr
2 parents 8d7916c + 9d8f2e2 commit 2960f56

File tree

18 files changed

+58
-30
lines changed

18 files changed

+58
-30
lines changed

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,13 @@ if(MSVC)
382382
endif()
383383

384384
# Option to build netCDF Version 2
385-
OPTION (ENABLE_V2_API "Build netCDF Version 2." ON)
386-
set(BUILD_V2 ${ENABLE_V2_API})
387-
if(NOT ENABLE_V2_API)
385+
OPTION (NETCDF_ENABLE_V2_API "Build netCDF Version 2." ON)
386+
set(BUILD_V2 ${NETCDF_ENABLE_V2_API})
387+
if(NOT NETCDF_ENABLE_V2_API)
388388
set(NO_NETCDF_2 ON)
389-
else(NOT ENABLE_V2_API)
389+
else(NOT NETCDF_ENABLE_V2_API)
390390
set(USE_NETCDF_2 TRUE)
391-
endif(NOT ENABLE_V2_API)
391+
endif(NOT NETCDF_ENABLE_V2_API)
392392

393393
# Option to build utilities
394394
option(NETCDF_BUILD_UTILITIES "Build ncgen, ncgen3, ncdump." ON)
@@ -1446,7 +1446,7 @@ endif()
14461446

14471447
# Enable tests
14481448
if(NETCDF_ENABLE_TESTS)
1449-
if(ENABLE_V2_API)
1449+
if(NETCDF_ENABLE_V2_API)
14501450
add_subdirectory(nctest)
14511451
endif()
14521452
add_subdirectory(nc_test)
@@ -1622,7 +1622,7 @@ set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BU
16221622
is_disabled(BUILD_SHARED_LIBS enable_static)
16231623
is_enabled(BUILD_SHARED_LIBS enable_shared)
16241624

1625-
is_enabled(ENABLE_V2_API HAS_NC2)
1625+
is_enabled(NETCDF_ENABLE_V2_API HAS_NC2)
16261626
is_enabled(NETCDF_ENABLE_NETCDF_4 HAS_NC4)
16271627
is_enabled(NETCDF_ENABLE_HDF4 HAS_HDF4)
16281628
is_enabled(USE_HDF5 HAS_HDF5)
@@ -1637,7 +1637,7 @@ is_enabled(NETCDF_ENABLE_BYTERANGE HAS_BYTERANGE)
16371637
is_enabled(NETCDF_ENABLE_DISKLESS HAS_DISKLESS)
16381638
is_enabled(USE_MMAP HAS_MMAP)
16391639
is_enabled(JNA HAS_JNA)
1640-
is_enabled(ENABLE_ZERO_LENGTH_COORD_BOUND RELAX_COORD_BOUND)
1640+
is_enabled(NETCDF_ENABLE_ZERO_LENGTH_COORD_BOUND RELAX_COORD_BOUND)
16411641
is_enabled(USE_CDF5 HAS_CDF5)
16421642
is_enabled(NETCDF_ENABLE_ERANGE_FILL HAS_ERANGE_FILL)
16431643
is_enabled(HDF5_HAS_PAR_FILTERS HAS_PAR_FILTERS)

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release
77

88
## 4.9.3 - TBD
99

10+
* Convert the Zarr-related ENABLE_XXX options to NETCDF_ENABLE_XXX options (part of the cmake overhaul). See [Github #2923](https://github.com/Unidata/netcdf-c/issues/2923) for more information.
1011
* Refactor macro `_FillValue` to `NC_FillValue` to avoid conflict with libc++ headers. See [Github #2858](https://github.com/Unidata/netcdf-c/issues/2858) for more information.
1112
* Changed `cmake` build options to be prefaced with `NETCDF`, to bring things in to line with best practices. This will permit a number of overall quality of life improvements to netCDF, in terms of allowing it to be more easily integrated with upstream projects via `FetchContent()`, `subdirectory()`, etc. Currently, the naming convention in use thus far will still work, but will result in warning messages about deprecation, and instructions on how to update your workflow. See [Github #2895](https://github.com/Unidata/netcdf-c/pull/2895) for more information.
1213
* Fix some problems in handling S3 urls with missing regions. See [Github #2819](https://github.com/Unidata/netcdf-c/pull/2819).

config.h.cmake.in

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ are set when opening a binary file on Windows. */
133133
/* if true, enable client side filters */
134134
#cmakedefine ENABLE_CLIENT_FILTERS 1
135135

136+
/* if true, enable filter testing */
137+
#cmakedefine NETCDF_ENABLE_FILTER_TESTING 1
138+
136139
/* if true, enable strict null byte header padding. */
137140
#cmakedefine USE_STRICT_NULL_BYTE_HEADER_PADDING 1
138141

@@ -167,7 +170,7 @@ are set when opening a binary file on Windows. */
167170
#cmakedefine NETCDF_ENABLE_S3_INTERNAL 1
168171

169172
/* if true, enable S3 testing*/
170-
#cmakedefine WITH_S3_TESTING "PUBLIC"
173+
#cmakedefine WITH_S3_TESTING "${WITH_S3_TESTING}"
171174

172175
/* S3 Test Bucket */
173176
#define S3TESTBUCKET "${S3TESTBUCKET}"
@@ -199,6 +202,9 @@ are set when opening a binary file on Windows. */
199202
/* Define to 1 if blosc library available. */
200203
#cmakedefine HAVE_BLOSC 1
201204

205+
/* if true enable tests that access external servers */
206+
#cmakedefine NETCDF_ENABLE_EXTERNAL_SERVER_TESTS 1
207+
202208
/* Define to 1 if you have hdf5_coll_metadata_ops */
203209
#cmakedefine HDF5_HAS_COLL_METADATA_OPS 1
204210

@@ -397,6 +403,9 @@ are set when opening a binary file on Windows. */
397403
/* Define to 1 if you have the `strlcpy' function. */
398404
#cmakedefine HAVE_STRLCPY 1
399405

406+
/* Define to 1 if you have the `strlen' function. */
407+
#cmakedefine HAVE_STRLEN 1
408+
400409
/* Define to 1 if you have the `strtoll' function. */
401410
#cmakedefine HAVE_STRTOLL 1
402411

@@ -487,7 +496,7 @@ with zip */
487496
#cmakedefine NETCDF_ENABLE_DOXYGEN 1
488497
#cmakedefine NETCDF_ENABLE_INTERNAL_DOCS 1
489498
#cmakedefine VALGRIND_TESTS 1
490-
#cmakedefine ENABLE_CDMREMOTE 1
499+
#cmakedefine NETCDF_ENABLE_CDMREMOTE 1
491500
#cmakedefine USE_HDF5 1
492501
#cmakedefine ENABLE_FILEINFO 1
493502
#cmakedefine TEST_PARALLEL ${TEST_PARALLEL}
@@ -570,6 +579,9 @@ with zip */
570579
/* The size of `size_t', as computed by sizeof. */
571580
#cmakedefine SIZEOF_SIZE_T ${SIZEOF_SIZE_T}
572581

582+
/* The size of `ssize_t', as computed by sizeof. */
583+
#cmakedefine SIZEOF_SSIZE_T ${SIZEOF_SSIZE_T}
584+
573585
/* The size of `uint', as computed by sizeof. */
574586
#cmakedefine SIZEOF_UINT ${SIZEOF_UINT}
575587

@@ -635,10 +647,10 @@ with zip */
635647
#cmakedefine USE_STDIO 1
636648

637649
/* if true, multi-filters enabled*/
638-
#cmakedefine ENABLE_MULTIFILTERS 1
650+
#cmakedefine NETCDF_ENABLE_MULTIFILTERS 1
639651

640652
/* if true, enable nczarr blosc support */
641-
#cmakedefine ENABLE_BLOSC 1
653+
#cmakedefine NETCDF_ENABLE_BLOSC 1
642654

643655
/* Version number of package */
644656
#cmakedefine VERSION "${netCDF_VERSION}"

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,7 @@ if test "x$enable_pnetcdf" = xyes -o "x$enable_parallel4" = xyes; then
17651765
else
17661766
enable_parallel=no
17671767
fi
1768-
AM_CONDITIONAL(ENABLE_PARALLEL, [test x$enable_parallel = xyes ])
1768+
AM_CONDITIONAL(NETCDF_ENABLE_PARALLEL, [test x$enable_parallel = xyes ])
17691769

17701770
if test "x$hdf5_parallel" = xyes; then
17711771
# Provide more precise parallel control

libdispatch/ncrandom.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
#include <stdio.h>
1414
#endif
1515

16+
#if defined(_WIN32) || defined(_MSC_VER)
17+
extern errno_t rand_s(unsigned int *randomValue);
18+
#endif
1619

1720
/* Support platform independent generation of 32-bit unsigned int random numbers */
1821

1922
int
2023
main() {
2124
unsigned int urnd = 0; /* range 0..2147483647 */
22-
#if defined(WIN32) || defined(_MSC_VER)
25+
#if defined(_WIN32) || defined(_MSC_VER)
2326
(void)rand_s(&urnd);
2427
#else
2528
long rnd;

libhdf5/hdf5filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "netcdf.h"
2121
#include "netcdf_filter.h"
2222

23-
#ifdef ENABLE_BLOSC
23+
#ifdef NETCDF_ENABLE_BLOSC
2424
#include <blosc.h>
2525
#endif
2626

libhdf5/hdf5open.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ nc4_open_file(const char *path, int mode, void* parameters, int ncid)
930930
if(H5Pset_fapl_ros3(fapl_id, &fa) < 0)
931931
BAIL(NC_EHDFERR);
932932
} else
933-
#endif /*ENABLE_ROS3*/
933+
#endif /*NETCDF_ENABLE_ROS3*/
934934
{/* Configure FAPL to use our byte-range file driver */
935935
if (H5Pset_fapl_http(fapl_id) < 0)
936936
BAIL(NC_EHDFERR);

liblib/nc_initialize.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern int NC_HDF4_initialize(void);
4242
extern int NC_HDF4_finalize(void);
4343
#endif
4444

45-
#ifdef ENABLE_S3
45+
#ifdef NETCDF_ENABLE_S3
4646
EXTERNL int NC_s3sdkinitialize(void);
4747
EXTERNL int NC_s3sdkfinalize(void);
4848
#endif
@@ -105,7 +105,7 @@ nc_initialize()
105105
#ifdef USE_HDF4
106106
if((stat = NC_HDF4_initialize())) goto done;
107107
#endif
108-
#ifdef ENABLE_S3
108+
#ifdef NETCDF_ENABLE_S3
109109
if((stat = NC_s3sdkinitialize())) goto done;
110110
#endif
111111
#ifdef NETCDF_ENABLE_NCZARR
@@ -170,7 +170,7 @@ nc_finalize(void)
170170
if((stat = NCZ_finalize())) failed = stat;
171171
#endif
172172

173-
#ifdef ENABLE_S3
173+
#ifdef NETCDF_ENABLE_S3
174174
if((stat = NC_s3sdkfinalize())) failed = stat;
175175
#endif
176176

libncpoco/cp_win32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ load(NCPSharedLib* lib , const char* path0, int flags)
104104
int errcode = GetLastError();
105105
char* msg = NULL;
106106
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
107-
NULL, errcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &msg, 0, NULL);
107+
NULL, errcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char*)&msg, 0, NULL);
108108
memset(lib->err.msg,0,sizeof(lib->err.msg));
109109
if(msg)
110110
strncpy(lib->err.msg,msg,sizeof(lib->err.msg));

libsrc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ if(HAVE_M4)
100100
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/netcdf.3" DESTINATION "${CMAKE_INSTALL_MANDIR}/man3" COMPONENT documentation)
101101
endif(NOT MSVC)
102102

103-
endif()
103+
endif()

0 commit comments

Comments
 (0)