summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-04-24 22:22:55 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-04-24 22:22:55 (GMT)
commitbc9a773b994cde788e97e5e998eb5fcd21ec8a39 (patch)
treebd36f898f393eb39c27cc654ab74fb2c43a666a4
parentb3c5284692093953132c6c8227e0980b670bf4ad (diff)
downloadhdf5-bc9a773b994cde788e97e5e998eb5fcd21ec8a39.zip
hdf5-bc9a773b994cde788e97e5e998eb5fcd21ec8a39.tar.gz
hdf5-bc9a773b994cde788e97e5e998eb5fcd21ec8a39.tar.bz2
TRILABS-20 Fix fortran configure during fix of CXX configure
-rw-r--r--CMakeLists.txt5
-rw-r--r--MANIFEST2
-rw-r--r--config/cmake/ConfigureChecks.cmake48
-rw-r--r--config/cmake/H5cxx_config.h.in2
-rw-r--r--config/cmake/H5pubconf.h.in8
-rw-r--r--config/cmake/HDF5UseFortran.cmake67
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake83
-rw-r--r--config/cmake_ext_mod/HDFTests.c6
-rw-r--r--config/cmake_ext_mod/HDFUseCXX.cmake109
-rw-r--r--config/cmake_ext_mod/HDFUseFortran.cmake23
-rw-r--r--fortran/src/CMakeLists.txt2
-rw-r--r--fortran/src/H5config_f.inc.cmake68
-rw-r--r--fortran/src/H5fort_type_defines.h.cmake28
13 files changed, 242 insertions, 209 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d3afc41..825b590 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -834,6 +834,9 @@ if (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++")
message (STATUS " **** Allowing unsupported Parallel and C++ options **** ")
endif ()
endif ()
+
+ include (${HDF_RESOURCES_EXT_DIR}/HDFUseCXX.cmake)
+
if (CMAKE_NO_STD_NAMESPACE)
set (H5_NO_STD 1)
endif ()
@@ -852,7 +855,7 @@ endif ()
# being built then configure should fail due to bug HDFFV-889.
#-----------------------------------------------------------------------------
if (HDF5_BUILD_FORTRAN AND HDF5_BUILD_HL_LIB)
- if (NOT FORTRAN_DEFAULT_REAL_NOT_DOUBLE)
+ if (NOT H5_FORTRAN_DEFAULT_REAL_NOT_DOUBLE)
message (FATAL_ERROR " **** Fortran high-level routines are not supported when the default REAL is DOUBLE PRECISION, use HDF5_BUILD_HL_LIB:BOOL=OFF **** ")
endif ()
endif ()
diff --git a/MANIFEST b/MANIFEST
index 01edd91..721baf5 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -234,6 +234,7 @@
./fortran/src/H5Zff.F90
./fortran/src/H5config_f.inc.cmake
./fortran/src/H5config_f.inc.in
+./fortran/src/H5fort_type_defines.h.cmake
./fortran/src/H5fort_type_defines.h.in
./fortran/src/H5f90.h
./fortran/src/H5f90global.F90
@@ -3140,6 +3141,7 @@
./config/cmake_ext_mod/HDFLibMacros.cmake
./config/cmake_ext_mod/HDFMacros.cmake
./config/cmake_ext_mod/HDFTests.c
+./config/cmake_ext_mod/HDFUseCXX.cmake
./config/cmake_ext_mod/HDFUseFortran.cmake
./config/cmake_ext_mod/NSIS.InstallOptions.ini.in
./config/cmake_ext_mod/NSIS.template.in
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index f61953d..0d955d0 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 ()
@@ -169,9 +169,9 @@ endif ()
CHECK_TYPE_SIZE("__float128" SIZEOF___FLOAT128)
if (${HAVE_SIZEOF___FLOAT128})
- set (H5_HAVE_FLOAT128 1)
+ set (${HDF_PREFIX}_HAVE_FLOAT128 1)
else ()
- set (H5_HAVE_FLOAT128 0)
+ set (${HDF_PREFIX}_HAVE_FLOAT128 0)
set (SIZEOF___FLOAT128 0)
endif ()
@@ -222,7 +222,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 +231,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 +241,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,8 +249,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")
+H5ConversionTests (${HDF_PREFIX}_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced")
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..e4c9a2e 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -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,7 +71,7 @@
#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@
@@ -509,7 +509,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@
diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake
index 3152aaa..0e948fe 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 1)
else ()
- set(HAVE_QUADMATH 0)
+ set(${HDF_PREFIX}_HAVE_QUADMATH 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})
+ 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)
@@ -424,7 +425,7 @@ set (PROG_SRC
#include <stdio.h>
#define CHECK_FLOAT128 ${SIZEOF___FLOAT128}
#if CHECK_FLOAT128!=0
-# if ${HAVE_QUADMATH}!=0
+# if ${${HDF_PREFIX}_HAVE_QUADMATH}!=0
#include <quadmath.h>
# endif
# ifdef FLT128_DIG
@@ -460,18 +461,18 @@ 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 (${HDF_PREFIX}_HAVE_FLOAT128 0)
set (SIZEOF___FLOAT128 0)
- set (H5_PAC_C_MAX_REAL_PRECISION ${LDBL_DIG})
+ 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_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 0153254..b0deab7 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -19,12 +19,7 @@ include (CheckLibraryExists)
include (CheckSymbolExists)
include (CheckTypeSize)
include (CheckVariableExists)
-include (CheckFortranFunctionExists)
include (TestBigEndian)
-if (CMAKE_CXX_COMPILER AND CMAKE_CXX_COMPILER_LOADED)
- include (CheckIncludeFileCXX)
- 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
#-----------------------------------------------------------------------------
@@ -585,71 +567,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/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..3afcdb6
--- /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_PREFIX}_NO_NAMESPACE
+ ${HDF_PREFIX}_NO_STD
+ BOOL_NOTDEFINED
+ NO_STATIC_CAST
+ ${HDF_PREFIX}_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/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt
index 71b7d41..fc63159 100644
--- a/fortran/src/CMakeLists.txt
+++ b/fortran/src/CMakeLists.txt
@@ -33,7 +33,7 @@ if (HAVE_FLOAT128)
endif ()
configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5config_f.inc.cmake ${HDF5_F90_BINARY_DIR}/H5config_f.inc @ONLY)
-configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5fort_type_defines.h.in ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @ONLY)
+configure_file (${HDF5_F90_SRC_SOURCE_DIR}/H5fort_type_defines.h.cmake ${HDF5_F90_BINARY_DIR}/H5fort_type_defines.h @ONLY)
set (Fortran_COMPILER_ID CMAKE_Fortran_COMPILER_ID)
diff --git a/fortran/src/H5config_f.inc.cmake b/fortran/src/H5config_f.inc.cmake
index f85db6c..b8d5355 100644
--- a/fortran/src/H5config_f.inc.cmake
+++ b/fortran/src/H5config_f.inc.cmake
@@ -12,87 +12,59 @@
! fortran/src/H5config_f.inc. Generated from fortran/src/H5config_f.inc.in by configure
! Define if we have parallel support
-#define H5_HAVE_PARALLEL @CMAKE_H5_HAVE_PARALLEL@
-
-#if H5_HAVE_PARALLEL==0
-#undef H5_HAVE_PARALLEL
-#endif
+#cmakedefine H5_HAVE_PARALLEL @H5_HAVE_PARALLEL@
! Define if the intrinsic function STORAGE_SIZE exists
-#define H5_FORTRAN_HAVE_STORAGE_SIZE @FORTRAN_HAVE_STORAGE_SIZE@
-
-#if H5_FORTRAN_HAVE_STORAGE_SIZE==0
-#undef H5_FORTRAN_HAVE_STORAGE_SIZE
-#endif
+#cmakedefine H5_FORTRAN_HAVE_STORAGE_SIZE @H5_FORTRAN_HAVE_STORAGE_SIZE@
! Define if the intrinsic function SIZEOF exists
-#define H5_FORTRAN_HAVE_SIZEOF @FORTRAN_HAVE_SIZEOF@
-
-#if H5_FORTRAN_HAVE_SIZEOF==0
-#undef H5_FORTRAN_HAVE_SIZEOF
-#endif
+#cmakedefine H5_FORTRAN_HAVE_SIZEOF @H5_FORTRAN_HAVE_SIZEOF@
! Define if the intrinsic function C_SIZEOF exists
-#define H5_FORTRAN_HAVE_C_SIZEOF @FORTRAN_HAVE_C_SIZEOF@
-
-#if H5_FORTRAN_HAVE_C_SIZEOF==0
-#undef H5_FORTRAN_HAVE_C_SIZEOF
-#endif
+#cmakedefine H5_FORTRAN_HAVE_C_SIZEOF @H5_FORTRAN_HAVE_C_SIZEOF@
! Define if the intrinsic C_LONG_DOUBLE exists
-#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @FORTRAN_HAVE_C_LONG_DOUBLE@
-
-#if H5_FORTRAN_HAVE_C_LONG_DOUBLE==0
-#undef H5_FORTRAN_HAVE_C_LONG_DOUBLE
-#endif
+#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@
! Define if Fortran C_LONG_DOUBLE is different from C_DOUBLE
-#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
+#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
! Define if the intrinsic module ISO_FORTRAN_ENV exists
-#define H5_HAVE_ISO_FORTRAN_ENV @HAVE_ISO_FORTRAN_ENV@
+#cmakedefine H5_HAVE_ISO_FORTRAN_ENV @H5_HAVE_ISO_FORTRAN_ENV@
! should this be ${HDF_PREFIX} instead of H5 MSB
-#define H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@
-
-#if H5_SIZEOF_DOUBLE==0
-#undef H5_SIZEOF_DOUBLE
-#endif
+#cmakedefine H5_SIZEOF_DOUBLE @H5_SIZEOF_DOUBLE@
! should this be ${HDF_PREFIX} instead of H5 MSB
-#define H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
-
-#if H5_SIZEOF_LONG_DOUBLE==0
-#undef H5_SIZEOF_LONG_DOUBLE
-#endif
+#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
! Define the maximum decimal precision for reals
-#define H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@
+#cmakedefine H5_PAC_FC_MAX_REAL_PRECISION @H5_PAC_FC_MAX_REAL_PRECISION@
! If C has quad precision
-#define H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@
+#cmakedefine H5_HAVE_FLOAT128 @H5_HAVE_FLOAT128@
-! Define if INTEGER*16 is available
-#define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @HAVE_Fortran_INTEGER_SIZEOF_16@
+! Define if INTEGER*16 is available
+#define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @H5_HAVE_Fortran_INTEGER_SIZEOF_16@
! Maximum decimal precision for 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@
! number of valid REAL KINDs
-#define H5_H5CONFIG_F_NUM_RKIND @H5CONFIG_F_NUM_RKIND@
+#cmakedefine H5_H5CONFIG_F_NUM_RKIND @H5_H5CONFIG_F_NUM_RKIND@
! valid REAL KINDs (need to have a matching C counter-part)
-#define H5_H5CONFIG_F_RKIND @H5CONFIG_F_RKIND@
+#cmakedefine H5_H5CONFIG_F_RKIND @H5_H5CONFIG_F_RKIND@
! valid REAL KINDs (need to have a matching C counter-part)
-#define H5_H5CONFIG_F_RKIND_SIZEOF @H5CONFIG_F_RKIND_SIZEOF@
+#cmakedefine H5_H5CONFIG_F_RKIND_SIZEOF @H5_H5CONFIG_F_RKIND_SIZEOF@
! number of valid INTEGER KINDs
-#define H5_H5CONFIG_F_NUM_IKIND @H5CONFIG_F_NUM_IKIND@
+#cmakedefine H5_H5CONFIG_F_NUM_IKIND @H5_H5CONFIG_F_NUM_IKIND@
! valid INTEGER KINDs (need to have a matching C counter-part)
-#define H5_H5CONFIG_F_IKIND @H5CONFIG_F_IKIND@
+#cmakedefine H5_H5CONFIG_F_IKIND @H5_H5CONFIG_F_IKIND@
! Fortran compiler id
-#define H5_Fortran_COMPILER_ID @Fortran_COMPILER_ID@
+#cmakedefine H5_Fortran_COMPILER_ID @Fortran_COMPILER_ID@
diff --git a/fortran/src/H5fort_type_defines.h.cmake b/fortran/src/H5fort_type_defines.h.cmake
new file mode 100644
index 0000000..1aa3181
--- /dev/null
+++ b/fortran/src/H5fort_type_defines.h.cmake
@@ -0,0 +1,28 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/* If you are reading this file and it has a '.h' suffix, it was automatically
+ * generated from the '.in' version. Make changes there.
+ */
+#define H5_FORTRAN_NATIVE_INTEGER_KIND @PAC_FORTRAN_NATIVE_INTEGER_KIND@
+#define H5_FORTRAN_NATIVE_INTEGER_SIZEOF @PAC_FORTRAN_NATIVE_INTEGER_SIZEOF@
+#define H5_FORTRAN_NATIVE_REAL_KIND @PAC_FORTRAN_NATIVE_REAL_KIND@
+#define H5_FORTRAN_NATIVE_REAL_SIZEOF @PAC_FORTRAN_NATIVE_REAL_SIZEOF@
+#define H5_FORTRAN_NATIVE_DOUBLE_KIND @PAC_FORTRAN_NATIVE_DOUBLE_KIND@
+#define H5_FORTRAN_NATIVE_DOUBLE_SIZEOF @PAC_FORTRAN_NATIVE_DOUBLE_SIZEOF@
+#define H5_FORTRAN_NUM_INTEGER_KINDS @PAC_FORTRAN_NUM_INTEGER_KINDS@
+#define H5_FORTRAN_INTEGER_KINDS @PAC_FC_ALL_INTEGER_KINDS@
+#define H5_FORTRAN_INTEGER_KINDS_SIZEOF @PAC_FC_ALL_INTEGER_KINDS_SIZEOF@
+#define H5_FORTRAN_REAL_KINDS @PAC_FC_ALL_REAL_KINDS@
+#define H5_FORTRAN_REAL_KINDS_SIZEOF @PAC_FC_ALL_REAL_KINDS_SIZEOF@
+#define H5_HAVE_Fortran_INTEGER_SIZEOF_16 @H5_HAVE_Fortran_INTEGER_SIZEOF_16@
+#define H5_FORTRAN_HAVE_C_LONG_DOUBLE @H5_FORTRAN_HAVE_C_LONG_DOUBLE@
+#define H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE @H5_FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@