From 10807379c3e9b6792b865326939bc31828cce116 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Mon, 29 Apr 2013 20:15:57 +0000 Subject: [PATCH] Merging from CMake branch in preparation for 4.3.0 release. --- CMakeLists.txt | 39 ++++++-------------------- COMPILE_CMake.txt => COMPILE.cmake.txt | 11 ++++---- Makefile.am | 2 +- RELEASE_NOTES | 6 +++- config.h.in.cmake | 4 +-- include/ncconfigure.h | 14 +++++---- oc2/oc.h | 7 +++++ oc2/ocinternal.c | 2 +- oc2/xxdr.c | 2 +- 9 files changed, 39 insertions(+), 48 deletions(-) rename COMPILE_CMake.txt => COMPILE.cmake.txt (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8990652995..d7fceda98a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,6 @@ ENABLE_MAKEDIST(cmake_config.h.in CMakeLists.txt cmake) ## End 'enable dist and distcheck' # Only necessary for Windows IF(MSVC) - INCLUDE (${CMAKE_SOURCE_DIR}/cmake/modules/windows/FindHDF5.cmake) # Supress some warnings on Windows ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) ENDIF() @@ -383,40 +382,18 @@ IF (USE_HDF5 OR ENABLE_NETCDF_4) SET(USE_HDF5 ON) SET(USE_NETCDF4 ON) - #FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) - FIND_LIBRARY(HDF5_LIB NAMES hdf5 libhdf5 hdf5dll) - FIND_LIBRARY(HDF5_HL_LIB NAMES hdf5_hl libhdf5_hl hdf5_hldll) - - IF(NOT HDF5_LIB) - MESSAGE(FATAL_ERROR "netCDF-4 support specified, but hdf5 libraries not found.") - ELSEIF(NOT HDF5_HL_LIB) - MESSAGE(FATAL_ERROR "netCDF-4 support specified, but hdf5 high-level libraries not found.") - ENDIF() - - SET(HDF5_LIBRARIES ${HDF5_LIB} ${HDF5_HL_LIB}) - FIND_PATH(HDF5_INCLUDE_DIR H5public.h) - - IF(NOT HDF5_INCLUDE_DIR) - MESSAGE(FATAL_ERROR "netCDF-4 support specified, but hdf5 include directories not found.") - ENDIF() - - MESSAGE(STATUS "Found HDF5: ${HDF5_LIB}") - MESSAGE(STATUS "Found HDF5_HL: ${HDF5_HL_LIB}") - MESSAGE(STATUS "Found HDF5 Includes: ${HDF5_INCLUDE_DIR}") - +IF(MSVC) + FIND_PACKAGE(HDF5 COMPONENTS C HL NO_MODULE REQUIRED) +ELSE() + FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED) +ENDIF() - INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS}) #Check to see if H5Z_SZIP exists in HDF5_Libraries. If so, we must use szip. IF(USE_SZIP) - #FIND_PACKAGE(SZIP) - FIND_LIBRARY(SZIP_LIBRARY NAMES szip sz libszip) - IF(NOT SZIP_LIBRARY) - MESSAGE(FATAL_ERROR "HDF5 compiled with szip, but cannot find local szip libraries.") - ELSE() - MESSAGE(STATUS "Found SZip: ${SZIP_LIBRARY}") - ENDIF() - INCLUDE_DIRECTORIES(${SZIP_INCLUDE_DIRS}) + FIND_PACKAGE(SZIP NO_MODULE) + INCLUDE_DIRECTORIES(${SZIP_INCLUDE_DIR}) ENDIF() SET(H5_USE_16_API 1) diff --git a/COMPILE_CMake.txt b/COMPILE.cmake.txt similarity index 95% rename from COMPILE_CMake.txt rename to COMPILE.cmake.txt index 299b30337d..a8b3952440 100644 --- a/COMPILE_CMake.txt +++ b/COMPILE.cmake.txt @@ -1,9 +1,11 @@ +************************** Building NetCDF with CMake ************************** This document describes how to use CMake to configure and build the NetCDF-C libraries across different platforms. +************ Introduction ************ @@ -17,7 +19,7 @@ and will generate files for a variety of build systems. - Windows: Borland Makefiles, MSYS Makefiles, MinGW Makefiles, Visual - Studio Projects (Versions 6+) Linux: Ninja, KDevelop3 OSX: Xcode - +************************************ Requirements for building with CMake ************************************ @@ -26,8 +28,7 @@ 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 *********** @@ -65,7 +66,7 @@ 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 Options +Common NetCDF/CMake Options ********************* - ENABLE_NETCDF_4 (On by Default) @@ -73,7 +74,7 @@ Common NetCDF Options - 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. diff --git a/Makefile.am b/Makefile.am index 97ca0fd0dc..ead54bcaa2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,7 @@ ACLOCAL_AMFLAGS = -I m4 # These files get added to the distribution. EXTRA_DIST = README COPYRIGHT RELEASE_NOTES INSTALL INSTALL.cmake test_prog.c \ - lib_flags.am cmake CMakeLists.txt COMPILE_CMake.txt config.h.in.cmake \ + lib_flags.am cmake CMakeLists.txt COMPILE.cmake.txt config.h.in.cmake \ config.h.in.cmake cmake_uninstall.cmake.in netcdf-config-version.cmake.in \ netcdf-config.cmake.in FixBundle.cmake.in diff --git a/RELEASE_NOTES b/RELEASE_NOTES index a31fb17e50..0a16f70dab 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -6,7 +6,11 @@ https://www.unidata.ucar.edu/jira/browse/NCF-XXX . VERSION COMMENTS ------- -------- -4.3 Released 201?-??-?? +4.3 Released 2013-04-29 + + Fixed netCDF-4 bug where odometer code for + libdap2 mishandled stride > 1. Bug reported + by Ansley Manke. [NCF-249] Fixed netCDF-4 bug where netCDF would ignore the HDF5 reference type in the file, instead diff --git a/config.h.in.cmake b/config.h.in.cmake index 25473e5be7..38b6e9d98c 100644 --- a/config.h.in.cmake +++ b/config.h.in.cmake @@ -36,7 +36,6 @@ #endif - /* Cache Size, other variables for HDF5 */ #define DEFAULT_CHUNK_SIZE ${DEFAULT_CHUNK_SIZE} #define DEFAULT_CHUNKS_IN_CACHE ${DEFAULT_CHUNKS_IN_CACHE} @@ -53,7 +52,8 @@ #endif #define PACKAGE_VERSION "${VERSION}" -#define VERSION "${VERSION}" +#cmakedefine VERSION "${VERSION}" +#cmakedefine NC_VERSION "${VERSION}" /* For HDF5 use. */ #cmakedefine H5_USE_16_API 1 diff --git a/include/ncconfigure.h b/include/ncconfigure.h index 65edcde99e..ec47935afa 100644 --- a/include/ncconfigure.h +++ b/include/ncconfigure.h @@ -22,12 +22,14 @@ defined. extern char* strdup(const char*); #endif -#if HAVE_BASETSD_H -#ifndef SSIZE_T -#include -#define ssize_t SSIZE_T -#endif -#endif +//#if HAVE_BASETSD_H +//#ifndef ssize_t +//#ifndef SSIZE_T +//#include +//#endif +//#define ssize_t SSIZE_T +//#endif +//#endif diff --git a/oc2/oc.h b/oc2/oc.h index 496c885873..c87f39e6ed 100644 --- a/oc2/oc.h +++ b/oc2/oc.h @@ -17,6 +17,13 @@ Version: 2.0 /*!\file oc.h */ +#ifndef ssize_t +#ifdef SSIZE_T +#define ssize_t SSIZE_T +#else +#define ssize_t int +#endif +#endif /*!\defgroup Definitions Constants, types, etc. @{*/ diff --git a/oc2/ocinternal.c b/oc2/ocinternal.c index d82add23a7..763dd424d2 100644 --- a/oc2/ocinternal.c +++ b/oc2/ocinternal.c @@ -584,7 +584,7 @@ ocsetcurlproperties(OCstate* state) if(state->curlflags.useragent == NULL) { size_t len = strlen(DFALTUSERAGENT) + strlen(VERSION) + 1; char* agent = (char*)malloc(len+1); - if(occopycat(agent,len,2,DFALTUSERAGENT,VERSION)) + if(occopycat(agent,len,2,DFALTUSERAGENT,VERSION)) state->curlflags.useragent = agent; } return; diff --git a/oc2/xxdr.c b/oc2/xxdr.c index a31694f7f3..026bc2de35 100644 --- a/oc2/xxdr.c +++ b/oc2/xxdr.c @@ -220,7 +220,7 @@ xxdr_free(XXDR* xdr) int xxdr_skip(XXDR* xdrs, off_t len) { - ssize_t pos; + unsigned int pos; pos = xxdr_getpos(xdrs); pos = (pos + len); if(pos < 0) pos = 0;