Skip to content

Commit

Permalink
Hdf5 1 12 merge fortran configure changes (#727)
Browse files Browse the repository at this point in the history
* OESS-98 fix tools test for plugins

* sync fork

* Merge of changes from dev

* Move problem option to bottom of the list until fixed

* HDFFV-11106 - fix parsing optional args

* HDFFV-11106 add note

* grammer fix

* Whitespace after clang formatting

* Undo format version 11 changes

* Update check to working version

* Merge workflow and minor changes from develop

* Update supported platforms

* PR#3 merge from develop

* Merge gcc 10 diagnostics option from develop

* Merge #318 OSX changes from develop

* Merge serval small changes from dev

* fix typo

* Minor non-space formatting changes

* GH #386 copyright corrections for java folder

* revert because logic requires false return

* Merges from develop

#358 patches from vtk
#361 fix header guard spelling

* Remove case statement for H5I_EVENTSET

* Correct call with versioning

* Remove tabs

* Double underscore change

* Merges from develop

#340 clang -Wformat-security warnings
#360 Fixed uninitialized warnings
Remove more underscores from header guards

* Merge #380 from develop

* Correct date entry

* Split format source and commit changes on repo push

* remove pre-split setting

* Change windows TS to use older VS.

* HDFFV-11212 JNI export util and Javadoc

* Suggested review changes

* Another change found

* Committing clang-format changes

* Some Javadoc warning fixes

* Committing clang-format changes

* Updated javadoc fixes

* HDFFV-11228/9 merges from develop

* remove obsolete debug comment

* Fix conflict

* HDFFV-11229 merge changes from develop

* HDFFV-11229 merge second compare from develop

* HDFFV-11229 fix reference file

* HDFFV-11229 update autotools test script for two ref files

* HDFFV-11229 merge dev changes for long double display in tools

* Committing clang-format changes

* Update with changes from develop

* Add "option" command for clang options

* Rework CMake add_custom to use the BYPRODUCTS argument

Update pkgconfig scripts for parallel builds.
Fix install COPYING file reference.
Remove unused round defines.
Change CMake default setting of BUILD_CPP to off.

* Whitespace changes

* Rework CMake add_custom to use the BYPRODUCTS argument

* Revert CMake configure checks for round defines

* With VS 2015 minimum strdup is supported

* Doxygen comments merged from develop

* doxygen build updates

* Correct version string for map functions

* TRILAB-227 and tools debug merge from develop

* TRILAB-227 Enable test

* Quote subset args

* Use MATCHES in compiler id compare, merge from dev

* Revert test enable

* Add file to list

* doxygen version errors

* if blocks needed for build modes

* Update list of test platforms

* Issue #669 remove version from pkgcfg filename

* remove version from h5cc script

* Merge CMake and java refs from dev

* Reworked CMake Fortran configure macros to allow multiple runs.

* Fix CMake issue with tests not comparing test argument properly.

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
byrnHDF and github-actions[bot] committed Jun 7, 2021
1 parent 3bbc4f0 commit 0b110ac
Show file tree
Hide file tree
Showing 8 changed files with 175 additions and 253 deletions.
135 changes: 111 additions & 24 deletions config/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ if (HDF5_STRICT_FORMAT_CHECKS)
endif ()
MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS)

#-----------------------------------------------------------------------------
# Option for --enable-threadsafe
#-----------------------------------------------------------------------------
# Recursive RW locks are not supported on Windows (yet)
if (NOT WINDOWS)
option (HDF5_USE_RECURSIVE_RW_LOCKS "Whether to use recursive RW locks for thread-safety" OFF)
if (HDF5_USE_RECURSIVE_RW_LOCKS)
set (${HDF_PREFIX}_USE_RECURSIVE_RW_LOCKS 1)
endif ()
MARK_AS_ADVANCED (HDF5_USE_RECURSIVE_RW_LOCKS)
endif ()

# ----------------------------------------------------------------------
# Decide whether the data accuracy has higher priority during data
# conversions. If not, some hard conversions will still be prefered even
Expand Down Expand Up @@ -98,14 +86,6 @@ else ()
set (HDF5_FILE_LOCKING_SETTING "no")
endif ()

