Fix a number of CMake problems

This commit is contained in:
Dennis Heimbigner 2020-11-19 22:24:13 -07:00
parent a6e3a2b629
commit c25ebd7787
7 changed files with 28 additions and 13 deletions

View File

@ -1496,13 +1496,17 @@ ENDIF(SIZEOF_UINTPTR_T)
CHECK_TYPE_SIZE("__int64" SIZEOF___INT_64)
CHECK_TYPE_SIZE("int64_t" SIZEOF_INT64_T)
CHECK_TYPE_SIZE("uint64" SIZEOF_UINT64)
CHECK_TYPE_SIZE("uint64_t" SIZEOF_UINT64_T)
CHECK_TYPE_SIZE("unsigned char" SIZEOF_UCHAR)
CHECK_TYPE_SIZE("unsigned short int" SIZEOF_UNSIGNED_SHORT_INT)
CHECK_TYPE_SIZE("unsigned int" SIZEOF_UNSIGNED_INT)
CHECK_TYPE_SIZE("long long" SIZEOF_LONGLONG)
CHECK_TYPE_SIZE("unsigned long long" SIZEOF_ULONGLONG)
CHECK_TYPE_SIZE("uint64_t" SIZEOF_UINT64_T)
IF(SIZEOF_UINT64_T)
SET(HAVE_UINT64_T TRUE)
ENDIF(SIZEOF_UINT64_T)
# On windows systems, we redefine off_t as __int64
# to enable LFS. This is true on 32 and 64 bit system.s
# We must redefine SIZEOF_OFF_T to match.

View File

@ -399,7 +399,7 @@ are set when opening a binary file on Windows. */
#cmakedefine HAVE_UINT64 1
/* Define to 1 if the system has the type `uint64_t'. */
#cmakedefine HAVE_UINT64_t 1
#cmakedefine HAVE_UINT64_T 1
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1

View File

@ -66,6 +66,6 @@ extern void NCZ_freestringvec(size_t len, char** vec);
extern int NCZ_create_fill_chunk(size64_t chunksize, size_t typesize, void* fill, void** fillchunkp);
/* zwalk.c */
extern int NCZ_read_chunk(int ncid, int varid, size64_t* zindices, void* chunkdata);
EXTERNL int NCZ_read_chunk(int ncid, int varid, size64_t* zindices, void* chunkdata);
#endif /*ZARR_H*/

View File

@ -563,7 +563,7 @@ done:
}
/* Debugging Interface: return the contents of a specified chunk */
int
EXTERNL int
NCZ_read_chunk(int ncid, int varid, size64_t* zindices, void* chunkdata)
{
int stat = NC_NOERR;

View File

@ -13,12 +13,14 @@ SET(ncdump_FILES ncdump.c vardata.c dumplib.c indent.c nctime0.c utils.c nciter.
SET(nccopy_FILES nccopy.c nciter.c chunkspec.c utils.c dimmap.c list.c)
SET(ocprint_FILES ocprint.c)
SET(ncvalidator_FILES ncvalidator.c)
SET(ncdumpchunks_FILES ncdumpchunks.c)
IF(USE_X_GETOPT)
SET(ncdump_FILES ${ncdump_FILES} XGetopt.c)
SET(nccopy_FILES ${nccopy_FILES} XGetopt.c)
SET(ocprint_FILES ${ocprint_FILES} XGetopt.c)
SET(ncvalidator_FILES ${ncvalidator_FILES} XGetopt.c)
SET(ncdumpchunks_FILES ${ncdumpchunks_FILES} XGetopt.c)
ENDIF()
ADD_EXECUTABLE(ncdump ${ncdump_FILES})
@ -32,8 +34,8 @@ ENDIF(USE_HDF5)
# Given a netcdf4 file, dump the actual chunk contents.
# Used to validate nczarr chunking code.
IF(USE_HDF5 OR ENABLE_NCZARR)
SET(ncdumpchunks_FILES ncdumpchunks.c)
ADD_EXECUTABLE(ncdumpchunks ${ncdumpchunks_FILES})
TARGET_INCLUDE_DIRECTORIES(ncdumpchunks PUBLIC ../libnczarr)
TARGET_LINK_LIBRARIES(ncdumpchunks netcdf ${ALL_TLL_LIBS})
SET_TARGET_PROPERTIES(ncdumpchunks PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR})
@ -41,11 +43,11 @@ IF(USE_HDF5 OR ENABLE_NCZARR)
${CMAKE_CURRENT_BINARY_DIR})
SET_TARGET_PROPERTIES(ncdumpchunks PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE
${CMAKE_CURRENT_BINARY_DIR})
IF(MSVC)
SET_TARGET_PROPERTIES(ncdumpchunks
PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
)
ENDIF(MSVC)
#IF(MSVC)
# SET_TARGET_PROPERTIES(ncdumpchunks
# PROPERTIES LINK_FLAGS_DEBUG " /NODEFAULTLIB:MSVCRT"
# )
#ENDIF(MSVC)
ENDIF(USE_HDF5 OR ENABLE_NCZARR)
IF(ENABLE_DAP)

View File

@ -1,12 +1,19 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef _WIN32
#include "XGetopt.h"
#endif
#include "netcdf.h"
#ifdef HAVE_HDF5_H
#include <hdf5.h>

View File

@ -3,7 +3,9 @@
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>