diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-12-08 22:58:10 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-12-08 22:58:10 (GMT) |
commit | c2f2f457d85fac34f4bfb2711abbf85766d72f01 (patch) | |
tree | 6df0538a83463c045fc52e22fdcb6d2181ef03a7 | |
parent | d486b52cf30c242f097956570f5c767c4793e179 (diff) | |
download | hdf5-c2f2f457d85fac34f4bfb2711abbf85766d72f01.zip hdf5-c2f2f457d85fac34f4bfb2711abbf85766d72f01.tar.gz hdf5-c2f2f457d85fac34f4bfb2711abbf85766d72f01.tar.bz2 |
[svn-r28541] Merge of r28538 from the trunk.
Fixes OS X compilation problems and brings some Linux symbols in
line with the Autotools when building with CMake.
Tested on: 64-bit OS X 10.11.1 El Capitan (Darwin 15.0.0)
Xcode 7.1 Apple LLVM 7.0.0 (clang-700.1.76)
-rw-r--r-- | config/cmake_ext_mod/ConfigureChecks.cmake | 33 | ||||
-rw-r--r-- | release_docs/RELEASE.txt | 18 |
2 files changed, 34 insertions, 17 deletions
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index fd502e5..c4fabf1 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -262,27 +262,23 @@ set (LINUX_LFS 0) set (HDF_EXTRA_C_FLAGS) set (HDF_EXTRA_FLAGS) if (NOT WINDOWS) - if (NOT ${HDF_PREFIX}_HAVE_SOLARIS) + # Might want to check explicitly for Linux and possibly Cygwin + # instead of checking for not Solaris or Darwin. + if (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN) # Linux Specific flags # This was originally defined as _POSIX_SOURCE which was updated to # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX # functionality so clock_gettime and CLOCK_MONOTONIC are defined - # correctly. + # correctly. This was later updated to 200112L so that + # posix_memalign() is visible for the direct VFD code on Linux + # systems. # POSIX feature information can be found in the gcc manual at: # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) - # _BSD_SOURCE deprecated in GLIBC >= 2.20 - TRY_RUN (HAVE_DEFAULT_SOURCE_RUN HAVE_DEFAULT_SOURCE_COMPILE - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_EXT_DIR}/HDFTests.c - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DHAVE_DEFAULT_SOURCE - OUTPUT_VARIABLE OUTPUT - ) - if (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN) - set (HDF_EXTRA_FLAGS -D_DEFAULT_SOURCE) - else (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN) - set (HDF_EXTRA_FLAGS -D_BSD_SOURCE) - endif (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN) + set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200112L) + + # Need to add this so that O_DIRECT is visible for the direct + # VFD on Linux systems. + set (HDF_EXTRA_C_FLAGS -D_GNU_SOURCE) option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) if (HDF_ENABLE_LARGE_FILE) @@ -293,6 +289,11 @@ if (NOT WINDOWS) CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS OUTPUT_VARIABLE OUTPUT ) + + # The LARGEFILE definitions were from the transition period + # and are probably no longer needed. The FILE_OFFSET_BITS + # check should be generalized for all POSIX systems as it + # is in the Autotools. if (TEST_LFS_WORKS_COMPILE) if (TEST_LFS_WORKS_RUN MATCHES 0) set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg}) @@ -315,7 +316,7 @@ if (NOT WINDOWS) endif (TEST_LFS_WORKS_COMPILE) endif (HDF_ENABLE_LARGE_FILE) set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS}) - endif (NOT ${HDF_PREFIX}_HAVE_SOLARIS) + endif (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN) endif (NOT WINDOWS) add_definitions (${HDF_EXTRA_FLAGS}) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a7ab46c..8a4f585 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -115,7 +115,23 @@ Bug Fixes since HDF5-1.8.16 Configuration ------------- - - None + - Updated Linux language level flags to match the Autotools and these + flags are no longer used on OS X. + + An addition to the flags simply being out of sync with the Autotools, + the Linux flags were used on OS X builds which led to symbols not being + found. Although this was non-fatal and compilation continued (implicit + definitions were used by the compiler and the symbols resolved at link + time), a large number of warnings were raised. + + Linux changes: + + * CHANGED: _POSIX_C_SOURCE (from 199605 to 200112L) + * ADDED: _GNU_SOURCE + * REMOVED: _BSD_SOURCE + * REMOVED: _DEFAULT_SOURCE + + (DER, 2015/12/08, HDFFV-9627) Library ------- |