Skip to content

Commit

Permalink
Merging from CMake branch in preparation for 4.3.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ward Fisher committed Apr 29, 2013
1 parent 920393b commit 1080737
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 48 deletions.
39 changes: 8 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 6 additions & 5 deletions COMPILE_CMake.txt → COMPILE.cmake.txt
Original file line number Diff line number Diff line change
@@ -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
************

Expand All @@ -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
************************************

Expand All @@ -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
***********

Expand Down Expand Up @@ -65,15 +66,15 @@ 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)
- 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.
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config.h.in.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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

Expand Down
14 changes: 8 additions & 6 deletions include/ncconfigure.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ defined.
extern char* strdup(const char*);
#endif

#if HAVE_BASETSD_H
#ifndef SSIZE_T
#include <BaseTsd.h>
#define ssize_t SSIZE_T
#endif
#endif
//#if HAVE_BASETSD_H
//#ifndef ssize_t
//#ifndef SSIZE_T
//#include <BaseTsd.h>
//#endif
//#define ssize_t SSIZE_T
//#endif
//#endif



Expand Down
7 changes: 7 additions & 0 deletions oc2/oc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
@{*/

Expand Down
2 changes: 1 addition & 1 deletion oc2/ocinternal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion oc2/xxdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1080737

Please sign in to comment.