#-----------------------------------------------------------------------------
# Are we going to use HSIZE_T
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON)
if (HDF5_ENABLE_HSIZET)
set (${HDF_PREFIX}_HAVE_LARGE_HSIZET 1)
endif ()

# so far we have no check for this
set (${HDF_PREFIX}_HAVE_TMPFILE 1)

Expand Down Expand Up @@ -233,18 +213,125 @@ endif()
# Check if C has __float128 extension
#-----------------------------------------------------------------------------

CHECK_TYPE_SIZE("__float128" ${HDF_PREFIX}_SIZEOF___FLOAT128)
if (${${HDF_PREFIX}_SIZEOF___FLOAT128})
HDF_CHECK_TYPE_SIZE(__float128 _SIZEOF___FLOAT128)
if (${_SIZEOF___FLOAT128})
set (${HDF_PREFIX}_HAVE_FLOAT128 1)
set (${HDF_PREFIX}_SIZEOF___FLOAT128 ${_SIZEOF___FLOAT128})
else ()
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})
HDF_CHECK_TYPE_SIZE(_Quad _SIZEOF__QUAD)
if (NOT ${_SIZEOF__QUAD})
set (${HDF_PREFIX}_SIZEOF__QUAD 0)
else ()
set (${HDF_PREFIX}_SIZEOF__QUAD ${_SIZEOF__QUAD})
endif ()

#-----------------------------------------------------------------------------
# The provided CMake C macros don't provide a general compile/run function
# so this one is used.
#-----------------------------------------------------------------------------
macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Detecting C ${FUNCTION_NAME}")
endif ()
file (WRITE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
${SOURCE_CODE}
)
TRY_RUN (RUN_RESULT_VAR COMPILE_RESULT_VAR
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler1.c
COMPILE_DEFINITIONS "-D_SIZEOF___FLOAT128=${H5_SIZEOF___FLOAT128};-D_HAVE_QUADMATH_H=${H5_HAVE_QUADMATH_H}"
COMPILE_OUTPUT_VARIABLE COMPILEOUT
RUN_OUTPUT_VARIABLE OUTPUT_VAR
)

set (${RETURN_VAR} ${OUTPUT_VAR})

if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
message (VERBOSE "Test COMPILE_RESULT_VAR ${COMPILE_RESULT_VAR} ")
message (VERBOSE "Test COMPILE_OUTPUT ${COMPILEOUT} ")
message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
message (VERBOSE "Test RUN_RESULT_VAR ${RUN_RESULT_VAR} ")
message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
endif ()

if (${COMPILE_RESULT_VAR})
if (${RUN_RESULT_VAR} MATCHES 0)
set (${RUN_RESULT_VAR} 1 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Testing C ${FUNCTION_NAME} - OK")
endif ()
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the C ${FUNCTION_NAME} exists passed with the following output:\n"
"${OUTPUT_VAR}\n\n"
)
else ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Testing C ${FUNCTION_NAME} - Fail")
endif ()
set (${RUN_RESULT_VAR} 0 CACHE INTERNAL "Have C function ${FUNCTION_NAME}")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the C ${FUNCTION_NAME} exists failed with the following output:\n"
"${OUTPUT_VAR}\n\n")
endif ()
else ()
message (FATAL_ERROR "Compilation of C ${FUNCTION_NAME} - Failed")
endif ()
endmacro ()

set (PROG_SRC
"
#include <float.h>\n\
#include <stdio.h>\n\
#define CHECK_FLOAT128 _SIZEOF___FLOAT128\n\
#if CHECK_FLOAT128!=0\n\
#if _HAVE_QUADMATH_H!=0\n\
#include <quadmath.h>\n\
#endif\n\
#ifdef FLT128_DIG\n\
#define C_FLT128_DIG FLT128_DIG\n\
#else\n\
#define C_FLT128_DIG 0\n\
#endif\n\
#else\n\
#define C_FLT128_DIG 0\n\
#endif\n\
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L\n\
#define C_LDBL_DIG DECIMAL_DIG\n\
#else\n\
#define C_LDBL_DIG LDBL_DIG\n\
#endif\n\nint main() {\nFILE *pFile = fopen(\"pac_Cconftest.out\",\"w\")\\\;\nfprintf(pFile, \"\\%d\\\;\\%d\\\;\", C_LDBL_DIG, C_FLT128_DIG)\\\;\n\nreturn 0\\\;\n}\n
"
)

