diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/ConfigureChecks.cmake | 74 | ||||
-rw-r--r-- | config/cmake/ConversionTests.c | 12 | ||||
-rw-r--r-- | config/cmake/H5cxx_config.h.in | 2 | ||||
-rw-r--r-- | config/cmake/H5pubconf.h.in | 61 | ||||
-rw-r--r-- | config/cmake/HDF5Macros.cmake | 20 | ||||
-rw-r--r-- | config/cmake/HDF5UseFortran.cmake | 77 | ||||
-rw-r--r-- | config/cmake/HDFCompilerFlags.cmake | 55 | ||||
-rw-r--r-- | config/cmake/README.txt.cmake.in | 5 | ||||
-rw-r--r-- | config/cmake/UseJava.cmake | 18 | ||||
-rw-r--r-- | config/cmake/hdf5-config.cmake.in | 4 | ||||
-rw-r--r-- | config/cmake/libhdf5.settings.cmake.in | 36 | ||||
-rwxr-xr-x | config/cmake/scripts/HDF5config.cmake | 4 | ||||
-rwxr-xr-x | config/cmake/scripts/HDF5options.cmake | 3 | ||||
-rw-r--r-- | config/cmake_ext_mod/ConfigureChecks.cmake | 88 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFMacros.cmake | 40 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFTests.c | 6 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFUseCXX.cmake | 109 | ||||
-rw-r--r-- | config/cmake_ext_mod/HDFUseFortran.cmake | 23 | ||||
-rw-r--r-- | config/gnu-flags | 14 | ||||
-rw-r--r-- | config/lt_vers.am | 20 |
20 files changed, 341 insertions, 330 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 7d73c09..6d1e3ce 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -16,7 +16,7 @@ set (HDF_PREFIX "H5") include (${HDF_RESOURCES_EXT_DIR}/ConfigureChecks.cmake) if (HDF5_ENABLE_USING_MEMCHECKER) - set (H5_USING_MEMCHECKER 1) + set (${HDF_PREFIX}_USING_MEMCHECKER 1) endif () #----------------------------------------------------------------------------- @@ -24,7 +24,7 @@ endif () #----------------------------------------------------------------------------- option (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) if (HDF5_STRICT_FORMAT_CHECKS) - set (H5_STRICT_FORMAT_CHECKS 1) + set (${HDF_PREFIX}_STRICT_FORMAT_CHECKS 1) endif () MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) @@ -33,7 +33,7 @@ MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS) #----------------------------------------------------------------------------- option (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF) if (HDF5_METADATA_TRACE_FILE) - set (H5_METADATA_TRACE_FILE 1) + set (${HDF_PREFIX}_METADATA_TRACE_FILE 1) endif () MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) @@ -45,7 +45,7 @@ MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE) # option (HDF5_WANT_DATA_ACCURACY "IF data accuracy is guaranteed during data conversions" ON) if (HDF5_WANT_DATA_ACCURACY) - set (H5_WANT_DATA_ACCURACY 1) + set (${HDF_PREFIX}_WANT_DATA_ACCURACY 1) endif () MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) @@ -57,7 +57,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY) # option (HDF5_WANT_DCONV_EXCEPTION "exception handling functions is checked during data conversions" ON) if (HDF5_WANT_DCONV_EXCEPTION) - set (H5_WANT_DCONV_EXCEPTION 1) + set (${HDF_PREFIX}_WANT_DCONV_EXCEPTION 1) endif () MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) @@ -66,7 +66,7 @@ MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION) # option (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF) if (HDF5_ENABLE_CODESTACK) - set (H5_HAVE_CODESTACK 1) + set (${HDF_PREFIX}_HAVE_CODESTACK 1) endif () MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK) @@ -79,36 +79,36 @@ if (HDF5_ENABLE_HSIZET) endif () # so far we have no check for this -set (H5_HAVE_TMPFILE 1) +set (${HDF_PREFIX}_HAVE_TMPFILE 1) # TODO -------------------------------------------------------------------------- # Should the Default Virtual File Driver be compiled? # This is hard-coded now but option should added to match configure # -set (H5_DEFAULT_VFD H5FD_SEC2) +set (${HDF_PREFIX}_DEFAULT_VFD H5FD_SEC2) -if (NOT DEFINED "H5_DEFAULT_PLUGINDIR") +if (NOT DEFINED "${HDF_PREFIX}_DEFAULT_PLUGINDIR") if (WINDOWS) - set (H5_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%\\\\hdf5\\\\lib\\\\plugin") + set (${HDF_PREFIX}_DEFAULT_PLUGINDIR "%ALLUSERSPROFILE%\\\\hdf5\\\\lib\\\\plugin") else () - set (H5_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin") + set (${HDF_PREFIX}_DEFAULT_PLUGINDIR "/usr/local/hdf5/lib/plugin") endif () endif () if (WINDOWS) - set (H5_HAVE_WINDOWS 1) + set (${HDF_PREFIX}_HAVE_WINDOWS 1) # ---------------------------------------------------------------------- # Set the flag to indicate that the machine has window style pathname, # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). # (This flag should be _unset_ for all machines, except for Windows) - set (H5_HAVE_WINDOW_PATH 1) + set (${HDF_PREFIX}_HAVE_WINDOW_PATH 1) endif () # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values # ---------------------------------------------------------------------- -CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) +CHECK_FUNCTION_EXISTS (difftime ${HDF_PREFIX}_HAVE_DIFFTIME) # Find the library containing clock_gettime() if (NOT WINDOWS) @@ -116,12 +116,12 @@ if (NOT WINDOWS) CHECK_LIBRARY_EXISTS (rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) if (CLOCK_GETTIME_IN_LIBC) - set (H5_HAVE_CLOCK_GETTIME 1) + set (${HDF_PREFIX}_HAVE_CLOCK_GETTIME 1) elseif (CLOCK_GETTIME_IN_LIBRT) - set (H5_HAVE_CLOCK_GETTIME 1) + set (${HDF_PREFIX}_HAVE_CLOCK_GETTIME 1) list (APPEND LINK_LIBS rt) elseif (CLOCK_GETTIME_IN_LIBPOSIX4) - set (H5_HAVE_CLOCK_GETTIME 1) + set (${HDF_PREFIX}_HAVE_CLOCK_GETTIME 1) list (APPEND LINK_LIBS posix4) endif () endif () @@ -167,12 +167,17 @@ endif () # Check if C has __float128 extension #----------------------------------------------------------------------------- -CHECK_TYPE_SIZE("__float128" SIZEOF___FLOAT128) -if (${HAVE_SIZEOF___FLOAT128}) - set (H5_HAVE_FLOAT128 1) +CHECK_TYPE_SIZE("__float128" ${HDF_PREFIX}_SIZEOF___FLOAT128) +if (${${HDF_PREFIX}_SIZEOF___FLOAT128}) + set (${HDF_PREFIX}_HAVE_FLOAT128 1) else () - set (H5_HAVE_FLOAT128 0) - set (SIZEOF___FLOAT128 0) + set (${HDF_PREFIX}_HAVE_FLOAT128 0) + set (${HDF_PREFIX}_SIZEOF___FLOAT128 0) +endif () + +CHECK_TYPE_SIZE("_Quad" ${HDF_PREFIX}_SIZEOF__QUAD) +if (NOT ${${HDF_PREFIX}_SIZEOF__QUAD}) + set (${HDF_PREFIX}_SIZEOF__QUAD 0) endif () #----------------------------------------------------------------------------- @@ -222,7 +227,7 @@ endmacro () # The machine's conversion gets the correct value. We define the macro and disable # this kind of test until we figure out what algorithm they use. # -H5ConversionTests (H5_LDOUBLE_TO_LONG_SPECIAL "Checking IF your system converts long double to (unsigned) long values with special algorithm") +H5ConversionTests (${HDF_PREFIX}_LDOUBLE_TO_LONG_SPECIAL "Checking IF your system converts long double to (unsigned) long values with special algorithm") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine is using a special algorithm # to convert some values of '(unsigned) long' to 'long double' values. @@ -231,7 +236,7 @@ H5ConversionTests (H5_LDOUBLE_TO_LONG_SPECIAL "Checking IF your system converts # ..., 7fffff..., the compiler uses a unknown algorithm. We define a # macro and skip the test for now until we know about the algorithm. # -H5ConversionTests (H5_LONG_TO_LDOUBLE_SPECIAL "Checking IF your system can convert (unsigned) long to long double values with special algorithm") +H5ConversionTests (${HDF_PREFIX}_LONG_TO_LDOUBLE_SPECIAL "Checking IF your system can convert (unsigned) long to long double values with special algorithm") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert # 'long double' to '(unsigned) long long' values. (This flag should be set for @@ -241,7 +246,7 @@ H5ConversionTests (H5_LONG_TO_LDOUBLE_SPECIAL "Checking IF your system can conve # 0x4351ccf385ebc8a0dfcc... or 0x4351ccf385ebc8a0ffcc... will make the converted # values wildly wrong. This test detects this wrong behavior and disable the test. # -H5ConversionTests (H5_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly converting long double to (unsigned) long long values") +H5ConversionTests (${HDF_PREFIX}_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly converting long double to (unsigned) long long values") # ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert # '(unsigned) long long' to 'long double' values. (This flag should be set for @@ -249,23 +254,8 @@ H5ConversionTests (H5_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly convertin # 007fff..., 00ffff..., 01ffff..., ..., 7fffff..., the converted values are twice # as big as they should be. # -H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") +H5ConversionTests (${HDF_PREFIX}_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") # ---------------------------------------------------------------------- # Check if pointer alignments are enforced # -H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") - -# ----------------------------------------------------------------------- -# wrapper script variables -# -set (prefix ${CMAKE_INSTALL_PREFIX}) -set (exec_prefix "\${prefix}") -set (libdir "${exec_prefix}/lib") -set (includedir "\${prefix}/include") -set (host_os ${CMAKE_HOST_SYSTEM_NAME}) -set (CC ${CMAKE_C_COMPILER}) -set (CXX ${CMAKE_CXX_COMPILER}) -set (FC ${CMAKE_Fortran_COMPILER}) -foreach (LINK_LIB ${LINK_LIBS}) - set (LIBS "${LIBS} -l${LINK_LIB}") -endforeach () +H5ConversionTests (${HDF_PREFIX}_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c index 002bc88..321d879 100644 --- a/config/cmake/ConversionTests.c +++ b/config/cmake/ConversionTests.c @@ -25,7 +25,7 @@ #include <string.h> #include <stdlib.h> -int main(void) HDF_NO_UBSAN +int HDF_NO_UBSAN main(void) { long double ld = 20041683600089727.779961L; long ll; @@ -86,7 +86,7 @@ done: #include <string.h> #include <stdlib.h> -int main(void) HDF_NO_UBSAN +int HDF_NO_UBSAN main(void) { long double ld; long ll; @@ -149,7 +149,7 @@ done: #include <string.h> #include <stdlib.h> -int main(void) HDF_NO_UBSAN +int HDF_NO_UBSAN main(void) { long double ld = 20041683600089727.779961L; long long ll; @@ -192,7 +192,7 @@ done: #include <string.h> #include <stdlib.h> -int main(void) HDF_NO_UBSAN +int HDF_NO_UBSAN main(void) { long double ld; long long ll; @@ -253,8 +253,8 @@ int FC_DUMMY_MAIN() { return 1;} #endif #endif -int -main () HDF_NO_UBSAN +int HDF_NO_UBSAN +main () { char *chp = "beefs"; diff --git a/config/cmake/H5cxx_config.h.in b/config/cmake/H5cxx_config.h.in index 82e85c6..d1dd42b 100644 --- a/config/cmake/H5cxx_config.h.in +++ b/config/cmake/H5cxx_config.h.in @@ -12,5 +12,5 @@ /* src/H5cxx_config.h.in Created manually. */ /* Define if offsetof extension is present */ -#cmakedefine HAVE_OFFSETOF ${HAVE_OFFSETOF} +#cmakedefine H5_HAVE_OFFSETOF ${H5_HAVE_OFFSETOF} diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 8c01dba..1d73bba 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -30,7 +30,7 @@ #cmakedefine H5_AC_APPLE_UNIVERSAL_BUILD @H5_AC_APPLE_UNIVERSAL_BUILD@ /* Define if C++ compiler recognizes offsetof */ -#cmakedefine H5_CXX_HAVE_OFFSETOF @H5_CXX_HAVE_OFFSETOF@ +#cmakedefine H5_CXX_HAVE_OFFSETOF @CXX_HAVE_OFFSETOF@ /* Define the default plugins path to compile */ #cmakedefine H5_DEFAULT_PLUGINDIR "@H5_DEFAULT_PLUGINDIR@" @@ -53,10 +53,10 @@ #define @H5_FC_FUNC_@ /* Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE */ -#cmakedefine H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ +#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@ /* Define if we have Fortran C_LONG_DOUBLE */ -#cmakedefine H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@ +#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@ /* Define if we have Fortran intrinsic C_SIZEOF */ #cmakedefine H5_FORTRAN_HAVE_C_SIZEOF @H5_FORTRAN_HAVE_C_SIZEOF@ @@ -71,10 +71,10 @@ #cmakedefine H5_FORTRAN_SIZEOF_LONG_DOUBLE @H5_FORTRAN_SIZEOF_LONG_DOUBLE@ /* Define Fortran compiler ID */ -#cmakedefine H5_Fortran_COMPILER_ID @H5_Fortran_COMPILER_ID@ +#define H5_Fortran_COMPILER_ID @CMAKE_Fortran_COMPILER_ID@ /* Define valid Fortran INTEGER KINDs */ -#cmakedefine H5_H5CONFIG_F_IKIND @H5_HH5_H5CONFIG_F_NUM_RKIND5CONFIG_F_IKIND@ +#cmakedefine H5_H5CONFIG_F_IKIND @H5_H5CONFIG_F_IKIND@ /* Define number of valid Fortran INTEGER KINDs */ #cmakedefine H5_H5CONFIG_F_NUM_IKIND @H5_H5CONFIG_F_NUM_IKIND@ @@ -161,24 +161,12 @@ /* Define to 1 if you have the `fseeko' function. */ #cmakedefine H5_HAVE_FSEEKO @H5_HAVE_FSEEKO@ -/* Define to 1 if you have the `fseeko64' function. */ -#cmakedefine H5_HAVE_FSEEKO64 @H5_HAVE_FSEEKO64@ - -/* Define to 1 if you have the `fstat64' function. */ -#cmakedefine H5_HAVE_FSTAT64 @H5_HAVE_FSTAT64@ - -/* Define to 1 if you have the `ftello' function. */ -#cmakedefine H5_HAVE_FTELLO @H5_HAVE_FTELLO@ - -/* Define to 1 if you have the `ftello64' function. */ -#cmakedefine H5_HAVE_FTELLO64 @H5_HAVE_FTELLO64@ - -/* Define to 1 if you have the `ftruncate64' function. */ -#cmakedefine H5_HAVE_FTRUNCATE64 @H5_HAVE_FTRUNCATE64@ - /* Define if the compiler understands the __FUNCTION__ keyword */ #cmakedefine H5_HAVE_FUNCTION @H5_HAVE_FUNCTION@ +/* Determine if INTEGER*16 is available */ +#cmakedefine H5_HAVE_Fortran_INTEGER_SIZEOF_16 @H5_HAVE_Fortran_INTEGER_SIZEOF_16@ + /* Define to 1 if you have the `GetConsoleScreenBufferInfo' function. */ #cmakedefine H5_HAVE_GETCONSOLESCREENBUFFERINFO @H5_HAVE_GETCONSOLESCREENBUFFERINFO@ @@ -270,10 +258,10 @@ /* Define to 1 if you have the <mpe.h> header file. */ #cmakedefine H5_HAVE_MPE_H @H5_HAVE_MPE_H@ -/* Define if `MPI_Comm_c2f' and `MPI_Comm_f2c' exists */ +/* Define if MPI_Comm_c2f and MPI_Comm_f2c exists */ #cmakedefine H5_HAVE_MPI_MULTI_LANG_Comm @H5_HAVE_MPI_MULTI_LANG_Comm@ -/* Define if `MPI_Info_c2f' and `MPI_Info_f2c' exists */ +/* Define if MPI_Info_c2f and MPI_Info_f2c exists */ #cmakedefine H5_HAVE_MPI_MULTI_LANG_Info @H5_HAVE_MPI_MULTI_LANG_Info@ /* Define if we have parallel support */ @@ -348,22 +336,22 @@ /* Define to 1 if you have the `strdup' function. */ #cmakedefine H5_HAVE_STRDUP @H5_HAVE_STRDUP@ -/* Define to 1 if you have the `strtoll' function. */ -#cmakedefine H5_HAVE_STRTOLL @H5_HAVE_STRTOLL@ - -/* Define to 1 if you have the `strtoull' function. */ -#cmakedefine H5_HAVE_STRTOULL @H5_HAVE_STRTOULL@ - /* Define to 1 if you have the <strings.h> header file. */ #cmakedefine H5_HAVE_STRINGS_H @H5_HAVE_STRINGS_H@ /* Define to 1 if you have the <string.h> header file. */ #cmakedefine H5_HAVE_STRING_H @H5_HAVE_STRING_H@ -/* Define if `struct text_info' is defined */ +/* Define to 1 if you have the `strtoll' function. */ +#cmakedefine H5_HAVE_STRTOLL @H5_HAVE_STRTOLL@ + +/* Define to 1 if you have the `strtoull' function. */ +#cmakedefine H5_HAVE_STRTOULL @H5_HAVE_STRTOULL@ + +/* Define if struct text_info is defined */ #cmakedefine H5_HAVE_STRUCT_TEXT_INFO @H5_HAVE_STRUCT_TEXT_INFO@ -/* Define if `struct videoconfig' is defined */ +/* Define if struct videoconfig is defined */ #cmakedefine H5_HAVE_STRUCT_VIDEOCONFIG @H5_HAVE_STRUCT_VIDEOCONFIG@ /* Define to 1 if you have the `symlink' function. */ @@ -402,7 +390,7 @@ /* Define if we have thread safe support */ #cmakedefine H5_HAVE_THREADSAFE @H5_HAVE_THREADSAFE@ -/* Define if `timezone' is a global variable */ +/* Define if timezone is a global variable */ #cmakedefine H5_HAVE_TIMEZONE @H5_HAVE_TIMEZONE@ /* Define if the ioctl TIOCGETD is defined */ @@ -414,7 +402,7 @@ /* Define to 1 if you have the `tmpfile' function. */ #cmakedefine H5_HAVE_TMPFILE @H5_HAVE_TMPFILE@ -/* Define if `tm_gmtoff' is a member of `struct tm' */ +/* Define if tm_gmtoff is a member of struct tm */ #cmakedefine H5_HAVE_TM_GMTOFF @H5_HAVE_TM_GMTOFF@ /* Define to 1 if you have the <unistd.h> header file. */ @@ -435,7 +423,7 @@ /* Define if your system has window style path name. */ #cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ -/* Define to 1 if you have the <winsock.h> header file. */ +/* Define to 1 if you have the <winsock2.h> header file. */ #cmakedefine H5_HAVE_WINSOCK2_H @H5_HAVE_WINSOCK2_H@ /* Define to 1 if you have the <zlib.h> header file. */ @@ -453,7 +441,7 @@ /* Define if the compiler understands __inline__ */ #cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@ -/* Define if HDF5's high-level library headers should be included in hdf5.h */ +/* Define if the high-level library headers should be included in hdf5.h */ #cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@ /* Define if your system can convert long double to (unsigned) long long @@ -509,7 +497,7 @@ #define H5_PACKAGE_VERSION "@HDF5_PACKAGE_VERSION_STRING@" /* Determine the maximum decimal precision in C */ -#define H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@ +#cmakedefine H5_PAC_C_MAX_REAL_PRECISION @H5_PAC_C_MAX_REAL_PRECISION@ /* Define Fortran Maximum Real Decimal Precision */ #cmakedefine H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@ @@ -681,6 +669,9 @@ /* Define using v1.8 public API symbols by default */ #cmakedefine H5_USE_18_API_DEFAULT @H5_USE_18_API_DEFAULT@ +/* Define using v1.10 public API symbols by default */ +#cmakedefine H5_USE_110_API_DEFAULT @H5_USE_110_API_DEFAULT@ + /* Define if a memory checking tool will be used on the library, to cause library to be very picky about memory operations and also disable the internal free list manager code. */ diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index c3dea9a..6c203e2 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -10,25 +10,21 @@ # help@hdfgroup.org. # #------------------------------------------------------------------------------- -macro (H5_SET_LIB_OPTIONS libtarget libname libtype) +macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage) set (LIB_OUT_NAME "${libname}") # SOVERSION passed in ARGN when shared if (${libtype} MATCHES "SHARED") - if (ARGN) - set (PACKAGE_SOVERSION ${ARGN}) - else () - set (PACKAGE_SOVERSION ${H5_SOVERS_MAJOR}) - endif () + set (PACKAGE_SOVERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION}) if (WIN32) set (LIBHDF_VERSION ${HDF5_PACKAGE_VERSION_MAJOR}) else () - set (LIBHDF_VERSION ${HDF5_PACKAGE_SOVERSION}) + set (LIBHDF_VERSION ${HDF5_${libpackage}_PACKAGE_SOVERSION_MAJOR}) endif () - set_target_properties (${libtarget} PROPERTIES VERSION ${LIBHDF_VERSION}) + set_target_properties (${libtarget} PROPERTIES VERSION ${PACKAGE_SOVERSION}) if (WIN32) - set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${PACKAGE_SOVERSION}") + set (${LIB_OUT_NAME} "${LIB_OUT_NAME}-${LIBHDF_VERSION}") else () - set_target_properties (${libtarget} PROPERTIES SOVERSION ${PACKAGE_SOVERSION}) + set_target_properties (${libtarget} PROPERTIES SOVERSION ${LIBHDF_VERSION}) endif () endif () HDF_SET_LIB_OPTIONS (${libtarget} ${LIB_OUT_NAME} ${libtype}) @@ -37,8 +33,10 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype) if (APPLE) option (HDF5_BUILD_WITH_INSTALL_NAME "Build with library install_name set to the installation path" OFF) if (HDF5_BUILD_WITH_INSTALL_NAME) - set_target_properties (${libtarget} PROPERTIES + set_property(TARGET ${libtarget} APPEND PROPERTY LINK_FLAGS "-current_version ${HDF5_PACKAGE_VERSION} -compatibility_version ${HDF5_PACKAGE_VERSION}" + ) + set_target_properties (${libtarget} PROPERTIES INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib" BUILD_WITH_INSTALL_RPATH ${HDF5_BUILD_WITH_INSTALL_NAME} ) diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index 3152aaa..1f66bad 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -10,22 +10,24 @@ # help@hdfgroup.org. # +# +# This file provides functions for HDF5 specific Fortran support. +# +#------------------------------------------------------------------------------- +ENABLE_LANGUAGE (Fortran) +set (HDF_PREFIX "H5") +include (CheckFortranFunctionExists) + ## Check for non-standard extenstion quadmath.h CHECK_INCLUDE_FILES(quadmath.h C_HAVE_QUADMATH) if (${C_HAVE_QUADMATH}) - set(HAVE_QUADMATH 1) + set(${HDF_PREFIX}_HAVE_QUADMATH_H 1) else () - set(HAVE_QUADMATH 0) + set(${HDF_PREFIX}_HAVE_QUADMATH_H 0) endif () -# -# This file provides functions for HDF5 specific Fortran support. -# -#------------------------------------------------------------------------------- -ENABLE_LANGUAGE (Fortran) - # The provided CMake Fortran macros don't provide a general compile/run function # so this one is used. #----------------------------------------------------------------------------- @@ -96,9 +98,9 @@ CHECK_FORTRAN_FEATURE(c_long_double ) if (${FORTRAN_HAVE_C_LONG_DOUBLE}) - set (FORTRAN_HAVE_C_LONG_DOUBLE 1) + set (${HDF_PREFIX}_FORTRAN_HAVE_C_LONG_DOUBLE 1) else () - set (FORTRAN_HAVE_C_LONG_DOUBLE 0) + set (${HDF_PREFIX}_FORTRAN_HAVE_C_LONG_DOUBLE 0) endif () # Check to see C_LONG_DOUBLE is different from C_DOUBLE @@ -109,17 +111,17 @@ CHECK_FORTRAN_FEATURE(c_long_double FORTRAN_C_LONG_DOUBLE_IS_UNIQUE ) if (${FORTRAN_C_LONG_DOUBLE_IS_UNIQUE}) - set (FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1) + set (${HDF_PREFIX}_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 1) else () - set (FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 0) + set (${HDF_PREFIX}_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE 0) endif () ## Set the sizeof function for use later in the fortran tests -if (FORTRAN_HAVE_STORAGE_SIZE) +if (${HDF_PREFIX}_FORTRAN_HAVE_STORAGE_SIZE) set (FC_SIZEOF_A "STORAGE_SIZE(a, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") set (FC_SIZEOF_B "STORAGE_SIZE(b, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") set (FC_SIZEOF_C "STORAGE_SIZE(c, c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)") -elseif (FORTRAN_HAVE_C_SIZEOF) +elseif (${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF) set (FC_SIZEOF_A "SIZEOF(a)") set (FC_SIZEOF_B "SIZEOF(b)") set (FC_SIZEOF_C "SIZEOF(c)") @@ -151,7 +153,7 @@ string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") list (GET PROG_OUTPUT 0 pac_validIntKinds) list (GET PROG_OUTPUT 1 pac_validRealKinds) -list (GET PROG_OUTPUT 2 H5_PAC_FC_MAX_REAL_PRECISION) +list (GET PROG_OUTPUT 2 ${HDF_PREFIX}_PAC_FC_MAX_REAL_PRECISION) # If the lists are empty then something went wrong. if (NOT pac_validIntKinds) @@ -160,7 +162,7 @@ endif () if (NOT pac_validRealKinds) message (FATAL_ERROR "Failed to find available REAL KINDs for Fortran") endif () -if (NOT H5_PAC_FC_MAX_REAL_PRECISION) +if (NOT ${HDF_PREFIX}_PAC_FC_MAX_REAL_PRECISION) message (FATAL_ERROR "No output from Fortran decimal precision program") endif () @@ -172,13 +174,13 @@ list (GET PROG_OUTPUT 4 NUM_RKIND) set (PAC_FORTRAN_NUM_INTEGER_KINDS "${NUM_IKIND}") -set (H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}") -set (H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)") +set (${HDF_PREFIX}_H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}") +set (${HDF_PREFIX}_H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)") message (STATUS "....NUMBER OF INTEGER KINDS FOUND ${PAC_FORTRAN_NUM_INTEGER_KINDS}") message (STATUS "....REAL KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") -message (STATUS "....INTEGER KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}") -message (STATUS "....MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}") +message (STATUS "....INTEGER KINDS FOUND ${PAC_FC_ALL_INTEGER_KINDS}") +message (STATUS "....MAX DECIMAL PRECISION ${${HDF_PREFIX}_PAC_FC_MAX_REAL_PRECISION}") #----------------------------------------------------------------------------- # Determine the available KINDs for REALs and INTEGERs @@ -263,7 +265,7 @@ string (REGEX REPLACE ",$" "" pack_real_sizeof "${pack_real_sizeof}") #Remove spaces string (REGEX REPLACE " " "" pack_real_sizeof "${pack_real_sizeof}") -set (H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${pack_real_sizeof}/)") +set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${pack_real_sizeof}/)") message (STATUS "....FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}") @@ -336,13 +338,12 @@ if (NOT PAC_FORTRAN_NATIVE_DOUBLE_KIND) endif () -set (FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) -#set (H5_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) +set (${HDF_PREFIX}_FORTRAN_SIZEOF_LONG_DOUBLE ${${HDF_PREFIX}_SIZEOF_LONG_DOUBLE}) # remove the invalid kind from the list -if (NOT(${SIZEOF___FLOAT128} EQUAL 0)) - if (NOT(${SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) - AND NOT(${FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof}) +if (NOT(${${HDF_PREFIX}_SIZEOF___FLOAT128} EQUAL 0)) + if (NOT(${${HDF_PREFIX}_SIZEOF___FLOAT128} EQUAL ${max_real_fortran_sizeof}) + AND NOT(${${HDF_PREFIX}_FORTRAN_SIZEOF_LONG_DOUBLE} EQUAL ${max_real_fortran_sizeof}) # account for the fact that the C compiler can have 16-byte __float128 and the fortran compiler only has 8-byte doubles, # so we don't want to remove the 8-byte fortran doubles. AND NOT(${PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF} EQUAL ${max_real_fortran_sizeof})) @@ -355,15 +356,15 @@ if (NOT(${SIZEOF___FLOAT128} EQUAL 0)) endif () endif () -set (H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") +set (${HDF_PREFIX}_H5CONFIG_F_NUM_RKIND "INTEGER, PARAMETER :: num_rkinds = ${NUM_RKIND}") string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS}) string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) -set (H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR}/)") +set (${HDF_PREFIX}_H5CONFIG_F_RKIND "INTEGER, DIMENSION(1:num_rkinds) :: rkind = (/${OUT_VAR}/)") string (REGEX REPLACE "{" "" OUT_VAR ${PAC_FC_ALL_REAL_KINDS_SIZEOF}) string (REGEX REPLACE "}" "" OUT_VAR ${OUT_VAR}) -set (H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR}/)") +set (${HDF_PREFIX}_H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${OUT_VAR}/)") ENABLE_LANGUAGE (C) @@ -422,9 +423,9 @@ set (PROG_SRC " #include <float.h> #include <stdio.h> -#define CHECK_FLOAT128 ${SIZEOF___FLOAT128} +#define CHECK_FLOAT128 ${${HDF_PREFIX}_SIZEOF___FLOAT128} #if CHECK_FLOAT128!=0 -# if ${HAVE_QUADMATH}!=0 +# if ${${HDF_PREFIX}_HAVE_QUADMATH_H}!=0 #include <quadmath.h> # endif # ifdef FLT128_DIG @@ -459,19 +460,19 @@ string (REGEX REPLACE "\n" ";" PROG_OUTPUT "${PROG_OUTPUT}") list (GET PROG_OUTPUT 0 LDBL_DIG) list (GET PROG_OUTPUT 1 FLT128_DIG) -if (SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) - set (H5_HAVE_FLOAT128 0) - set (SIZEOF___FLOAT128 0) - set (H5_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG}) +if (${HDF_PREFIX}_SIZEOF___FLOAT128 EQUAL 0 OR FLT128_DIG EQUAL 0) + set (${HDF_PREFIX}_HAVE_FLOAT128 0) + set (${HDF_PREFIX}_SIZEOF___FLOAT128 0) + set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG}) else () - set(H5_PAC_C_MAX_REAL_PRECISION ${FLT128_DIG}) + set(${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${FLT128_DIG}) endif () # Setting definition if there is a 16 byte fortran integer string (FIND ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF} "16" pos) if (${pos} EQUAL -1) - set (HAVE_Fortran_INTEGER_SIZEOF_16 0) + set (${HDF_PREFIX}_HAVE_Fortran_INTEGER_SIZEOF_16 0) else () - set (HAVE_Fortran_INTEGER_SIZEOF_16 1) + set (${HDF_PREFIX}_HAVE_Fortran_INTEGER_SIZEOF_16 1) endif () diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake index 56277fa..214afa0 100644 --- a/config/cmake/HDFCompilerFlags.cmake +++ b/config/cmake/HDFCompilerFlags.cmake @@ -13,26 +13,27 @@ # Compiler specific flags : Shouldn't there be compiler tests for these #----------------------------------------------------------------------------- if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}") + if (NOT CYGWIN) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") + endif () if (${HDF_CFG_NAME} MATCHES "Debug") - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common") endif () else () - set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99") if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt") endif () endif () endif () if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (${HDF_CFG_NAME} MATCHES "Debug") - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common") endif () else () - set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}") if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt") endif () @@ -50,8 +51,10 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) set (HDF5_WARNINGS_BLOCKED 1) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0") + endif () endif () if (WIN32) add_definitions (-D_CRT_SECURE_NO_WARNINGS) @@ -65,7 +68,9 @@ if (HDF5_DISABLE_COMPILER_WARNINGS) # Most compilers use -w to suppress warnings. if (NOT HDF5_WARNINGS_BLOCKED) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endif () endif () endif () @@ -212,13 +217,17 @@ if (HDF5_ENABLE_ALL_WARNINGS) if (HDF5_ENABLE_DEV_WARNINGS) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4668") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4668") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4668") + endif () else () string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + endif () endif () else () if (CMAKE_COMPILER_IS_GNUCC) @@ -235,8 +244,10 @@ if (HDF5_ENABLE_GROUPZERO_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W1") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W1") + endif () else () if (CMAKE_COMPILER_IS_GNUCC) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic") @@ -252,8 +263,10 @@ if (HDF5_ENABLE_GROUPONE_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2") + endif () else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS1}") endif () @@ -267,8 +280,10 @@ if (HDF5_ENABLE_GROUPTWO_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + endif () else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS2}") endif () @@ -282,8 +297,10 @@ if (HDF5_ENABLE_GROUPTHREE_WARNINGS) if (MSVC) string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") - string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED) + string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") + endif () else () set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${H5_CFLAGS3}") endif () diff --git a/config/cmake/README.txt.cmake.in b/config/cmake/README.txt.cmake.in index ceeda49..be6ddc1 100644 --- a/config/cmake/README.txt.cmake.in +++ b/config/cmake/README.txt.cmake.in @@ -62,9 +62,6 @@ For more information see USING_CMake_Examples.txt in the install folder. =========================================================================== Documentation for this release can be found at the following URL: - http://www.hdfgroup.org/HDF5/doc/. - -See the HDF5 home page for further details: - http://hdfgroup.org/HDF5/ + https://portal.hdfgroup.org/display/support Bugs should be reported to help@hdfgroup.org. diff --git a/config/cmake/UseJava.cmake b/config/cmake/UseJava.cmake index 60b1758..754d742 100644 --- a/config/cmake/UseJava.cmake +++ b/config/cmake/UseJava.cmake @@ -383,7 +383,7 @@ # Create C header files from java classes. These files provide the connective glue # that allow your Java and C code to interact. # -# This command will no longer be supported starting with version 1.10 of the JDK due +# This command will no longer be supported starting with version 10 of the JDK due # to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_. # Command ``add_jar(GENERATE_NATIVE_HEADERS)`` must be used instead. # @@ -447,7 +447,7 @@ endfunction () function(__java_lcat VAR) foreach(_line ${ARGN}) - set(${VAR} "${${VAR}}${_line}\n") + string(APPEND ${VAR} "${_line}\n") endforeach() set(${VAR} "${${VAR}}" PARENT_SCOPE) @@ -528,7 +528,7 @@ function(add_jar _TARGET_NAME) if (_add_jar_GENERATE_NATIVE_HEADERS) # Raise an error if JDK version is less than 1.8 because javac -h is not supported # by earlier versions. - if ("${Java_VERSION}" VERSION_LESS 1.8) + if (Java_VERSION VERSION_LESS 1.8) message (FATAL_ERROR "ADD_JAR: GENERATE_NATIVE_HEADERS is not supported with this version of Java.") endif() cmake_parse_arguments (_add_jar_GENERATE_NATIVE_HEADERS "" "DESTINATION" "" ${_add_jar_GENERATE_NATIVE_HEADERS}) @@ -569,7 +569,7 @@ function(add_jar _TARGET_NAME) endif() foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH}) - set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") + string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") endforeach() set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") @@ -641,7 +641,7 @@ function(add_jar _TARGET_NAME) if (TARGET ${_JAVA_INCLUDE_JAR}) get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE) if (_JAVA_JAR_PATH) - set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") + string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}") list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH}) list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR}) list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR}) @@ -649,7 +649,7 @@ function(add_jar _TARGET_NAME) message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar") endif () else () - set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}") + string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_INCLUDE_JAR}") list(APPEND CMAKE_JAVA_INCLUDE_PATH "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_DEPENDS "${_JAVA_INCLUDE_JAR}") list(APPEND _JAVA_COMPILE_DEPENDS "${_JAVA_INCLUDE_JAR}") @@ -1373,10 +1373,10 @@ function(create_javadoc _target) endfunction() function (create_javah) - if ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.10) + if (Java_VERSION VERSION_GREATER_EQUAL 10) message (FATAL_ERROR "create_javah: not supported with this Java version. Use add_jar(GENERATE_NATIVE_HEADERS) instead.") - elseif ("${Java_VERSION}" VERSION_GREATER_EQUAL 1.8) - message (DEPRECATION "create_javah: this command will no longer be supported starting with version 1.10 of JDK. Update your project by using command add_jar(GENERATE_NATIVE_HEADERS) instead.") + elseif (Java_VERSION VERSION_GREATER_EQUAL 1.8) + message (DEPRECATION "create_javah: this command will no longer be supported starting with version 10 of JDK. Update your project by using command add_jar(GENERATE_NATIVE_HEADERS) instead.") endif() cmake_parse_arguments(_create_javah diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in index 574f541..e687a58 100644 --- a/config/cmake/hdf5-config.cmake.in +++ b/config/cmake/hdf5-config.cmake.in @@ -61,8 +61,8 @@ endif () if (${HDF5_PACKAGE_NAME}_BUILD_JAVA) set (${HDF5_PACKAGE_NAME}_JAVA_INCLUDE_DIRS @PACKAGE_CURRENT_BUILD_DIR@/lib/jarhdf5-@HDF5_VERSION_STRING@.jar - @PACKAGE_CURRENT_BUILD_DIR@/lib/slf4j-api-1.7.5.jar - @PACKAGE_CURRENT_BUILD_DIR@/lib/slf4j-nop-1.7.5.jar + @PACKAGE_CURRENT_BUILD_DIR@/lib/slf4j-api-1.7.25.jar + @PACKAGE_CURRENT_BUILD_DIR@/lib/slf4j-nop-1.7.25.jar ) set (${HDF5_PACKAGE_NAME}_JAVA_LIBRARY "@PACKAGE_CURRENT_BUILD_DIR@/lib") set (${HDF5_PACKAGE_NAME}_JAVA_LIBRARIES "${${HDF5_PACKAGE_NAME}_JAVA_LIBRARY}") diff --git a/config/cmake/libhdf5.settings.cmake.in b/config/cmake/libhdf5.settings.cmake.in index 891e3a7..6a489e7 100644 --- a/config/cmake/libhdf5.settings.cmake.in +++ b/config/cmake/libhdf5.settings.cmake.in @@ -64,20 +64,22 @@ Languages: Features: --------- - Parallel HDF5: @HDF5_ENABLE_PARALLEL@ - High-level library: @HDF5_BUILD_HL_LIB@ - Threadsafety: @HDF5_ENABLE_THREADSAFE@ - Default API mapping: @DEFAULT_API_VERSION@ - With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@ - I/O filters (external): @EXTERNAL_FILTERS@ - MPE: @H5_HAVE_LIBLMPE@ - Direct VFD: @H5_HAVE_DIRECT@ - dmalloc: @H5_HAVE_LIBDMALLOC@ - Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@ - API Tracing: @HDF5_ENABLE_TRACE@ - Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ -Memory allocation sanity checks: @HDF5_MEMORY_ALLOC_SANITY_CHECK@ - Metadata trace file: @METADATATRACEFILE@ - Function Stack Tracing: @HDF5_ENABLE_CODESTACK@ - Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@ - Optimization Instrumentation: @HDF5_Enable_Instrument@ + Parallel HDF5: @HDF5_ENABLE_PARALLEL@ +Parallel Filtered Dataset Writes: @PARALLEL_FILTERED_WRITES@ + Large Parallel I/O: @LARGE_PARALLEL_IO@ + High-level library: @HDF5_BUILD_HL_LIB@ + Threadsafety: @HDF5_ENABLE_THREADSAFE@ + Default API mapping: @DEFAULT_API_VERSION@ + With deprecated public symbols: @HDF5_ENABLE_DEPRECATED_SYMBOLS@ + I/O filters (external): @EXTERNAL_FILTERS@ + MPE: @H5_HAVE_LIBLMPE@ + Direct VFD: @H5_HAVE_DIRECT@ + dmalloc: @H5_HAVE_LIBDMALLOC@ + Packages w/ extra debug output: @INTERNAL_DEBUG_OUTPUT@ + API Tracing: @HDF5_ENABLE_TRACE@ + Using memory checker: @HDF5_ENABLE_USING_MEMCHECKER@ + Memory allocation sanity checks: @HDF5_MEMORY_ALLOC_SANITY_CHECK@ + Metadata trace file: @METADATATRACEFILE@ + Function Stack Tracing: @HDF5_ENABLE_CODESTACK@ + Strict File Format Checks: @HDF5_STRICT_FORMAT_CHECKS@ + Optimization Instrumentation: @HDF5_Enable_Instrument@ diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake index 4ed17dd..067e753 100755 --- a/config/cmake/scripts/HDF5config.cmake +++ b/config/cmake/scripts/HDF5config.cmake @@ -34,7 +34,7 @@ cmake_minimum_required (VERSION 3.10) # CTEST_SOURCE_NAME - source folder
##############################################################################
-set (CTEST_SOURCE_VERSION "1.10.2")
+set (CTEST_SOURCE_VERSION "1.10.3")
set (CTEST_SOURCE_VERSEXT "")
##############################################################################
@@ -184,7 +184,7 @@ set (MODEL "Experimental") ##### Following controls source update #####
#set (LOCAL_UPDATE "TRUE")
set (REPOSITORY_URL "https://git@bitbucket.hdfgroup.org/scm/hdffv/hdf5.git")
-set (REPOSITORY_BRANCH "hdf5_1_10_2")
+set (REPOSITORY_BRANCH "hdf5_1_10_3")
#uncomment to use a compressed source file: *.tar on linux or mac *.zip on windows
#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
diff --git a/config/cmake/scripts/HDF5options.cmake b/config/cmake/scripts/HDF5options.cmake index 82ab04a..c5f08ed 100755 --- a/config/cmake/scripts/HDF5options.cmake +++ b/config/cmake/scripts/HDF5options.cmake @@ -63,6 +63,9 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF") #set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF") +#### package examples #### +#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACK_EXAMPLES:BOOL=ON -DHDF5_EXAMPLES_COMPRESSED:STRING=HDF5Examples-1.10.9-Source.tar.gz -DHDF5_EXAMPLES_COMPRESSED_DIR:PATH=${CTEST_SCRIPT_DIRECTORY}") + ############################################################################################# ### disable test program builds diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake index 3797768..9be30f7 100644 --- a/config/cmake_ext_mod/ConfigureChecks.cmake +++ b/config/cmake_ext_mod/ConfigureChecks.cmake @@ -14,17 +14,12 @@ #----------------------------------------------------------------------------- include (CheckFunctionExists) include (CheckIncludeFile) -include (CheckIncludeFileCXX) include (CheckIncludeFiles) include (CheckLibraryExists) include (CheckSymbolExists) include (CheckTypeSize) include (CheckVariableExists) -include (CheckFortranFunctionExists) include (TestBigEndian) -if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED) - include (TestForSTDNamespace) -endif () #----------------------------------------------------------------------------- # APPLE/Darwin setup @@ -223,17 +218,6 @@ CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H) CHECK_INCLUDE_FILE_CONCAT ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H) CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H) -# IF the c compiler found stdint, check the C++ as well. On some systems this -# file will be found by C but not C++, only do this test IF the C++ compiler -# has been initialized (e.g. the project also includes some c++) -if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) - CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX) - if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) - set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") - set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") - endif () -endif () - # Darwin CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" ${HDF_PREFIX}_HAVE_MACH_MACH_TIME_H) @@ -331,8 +315,6 @@ if (NOT WINDOWS) endif () endif () -add_definitions (${HDF_EXTRA_FLAGS}) - #----------------------------------------------------------------------------- # Check for HAVE_OFF64_T functionality #----------------------------------------------------------------------------- @@ -340,17 +322,12 @@ if (NOT WINDOWS OR MINGW) HDF_FUNCTION_TEST (HAVE_OFF64_T) if (${HDF_PREFIX}_HAVE_OFF64_T) CHECK_FUNCTION_EXISTS (lseek64 ${HDF_PREFIX}_HAVE_LSEEK64) - CHECK_FUNCTION_EXISTS (fseeko64 ${HDF_PREFIX}_HAVE_FSEEKO64) - CHECK_FUNCTION_EXISTS (ftello64 ${HDF_PREFIX}_HAVE_FTELLO64) - CHECK_FUNCTION_EXISTS (ftruncate64 ${HDF_PREFIX}_HAVE_FTRUNCATE64) endif () CHECK_FUNCTION_EXISTS (fseeko ${HDF_PREFIX}_HAVE_FSEEKO) - CHECK_FUNCTION_EXISTS (ftello ${HDF_PREFIX}_HAVE_FTELLO) HDF_FUNCTION_TEST (HAVE_STAT64_STRUCT) if (HAVE_STAT64_STRUCT) - CHECK_FUNCTION_EXISTS (fstat64 ${HDF_PREFIX}_HAVE_FSTAT64) CHECK_FUNCTION_EXISTS (stat64 ${HDF_PREFIX}_HAVE_STAT64) endif () endif () @@ -585,71 +562,6 @@ if (NOT WINDOWS) endforeach () endif () -# For other CXX specific tests, use this MACRO. -macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) - if (NOT DEFINED ${OTHER_TEST}) - set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") - set (OTHER_TEST_ADD_LIBRARIES) - if (CMAKE_REQUIRED_LIBRARIES) - set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") - endif () - - foreach (def - HAVE_SYS_TIME_H - HAVE_UNISTD_H - HAVE_SYS_TYPES_H - HAVE_SYS_SOCKET_H - HAVE_SYS_FILE_H - ) - if ("${${HDF_PREFIX}_${def}}") - set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") - endif () - endforeach () - - if (LARGEFILE) - set (MACRO_CHECK_FUNCTION_DEFINITIONS - "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" - ) - endif () - - #message (STATUS "Performing ${OTHER_TEST}") - TRY_COMPILE (${OTHER_TEST} - ${CMAKE_BINARY_DIR} - ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} - "${OTHER_TEST_ADD_LIBRARIES}" - OUTPUT_VARIABLE OUTPUT - ) - if (${OTHER_TEST} EQUAL 0) - set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") - message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") - else () - message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") - set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") - file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" - "${OUTPUT}\n" - ) - endif () - endif () -endmacro () - -#----------------------------------------------------------------------------- -# Check a bunch of cxx functions -#----------------------------------------------------------------------------- -if (CMAKE_CXX_COMPILER_LOADED) - foreach (test - OLD_HEADER_FILENAME - ${HDF_PREFIX}_NO_NAMESPACE - ${HDF_PREFIX}_NO_STD - BOOL_NOTDEFINED - NO_STATIC_CAST - CXX_HAVE_OFFSETOF - ) - HDF_CXX_FUNCTION_TEST (${test}) - endforeach () -endif () - #----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake index 04d60e1..791fe2e 100644 --- a/config/cmake_ext_mod/HDFMacros.cmake +++ b/config/cmake_ext_mod/HDFMacros.cmake @@ -219,37 +219,15 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion) endmacro () #------------------------------------------------------------------------------- -macro (TARGET_C_PROPERTIES wintarget libtype addcompileflags addlinkflags) - if (MSVC) - TARGET_MSVC_PROPERTIES (${wintarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - else () - set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}") - endif () -endmacro () - -#------------------------------------------------------------------------------- -macro (TARGET_MSVC_PROPERTIES wintarget libtype addcompileflags addlinkflags) - if (MSVC) - set_target_properties (${wintarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "${addlinkflags}") - endif () -endmacro () - -#------------------------------------------------------------------------------- -macro (TARGET_FORTRAN_PROPERTIES forttarget libtype addcompileflags addlinkflags) - if (WIN32) - TARGET_FORTRAN_WIN_PROPERTIES (${forttarget} ${libtype} "${addcompileflags} ${WIN_COMPILE_FLAGS}" "${addlinkflags} ${WIN_LINK_FLAGS}") - endif () -endmacro () - -#------------------------------------------------------------------------------- -macro (TARGET_FORTRAN_WIN_PROPERTIES forttarget libtype addcompileflags addlinkflags) - if (MSVC) - if (${libtype} MATCHES "SHARED") - set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "/dll ${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}") - else () - set_target_properties (${forttarget} PROPERTIES COMPILE_FLAGS "${addcompileflags}" LINK_FLAGS "/SUBSYSTEM:CONSOLE ${addlinkflags}") - endif () - endif () +macro (TARGET_C_PROPERTIES wintarget libtype) + target_compile_options(${wintarget} PRIVATE + $<$<C_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}> + $<$<CXX_COMPILER_ID:MSVC>:${WIN_COMPILE_FLAGS}> + ) + target_link_libraries(${wintarget} INTERFACE + $<$<C_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}> + $<$<CXX_COMPILER_ID:MSVC>:${WIN_LINK_FLAGS}> + ) endmacro () #----------------------------------------------------------------------------- diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c index 320fd5b..0b9b530 100644 --- a/config/cmake_ext_mod/HDFTests.c +++ b/config/cmake_ext_mod/HDFTests.c @@ -180,7 +180,7 @@ SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0); #include <time.h> SIMPLE_TEST(struct tm tm; tm.__tm_gmtoff=0); -#endif /* HAVE_TM_GMTOFF */ +#endif /* HAVE_TM___GMTOFF */ #ifdef HAVE_TIMEZONE @@ -436,13 +436,13 @@ int main () SIMPLE_TEST(struct videoconfig w; w.numtextcols=0); -#endif /* HAVE_TM_GMTOFF */ +#endif /* HAVE_STRUCT_VIDEOCONFIG */ #ifdef HAVE_STRUCT_TEXT_INFO SIMPLE_TEST(struct text_info w; w.screenwidth=0); -#endif /* HAVE_TM_GMTOFF */ +#endif /* HAVE_STRUCT_TEXT_INFO */ #if defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) #ifndef __cplusplus diff --git a/config/cmake_ext_mod/HDFUseCXX.cmake b/config/cmake_ext_mod/HDFUseCXX.cmake new file mode 100644 index 0000000..f293ec5 --- /dev/null +++ b/config/cmake_ext_mod/HDFUseCXX.cmake @@ -0,0 +1,109 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# +# This file provides functions for C++ support. +# +#------------------------------------------------------------------------------- +ENABLE_LANGUAGE (CXX) +set (HDF_PREFIX "H5") + +#------------------------------------------------------------------------------- +# Fix CXX flags if we are compiling staticly on Windows using +# Windows_MT.cmake from config/cmake/UserMacros +#------------------------------------------------------------------------------- +if (BUILD_STATIC_CRT_LIBS) + TARGET_STATIC_CRT_FLAGS () +endif () + +#----------------------------------------------------------------------------- +# Configure Checks which require CXX compilation must go in here +# not in the main ConfigureChecks.cmake files, because if the user has +# no CXX compiler, problems arise. +#----------------------------------------------------------------------------- +include (CheckIncludeFileCXX) +include (TestForSTDNamespace) + +# IF the c compiler found stdint, check the C++ as well. On some systems this +# file will be found by C but not C++, only do this test IF the C++ compiler +# has been initialized (e.g. the project also includes some c++) +if (${HDF_PREFIX}_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) + CHECK_INCLUDE_FILE_CXX ("stdint.h" ${HDF_PREFIX}_HAVE_STDINT_H_CXX) + if (NOT ${HDF_PREFIX}_HAVE_STDINT_H_CXX) + set (${HDF_PREFIX}_HAVE_STDINT_H "" CACHE INTERNAL "Have includes HAVE_STDINT_H") + set (USE_INCLUDES ${USE_INCLUDES} "stdint.h") + endif () +endif () + +# For other CXX specific tests, use this MACRO. +macro (HDF_CXX_FUNCTION_TEST OTHER_TEST) + if (NOT DEFINED ${OTHER_TEST}) + set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") + set (OTHER_TEST_ADD_LIBRARIES) + if (CMAKE_REQUIRED_LIBRARIES) + set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + endif () + + foreach (def + HAVE_SYS_TIME_H + HAVE_UNISTD_H + HAVE_SYS_TYPES_H + HAVE_SYS_SOCKET_H + HAVE_SYS_FILE_H + ) + if ("${${HDF_PREFIX}_${def}}") + set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + endif () + endforeach () + + if (LARGEFILE) + set (MACRO_CHECK_FUNCTION_DEFINITIONS + "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" + ) + endif () + + #message (STATUS "Performing ${OTHER_TEST}") + TRY_COMPILE (${OTHER_TEST} + ${CMAKE_BINARY_DIR} + ${HDF_RESOURCES_EXT_DIR}/HDFCXXTests.cpp + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + "${OTHER_TEST_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + if (${OTHER_TEST} EQUAL 0) + set (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") + message (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + else () + message (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + set (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") + file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" + "${OUTPUT}\n" + ) + endif () + endif () +endmacro () + +#----------------------------------------------------------------------------- +# Check a bunch of cxx functions +#----------------------------------------------------------------------------- +if (CMAKE_CXX_COMPILER_LOADED) + foreach (test + OLD_HEADER_FILENAME + HDF_NO_NAMESPACE + HDF_NO_STD + BOOL_NOTDEFINED + NO_STATIC_CAST + CXX_HAVE_OFFSETOF + ) + HDF_CXX_FUNCTION_TEST (${test}) + endforeach () +endif () diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake index 5be2c49..f8f3cea 100644 --- a/config/cmake_ext_mod/HDFUseFortran.cmake +++ b/config/cmake_ext_mod/HDFUseFortran.cmake @@ -14,6 +14,7 @@ # #------------------------------------------------------------------------------- ENABLE_LANGUAGE (Fortran) +set (HDF_PREFIX "H5") #------------------------------------------------------------------------------- # Fix Fortran flags if we are compiling staticly on Windows using @@ -93,18 +94,18 @@ endmacro () #----------------------------------------------------------------------------- # Check for Non-standard extension intrinsic function SIZEOF -set (FORTRAN_HAVE_SIZEOF FALSE) +set (${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(sizeof " PROGRAM main i = sizeof(x) END PROGRAM " - FORTRAN_HAVE_SIZEOF + ${HDF_PREFIX}_FORTRAN_HAVE_SIZEOF ) # Check for F2008 standard intrinsic function C_SIZEOF -set (FORTRAN_HAVE_C_SIZEOF FALSE) +set (${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF FALSE) CHECK_FORTRAN_FEATURE(c_sizeof " PROGRAM main @@ -114,7 +115,7 @@ CHECK_FORTRAN_FEATURE(c_sizeof result = c_sizeof(a) END PROGRAM " - FORTRAN_HAVE_C_SIZEOF + ${HDF_PREFIX}_FORTRAN_HAVE_C_SIZEOF ) # Check for F2008 standard intrinsic function STORAGE_SIZE @@ -126,21 +127,21 @@ CHECK_FORTRAN_FEATURE(storage_size result = storage_size(a) END PROGRAM " - FORTRAN_HAVE_STORAGE_SIZE + ${HDF_PREFIX}_FORTRAN_HAVE_STORAGE_SIZE ) # Check for F2008 standard intrinsic module "ISO_FORTRAN_ENV" -set (HAVE_ISO_FORTRAN_ENV FALSE) +set (${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV FALSE) CHECK_FORTRAN_FEATURE(ISO_FORTRAN_ENV " PROGRAM main USE, INTRINSIC :: ISO_FORTRAN_ENV END PROGRAM " - HAVE_ISO_FORTRAN_ENV + ${HDF_PREFIX}_HAVE_ISO_FORTRAN_ENV ) -set (FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE) +set (${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE FALSE) CHECK_FORTRAN_FEATURE(RealIsNotDouble " MODULE type_mod @@ -164,13 +165,13 @@ CHECK_FORTRAN_FEATURE(RealIsNotDouble CALL h5t(d) END PROGRAM main " - FORTRAN_DEFAULT_REAL_NOT_DOUBLE + ${HDF_PREFIX}_FORTRAN_DEFAULT_REAL_NOT_DOUBLE ) #----------------------------------------------------------------------------- # Checks if the ISO_C_BINDING module meets all the requirements #----------------------------------------------------------------------------- -set (FORTRAN_HAVE_ISO_C_BINDING FALSE) +set (${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING FALSE) CHECK_FORTRAN_FEATURE(iso_c_binding " PROGRAM main @@ -183,7 +184,7 @@ CHECK_FORTRAN_FEATURE(iso_c_binding ptr = C_LOC(ichr(1:1)) END PROGRAM " - FORTRAN_HAVE_ISO_C_BINDING + ${HDF_PREFIX}_FORTRAN_HAVE_ISO_C_BINDING ) #----------------------------------------------------------------------------- diff --git a/config/gnu-flags b/config/gnu-flags index 2f2e428..225f072 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -84,6 +84,18 @@ case "$cc_vendor-$cc_version" in ;; esac + case "$host_os-$host_cpu" in + # cygwin needs the "-std=c99" flag removed, so make + # a specific case for Cygwin without the flag and a default + # case to add the flag everywhere else + cygwin-*) + ;; + + *) + H5_CFLAGS="$H5_CFLAGS -std=c99" + ;; + esac + # Host-specific flags case "`hostname`" in sleipnir.ncsa.uiuc.edu) @@ -101,7 +113,7 @@ case "$cc_vendor-$cc_version" in # NOTE: Don't add -Wpadded here since we can't/won't fix the (many) # warnings that are emitted. If you need it, add it from the # environment variable at configure time. - H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align" + H5_CFLAGS="$H5_CFLAGS $arch -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align" H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal" H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs" H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith" diff --git a/config/lt_vers.am b/config/lt_vers.am index 82cf35e..8b63c22 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -16,9 +16,9 @@ ## See libtool versioning documentation online. ## After making changes, run bin/reconfigure to update other configure related ## files like Makefile.in. -LT_VERS_INTERFACE = 102 +LT_VERS_INTERFACE = 103 LT_VERS_REVISION = 0 -LT_VERS_AGE = 1 +LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and ## reset LT_VERS_REVISION to 0. @@ -39,31 +39,31 @@ LT_VERS_AGE = 1 ## the effects of the H5_V1_x_COMPAT flag. ## ## Version numbers for wrapper shared library files. -LT_CXX_VERS_INTERFACE = 102 +LT_CXX_VERS_INTERFACE = 103 LT_CXX_VERS_REVISION = 0 LT_CXX_VERS_AGE = 0 LT_F_VERS_INTERFACE = 101 -LT_F_VERS_REVISION = 1 +LT_F_VERS_REVISION = 2 LT_F_VERS_AGE = 1 LT_HL_VERS_INTERFACE = 101 -LT_HL_VERS_REVISION = 0 +LT_HL_VERS_REVISION = 1 LT_HL_VERS_AGE = 1 LT_HL_CXX_VERS_INTERFACE = 101 -LT_HL_CXX_VERS_REVISION = 1 +LT_HL_CXX_VERS_REVISION = 2 LT_HL_CXX_VERS_AGE = 1 LT_HL_F_VERS_INTERFACE = 100 -LT_HL_F_VERS_REVISION = 2 +LT_HL_F_VERS_REVISION = 3 LT_HL_F_VERS_AGE = 0 -LT_JAVA_VERS_INTERFACE = 102 +LT_JAVA_VERS_INTERFACE = 103 LT_JAVA_VERS_REVISION = 0 -LT_JAVA_VERS_AGE = 2 +LT_JAVA_VERS_AGE = 3 LT_TOOLS_VERS_INTERFACE = 101 -LT_TOOLS_VERS_REVISION = 0 +LT_TOOLS_VERS_REVISION = 1 LT_TOOLS_VERS_AGE = 1 |