C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_RES)
file (READ "${CMAKE_BINARY_DIR}/pac_Cconftest.out" PROG_OUTPUT4)
message (STATUS "Testing maximum decimal precision for C - ${PROG_OUTPUT4}")

# dnl The output from the above program will be:
# dnl -- long double decimal precision -- __float128 decimal precision

list (GET PROG_OUTPUT4 0 H5_LDBL_DIG)
list (GET PROG_OUTPUT4 1 H5_FLT128_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 (_PAC_C_MAX_REAL_PRECISION ${H5_LDBL_DIG})
else ()
set (_PAC_C_MAX_REAL_PRECISION ${H5_FLT128_DIG})
endif ()
if (NOT ${_PAC_C_MAX_REAL_PRECISION})
set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION 0)
else ()
set (${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION ${_PAC_C_MAX_REAL_PRECISION})
endif ()
message (STATUS "maximum decimal precision for C var - ${${HDF_PREFIX}_PAC_C_MAX_REAL_PRECISION}")

#-----------------------------------------------------------------------------
# Macro to determine the various conversion capabilities
Expand Down
16 changes: 8 additions & 8 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/* Define the default plugins path to compile */
#cmakedefine H5_DEFAULT_PLUGINDIR "@H5_DEFAULT_PLUGINDIR@"

/* Define if `dev_t' is a scalar */
/* Define if dev_t is a scalar */
#cmakedefine H5_DEV_T_IS_SCALAR @H5_DEV_T_IS_SCALAR@

/* Define to dummy `main' function (if any) required to link to the Fortran
Expand Down Expand Up @@ -88,6 +88,9 @@
/* Define to 1 if you have the `alarm' function. */
#cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@

/* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine H5_HAVE_ARPA_INET_H @H5_HAVE_ARPA_INET_H@

/* Define to 1 if you have the `asprintf' function. */
#cmakedefine H5_HAVE_ASPRINTF @H5_HAVE_ASPRINTF@

Expand All @@ -101,9 +104,6 @@
/* Define if the compiler understands the __func__ keyword */
#cmakedefine H5_HAVE_C99_FUNC @H5_HAVE_C99_FUNC@

/* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine H5_HAVE_ARPA_INET_H @H5_HAVE_ARPA_INET_H@

/* Define to 1 if you have the `clock_gettime' function. */
#cmakedefine H5_HAVE_CLOCK_GETTIME @H5_HAVE_CLOCK_GETTIME@

Expand Down Expand Up @@ -270,7 +270,7 @@
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine H5_HAVE_MEMORY_H @H5_HAVE_MEMORY_H@

/* Define if we can build the Mirror VFD */
/* Define whether the Mirror virtual file driver (VFD) will be compiled */
#cmakedefine H5_HAVE_MIRROR_VFD @H5_HAVE_MIRROR_VFD@

/* Define if we have MPE support */
Expand All @@ -279,10 +279,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 exist */
#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 exist */
#cmakedefine H5_HAVE_MPI_MULTI_LANG_Info @H5_HAVE_MPI_MULTI_LANG_Info@

/* Define to 1 if you have the <netdb.h> header file. */
Expand Down Expand Up @@ -486,7 +486,7 @@
/* Define if the compiler understands __inline__ */
#cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@

/* Define if the library will ignore file locks when disabled */
/* Define if the library will ignore file locks when disabled */
#cmakedefine H5_IGNORE_DISABLED_FILE_LOCKS @H5_IGNORE_DISABLED_FILE_LOCKS@

/* Define if the high-level library headers should be included in hdf5.h */
Expand Down
Loading

0 comments on commit 0b110ac

Please sign in to comment.