Files
hdf5/config/cmake_ext_mod/ConfigureChecks.cmake
Quincey Koziol 4b7f34acc1 Combo set of async and other changes (#161)
* Update API tracing for new H5VL_request_status_t typedef

* Finish converting internal event set operations to use list iterator callbacks, instead of directly accessing the list structure

* Add H5VL_REQUEST_GET_ERR_STACK operation to request subclass, for retrieving a copy of the error stack for a failed asynchronous operation

* Remove 'canceled' event status from Java constants

* Be safer about releasing resources when inserting a newly opened/created object or file into an event set

* Remove H5EStest, add H5ES_WAIT_NONE for 0 timeout, and revise parameters to H5ESwait, to make it more "aggregate".

* Remove H5ES_STATUS_CANCELED from Java wrappers also

* Apply patch for dynamically registering optional VOL operations

* (a) Add async APIs for H5O module as listed in jira issue ID-283.
(b) Remove verification of name parameter in async related routines for H55A and H5L modules
    because it is checked in H5VL_setup* routine.
(c) Modify h5dump expected output due to the async changes.

* Corrections based on PR feedback.

* Further changes to make based on PR feedback.

* Remove H5Dwait & H5Fwait (moved to the async connector).  Added H5atclose
routine.  Updated 'optional op' operations.

* Fix missed merge marker, and reformatted line

* Update API tracing infrastructure for H5atclose callback

* Clean up some warnings

* Normalize against develop branch

* Correct level of indirection

* Add doxygen info for H5is_library_terminating and regression tests for it and H5atclose

* Relocate prototype (and doxygen info) for H5Aclose

* Align w/changes on develop

* Move group package initialization code to H5Gint.c, and update tracing macros

* Change non-static function declarations to be static

* Correct GCC diagnostic macro

* Ensure that H5TSpublic.h header gets installed (#129)

* Finish moving API routines that invoke VOL framework to main source files.

* Fix position of H5Fmount and H5Funmount

* Add 'wrapper' versions of async calls, to allow language wrappers and layers on top of HDF5 to pass in their application information.

* Add wrappers for dynamically registered optional operations

* Fix typo

* Update doxygen comment for H5atclose with additional detail.

* Add H5VL\*_vararg versions of H5VL routines that use va_list parameters

* Implement and test H5S_BLOCK

* Switch H5Aexists\*_async and H5Lexists\*_async to use flag to return status, instead of return value.  Make the corresponding changes through most of the v1 and v2 B-tree code.  Clean up warnings in H5public.h and cmpd_dtransform.c.

* Add H5Iregister_future routine and tests.

* Correct return value for H5Lexists_async

* Add H5_DLL macro to public H5ES API routines

* Update supported -> flags parameter for introspect_query callback

* Remove my email address.  Update passthrough VOL connector ID.

* Fix comment for post_open_api_common

* Remove unused non-blocking VOL connector

* Minor cleanup in async branch in preparation for merge to develop

* Update CMake and the Autotools to use the new pass-through VOL ID

* Finish another iteration on public H5ES routines, along with running the code reformatter

* Another round of reformatting

* Fix for SWMR daily test failures (#160)

The H5I_register_using_existing_id() call did not initialize the future
ID callbacks, causing the library to segfault when it tried to
resolve those function pointers.

* Added selective async APIs (#150)

* Added selective async APIs

Description:
    Added the following APIs:
        H5Ropen_attr_async
        H5Ropen_object_async
        H5Ropen_region_async

        H5Mcreate_async
        H5Mopen_async
        H5Mput_async
        H5Mget_async
        H5Mclose_async

        H5Tcommit_async
        H5Topen_async
        H5Tcopy_async
        H5Tclose_async
    - Updated an expected output file to include a new internal function
      in the error stack for the failure case.

* Updated async APIs per reviews, including removing async version of
H5Tcopy.

* Removed statements that were added by mistake in the previous commit.

* Fix compile issues in H5M and warnings elsewhere

* Reformat code

* Brings VOL_LIST changes from develop. (#163)

* Remove H5Dwait and H5Fwait calls, which were incorrectly brought back in

* Tiny cleanup of H5Lcreate_hard_async

* Run source formatter

* Allow for canceled operation in wait_cb

* Attempt to fix switch on string value

* Re-run source formatter

* Add H5S_BLOCK testfile to CMake clean target

* Add H5Pset_vol_async API routine and 'get_cap_flags' VOL introspection callback

* Clean up warnings

* Add H5P(set\|get)_vol_implicit_async API routines to allow \/ disallow implicit asynchronous operations (default is disallowed)

* Run formatting script

* Remove H5VL_REQUEST_WAIT\*

* Warning cleanup

* Eliminate strdup()s on statically allocated strings

* Warning cleanup

* Split H5VLrestore_lib_state into H5VLstart_lib_state and H5VLrestore_lib_state, and rename H5VLreset_lib_state to H5VLfinish_lib_state.

* Duplicate strings when building err_info to return to applicatin

* Move connector author routines into seperate header files, all included in the new hdf5dev.h header

* Run bin/trace to add TRACE macros

* Allow H5ES_NONE as a valid, but no-op, parameter to all H5ES API routines that accept an event set ID

* Clean up formatting

* Remove H5Pset/get_vol_implicit_async

* Clean up warning

* Remove H5Pget_vol_async and replace with more generic H5Pget_vol_cap_flags

* Clean up warnings

* Add H5ESfree_err_info convenience routine

* Fix typo

* Correct matching for cached VOL plugins

* Add developer header file

* Update for C99 compatibility

* Add missing trace macro

* Stop clang-format from messing with the trace macros.  Don't set up VOL wrappers for 'infrastructure' objects like requests and blobs

* Fix warning about formatting a directory

* Clean up formatting for H5E_BEGIN_TRY / H5E_END_TRY

* Reduce scope of H5ES__close

* Enable CMake checks for various types on MacOS

* Clean up properly when H5CX_retrieve_state() fails.  Also clean up many compiler warnings.

* Committing clang-format changes

* Merge from develop

* Fix mis-placed assert

* Remove commented-out code

* Re-add macro for unsetenv on Windows (I think it accidentally was merged out)

* Strengthen sanity check from error report to assertion

* Committing clang-format changes

* Add units to the comments for a few fields

* Switch 'get execution time' operation for async request tokens to be an optional operation and query if connector supports operation before retrieving it.

* Committing clang-format changes

* Remove H5ESget_time_estimate

* Committing clang-format changes

* Create developer header for datatype routines and move type conversion register/unregister routines there.

* Simplify internal H5VL_setup_name_args and H5VL_setup_idx_args routines

* Add H5VLlink_optional_op, allowing dynamicly registered optional operations for the link VOL subclass, also added H5VL_loc_params argument to the link 'optional' callback to allow them to work correctly.

* Run bin/format_source on current code

* Add H5VLobject_optional_op, allowing dynamicly registered optional operations for the object VOL subclass, also added H5VL_loc_params argument to the object 'optional' callback to allow them to work correctly.

* Run bin/format_source on current code

* Committing clang-format changes

* Revert "Switch 'get execution time' operation for async request tokens to be an optional operation and query if connector supports operation before retrieving it."

This reverts commit 5ac92014da.

* Committing clang-format changes

* Convert attribute 'get' operation to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.

* Update tracing macros

* Convert attribute 'specific' operation to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.

* Convert dataset 'get' and 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.  Also, minor tweaks to attribute 'get' and 'specific' operation parameters.

* Convert datatype 'get' and 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.  Also, minor tweaks to H5O_refresh_metadata arguments.

* Reduce warnings

* Reduce warnings

* Track change to datatype 'get' callback

* Fix bug with file pointer getting invalidated when object closed

* Reformat source

* Convert file and group VOL classes 'get' and 'specific' operations to use
struct-of-tagged-union pattern for VOL callback arguments, instead of using
varargs.  Also small cleanup to the attribute get name operation.  Also moved
'mount' and 'unmount' operations to be group specific operations, instead of
file specific, to better align with their behavior (mounted files are on
groups, so a group is what is operated on).

* Remove remainder of merge conflict marking

* Convert link VOL class 'create' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.

* Remove some unused local variables

* Convert link VOL class 'get' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.  Also refactor 'get name by idx' routines to return actual length of name with a parameter instead of the return value, and move some callback context structs for the link interface from the private header file into the source code module, to reduce their visibility scope.

* Update tracing macros

* Convert link VOL class 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.

* Convert object VOL class 'get' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.

* Convert object VOL class 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.  Also refactor H5G_loc_exists, et al, to return 'exists' flag in a parameter and errors with the function return value, instead of overloading both into the return value.  And, corrected logic error in test/links.c around non-existant objects in a file.

* Convert request VOL class 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.

* Convert blob VOL class 'specific' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.  Also removes the H5VL_BLOB_GETSIZE operation, as it's unused in the library and the blob ID size for a container is now returned with H5VL_FILE_GET_CONT_INFO.

* Add 'const' to several parameters that are only queried.

* Convert all VOL classes' 'optional' operations to use struct-of-tagged-union pattern for VOL callback arguments, instead of using varargs.  Convert several 'get' routines to return the length of an array in a parameter instead of combining it into the return value.  Move several routines to be in less public namespace.  Correct direct_chunk test to verify that parameters aren't modified on error.

* Switch get/specific/optional VOL callback argument structures to be 'async-friendly'.  Also other minor cleanups and bug-fixes.

* Add H5Pset_dataset_io_hyperslab_selection / H5S_PLIST feature, to allow skipping H5Dget_space + H5Sselect_hyperslab for async operation

* Add dynamic optional operations for request objects

* Update dynamic operation test for optional request operations

* Update a comment for an operation argument

* Run trace and format_source scripts

* Committing clang-format changes

* Committing clang-format changes

Co-authored-by: vchoi <vchoi@jelly.ad.hdfgroup.org>
Co-authored-by: vchoi-hdfgroup <55293060+vchoi-hdfgroup@users.noreply.github.com>
Co-authored-by: jhendersonHDF <jhenderson@hdfgroup.org>
Co-authored-by: Dana Robinson <derobins@hdfgroup.org>
Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-06-02 15:29:46 -05:00

667 lines
28 KiB
CMake

#
# 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://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
#-----------------------------------------------------------------------------
# Include all the necessary files for macros
#-----------------------------------------------------------------------------
include (CheckFunctionExists)
include (CheckIncludeFile)
include (CheckIncludeFiles)
include (CheckLibraryExists)
include (CheckSymbolExists)
include (CheckTypeSize)
include (CheckVariableExists)
include (TestBigEndian)
include (CheckStructHasMember)
# Check for Darwin (not just Apple - we also want to catch OpenDarwin)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (${HDF_PREFIX}_HAVE_DARWIN 1)
endif ()
# Check for Solaris
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (${HDF_PREFIX}_HAVE_SOLARIS 1)
endif ()
#-----------------------------------------------------------------------------
# This MACRO checks IF the symbol exists in the library and IF it
# does, it appends library to the list.
#-----------------------------------------------------------------------------
set (LINK_LIBS "")
macro (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE})
if (${VARIABLE})
set (LINK_LIBS ${LINK_LIBS} ${LIBRARY})
endif ()
endmacro ()
# ----------------------------------------------------------------------
# WINDOWS Hard code Values
# ----------------------------------------------------------------------
set (WINDOWS)
if (MINGW)
set (${HDF_PREFIX}_HAVE_MINGW 1)
set (WINDOWS 1) # MinGW tries to imitate Windows
set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
set (__USE_MINGW_ANSI_STDIO 1)
endif ()
if (WIN32 AND NOT MINGW)
if (NOT UNIX)
set (WINDOWS 1)
set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1")
if (MSVC)
set (${HDF_PREFIX}_HAVE_VISUAL_STUDIO 1)
endif ()
endif ()
endif ()
if (WINDOWS)
set (HDF5_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
set (${HDF_PREFIX}_HAVE_WIN32_API 1)
set (${HDF_PREFIX}_HAVE_LIBM 1)
set (${HDF_PREFIX}_HAVE_STRDUP 1)
set (${HDF_PREFIX}_HAVE_SYSTEM 1)
set (${HDF_PREFIX}_HAVE_LONGJMP 1)
if (NOT MINGW)
set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1)
set (${HDF_PREFIX}_HAVE_FUNCTION 1)
endif ()
if (NOT UNIX AND NOT CYGWIN)
set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1)
set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1)
set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1)
set (${HDF_PREFIX}_HAVE_LIBWS2_32 1)
set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1)
endif ()
endif ()
# ----------------------------------------------------------------------
# END of WINDOWS Hard code Values
# ----------------------------------------------------------------------
if (NOT WINDOWS)
TEST_BIG_ENDIAN (${HDF_PREFIX}_WORDS_BIGENDIAN)
endif ()
#-----------------------------------------------------------------------------
# Check IF header file exists and add it to the list.
#-----------------------------------------------------------------------------
macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE})
if (${VARIABLE})
set (USE_INCLUDES ${USE_INCLUDES} ${FILE})
endif ()
endmacro ()
#-----------------------------------------------------------------------------
# Check for the existence of certain header files
#-----------------------------------------------------------------------------
CHECK_INCLUDE_FILE_CONCAT ("sys/file.h" ${HDF_PREFIX}_HAVE_SYS_FILE_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" ${HDF_PREFIX}_HAVE_SYS_IOCTL_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" ${HDF_PREFIX}_HAVE_SYS_RESOURCE_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" ${HDF_PREFIX}_HAVE_SYS_SOCKET_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" ${HDF_PREFIX}_HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" ${HDF_PREFIX}_HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" ${HDF_PREFIX}_HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE_CONCAT ("features.h" ${HDF_PREFIX}_HAVE_FEATURES_H)
CHECK_INCLUDE_FILE_CONCAT ("dirent.h" ${HDF_PREFIX}_HAVE_DIRENT_H)
CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" ${HDF_PREFIX}_HAVE_SETJMP_H)
CHECK_INCLUDE_FILE_CONCAT ("stddef.h" ${HDF_PREFIX}_HAVE_STDDEF_H)
CHECK_INCLUDE_FILE_CONCAT ("unistd.h" ${HDF_PREFIX}_HAVE_UNISTD_H)
# Windows
if (NOT CYGWIN)
CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" ${HDF_PREFIX}_HAVE_WINSOCK2_H)
endif ()
CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" ${HDF_PREFIX}_HAVE_GLOBUS_COMMON_H)
CHECK_INCLUDE_FILE_CONCAT ("pdb.h" ${HDF_PREFIX}_HAVE_PDB_H)
CHECK_INCLUDE_FILE_CONCAT ("pthread.h" ${HDF_PREFIX}_HAVE_PTHREAD_H)
CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" ${HDF_PREFIX}_HAVE_SRBCLIENT_H)
CHECK_INCLUDE_FILE_CONCAT ("string.h" ${HDF_PREFIX}_HAVE_STRING_H)
CHECK_INCLUDE_FILE_CONCAT ("strings.h" ${HDF_PREFIX}_HAVE_STRINGS_H)
CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" ${HDF_PREFIX}_HAVE_STDLIB_H)
CHECK_INCLUDE_FILE_CONCAT ("memory.h" ${HDF_PREFIX}_HAVE_MEMORY_H)
CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" ${HDF_PREFIX}_HAVE_DLFCN_H)
CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" ${HDF_PREFIX}_HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILE_CONCAT ("netdb.h" ${HDF_PREFIX}_HAVE_NETDB_H)
CHECK_INCLUDE_FILE_CONCAT ("arpa/inet.h" ${HDF_PREFIX}_HAVE_ARPA_INET_H)
## Check for non-standard extenstion quadmath.h
CHECK_INCLUDE_FILES(quadmath.h C_HAVE_QUADMATH)
if (${C_HAVE_QUADMATH})
set(${HDF_PREFIX}_HAVE_QUADMATH_H 1)
else ()
set(${HDF_PREFIX}_HAVE_QUADMATH_H 0)
endif ()
if (CYGWIN)
set (${HDF_PREFIX}_HAVE_LSEEK64 0)
endif ()
#-----------------------------------------------------------------------------
# Check for the math library "m"
#-----------------------------------------------------------------------------
if (MINGW OR NOT WINDOWS)
CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil ${HDF_PREFIX}_HAVE_LIBM)
CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen ${HDF_PREFIX}_HAVE_LIBDL)
CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup ${HDF_PREFIX}_HAVE_LIBWS2_32)
CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname ${HDF_PREFIX}_HAVE_LIBWSOCK32)
endif ()
# UCB (BSD) compatibility library
CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname ${HDF_PREFIX}_HAVE_LIBUCB)
# For other tests to use the same libraries
set (HDF5_REQUIRED_LIBRARIES ${HDF5_REQUIRED_LIBRARIES} ${LINK_LIBS})
set (USE_INCLUDES "")
if (WINDOWS)
set (USE_INCLUDES ${USE_INCLUDES} "windows.h")
endif ()
# For other specific tests, use this MACRO.
macro (HDF_FUNCTION_TEST OTHER_TEST)
if (NOT DEFINED ${HDF_PREFIX}_${OTHER_TEST})
set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
foreach (def
HAVE_SYS_TIME_H
HAVE_UNISTD_H
HAVE_SYS_TYPES_H
HAVE_SYS_SOCKET_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 ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (TRACE "Performing ${OTHER_TEST}")
endif ()
try_compile (${OTHER_TEST}
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
COMPILE_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS}"
LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT
)
if (${OTHER_TEST})
set (${HDF_PREFIX}_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Performing Other Test ${OTHER_TEST} - Success")
endif ()
else ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Performing Other Test ${OTHER_TEST} - Failed")
endif ()
set (${HDF_PREFIX}_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}")
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing Other Test ${OTHER_TEST} failed with the following output:\n"
"${OUTPUT}\n"
)
endif ()
endif ()
endmacro ()
#-----------------------------------------------------------------------------
# Check for large file support
#-----------------------------------------------------------------------------
# The linux-lfs option is deprecated.
set (LINUX_LFS 0)
set (HDF_EXTRA_C_FLAGS)
set (HDF_EXTRA_FLAGS)
if (MINGW OR NOT WINDOWS)
# Might want to check explicitly for Linux and possibly Cygwin
# instead of checking for not Solaris or Darwin.
if (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN)
# Linux Specific flags
# This was originally defined as _POSIX_SOURCE which was updated to
# _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX
# functionality so clock_gettime and CLOCK_MONOTONIC are defined
# correctly. This was later updated to 200112L so that
# posix_memalign() is visible for the direct VFD code on Linux
# systems.
# POSIX feature information can be found in the gcc manual at:
# http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200809L)
# Need to add this so that O_DIRECT is visible for the direct
# VFD on Linux systems.
set (HDF_EXTRA_C_FLAGS ${HDF_EXTRA_C_FLAGS} -D_GNU_SOURCE)
option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
if (HDF_ENABLE_LARGE_FILE AND NOT DEFINED TEST_LFS_WORKS_RUN)
set (msg "Performing TEST_LFS_WORKS")
try_run (TEST_LFS_WORKS_RUN TEST_LFS_WORKS_COMPILE
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
COMPILE_DEFINITIONS "-DTEST_LFS_WORKS"
)
# The LARGEFILE definitions were from the transition period
# and are probably no longer needed. The FILE_OFFSET_BITS
# check should be generalized for all POSIX systems as it
# is in the Autotools.
if (TEST_LFS_WORKS_COMPILE)
if (TEST_LFS_WORKS_RUN MATCHES 0)
set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg})
set (LARGEFILE 1)
set (HDF_EXTRA_FLAGS ${HDF_EXTRA_FLAGS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "${msg}... yes")
endif ()
else ()
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "${msg}... no")
endif ()
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Test TEST_LFS_WORKS Run failed with the following exit code:\n ${TEST_LFS_WORKS_RUN}\n"
)
endif ()
else ()
set (TEST_LFS_WORKS "" CACHE INTERNAL ${msg})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "${msg}... no")
endif ()
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Test TEST_LFS_WORKS Compile failed\n"
)
endif ()
endif ()
set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS})
endif ()
endif ()
#-----------------------------------------------------------------------------
# Check for HAVE_OFF64_T functionality
#-----------------------------------------------------------------------------
if (MINGW OR NOT WINDOWS)
HDF_FUNCTION_TEST (HAVE_OFF64_T)
if (${HDF_PREFIX}_HAVE_OFF64_T)
CHECK_FUNCTION_EXISTS (lseek64 ${HDF_PREFIX}_HAVE_LSEEK64)
endif ()
CHECK_FUNCTION_EXISTS (fseeko ${HDF_PREFIX}_HAVE_FSEEKO)
CHECK_STRUCT_HAS_MEMBER("struct stat64" st_blocks "sys/types.h;sys/stat.h" HAVE_STAT64_STRUCT)
if (HAVE_STAT64_STRUCT)
CHECK_FUNCTION_EXISTS (stat64 ${HDF_PREFIX}_HAVE_STAT64)
endif ()
endif ()
#-----------------------------------------------------------------------------
# Check the size in bytes of all the int and float types
#-----------------------------------------------------------------------------
macro (HDF_CHECK_TYPE_SIZE type var)
set (aType ${type})
set (aVar ${var})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (TRACE "Checking size of ${aType} and storing into ${aVar}")
endif ()
CHECK_TYPE_SIZE (${aType} ${aVar})
if (NOT ${aVar})
set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (TRACE "Size of ${aType} was NOT Found")
endif ()
endif ()
endmacro ()
HDF_CHECK_TYPE_SIZE (char ${HDF_PREFIX}_SIZEOF_CHAR)
HDF_CHECK_TYPE_SIZE (short ${HDF_PREFIX}_SIZEOF_SHORT)
HDF_CHECK_TYPE_SIZE (int ${HDF_PREFIX}_SIZEOF_INT)
HDF_CHECK_TYPE_SIZE (unsigned ${HDF_PREFIX}_SIZEOF_UNSIGNED)
if (NOT APPLE)
HDF_CHECK_TYPE_SIZE (long ${HDF_PREFIX}_SIZEOF_LONG)
endif ()
HDF_CHECK_TYPE_SIZE ("long long" ${HDF_PREFIX}_SIZEOF_LONG_LONG)
HDF_CHECK_TYPE_SIZE (__int64 ${HDF_PREFIX}_SIZEOF___INT64)
if (NOT ${HDF_PREFIX}_SIZEOF___INT64)
set (${HDF_PREFIX}_SIZEOF___INT64 0)
endif ()
HDF_CHECK_TYPE_SIZE (float ${HDF_PREFIX}_SIZEOF_FLOAT)
HDF_CHECK_TYPE_SIZE (double ${HDF_PREFIX}_SIZEOF_DOUBLE)
HDF_CHECK_TYPE_SIZE ("long double" ${HDF_PREFIX}_SIZEOF_LONG_DOUBLE)
HDF_CHECK_TYPE_SIZE (int8_t ${HDF_PREFIX}_SIZEOF_INT8_T)
HDF_CHECK_TYPE_SIZE (uint8_t ${HDF_PREFIX}_SIZEOF_UINT8_T)
HDF_CHECK_TYPE_SIZE (int_least8_t ${HDF_PREFIX}_SIZEOF_INT_LEAST8_T)
HDF_CHECK_TYPE_SIZE (uint_least8_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST8_T)
HDF_CHECK_TYPE_SIZE (int_fast8_t ${HDF_PREFIX}_SIZEOF_INT_FAST8_T)
HDF_CHECK_TYPE_SIZE (uint_fast8_t ${HDF_PREFIX}_SIZEOF_UINT_FAST8_T)
HDF_CHECK_TYPE_SIZE (int16_t ${HDF_PREFIX}_SIZEOF_INT16_T)
HDF_CHECK_TYPE_SIZE (uint16_t ${HDF_PREFIX}_SIZEOF_UINT16_T)
HDF_CHECK_TYPE_SIZE (int_least16_t ${HDF_PREFIX}_SIZEOF_INT_LEAST16_T)
HDF_CHECK_TYPE_SIZE (uint_least16_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST16_T)
HDF_CHECK_TYPE_SIZE (int_fast16_t ${HDF_PREFIX}_SIZEOF_INT_FAST16_T)
HDF_CHECK_TYPE_SIZE (uint_fast16_t ${HDF_PREFIX}_SIZEOF_UINT_FAST16_T)
HDF_CHECK_TYPE_SIZE (int32_t ${HDF_PREFIX}_SIZEOF_INT32_T)
HDF_CHECK_TYPE_SIZE (uint32_t ${HDF_PREFIX}_SIZEOF_UINT32_T)
HDF_CHECK_TYPE_SIZE (int_least32_t ${HDF_PREFIX}_SIZEOF_INT_LEAST32_T)
HDF_CHECK_TYPE_SIZE (uint_least32_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST32_T)
HDF_CHECK_TYPE_SIZE (int_fast32_t ${HDF_PREFIX}_SIZEOF_INT_FAST32_T)
HDF_CHECK_TYPE_SIZE (uint_fast32_t ${HDF_PREFIX}_SIZEOF_UINT_FAST32_T)
HDF_CHECK_TYPE_SIZE (int64_t ${HDF_PREFIX}_SIZEOF_INT64_T)
HDF_CHECK_TYPE_SIZE (uint64_t ${HDF_PREFIX}_SIZEOF_UINT64_T)
HDF_CHECK_TYPE_SIZE (int_least64_t ${HDF_PREFIX}_SIZEOF_INT_LEAST64_T)
HDF_CHECK_TYPE_SIZE (uint_least64_t ${HDF_PREFIX}_SIZEOF_UINT_LEAST64_T)
HDF_CHECK_TYPE_SIZE (int_fast64_t ${HDF_PREFIX}_SIZEOF_INT_FAST64_T)
HDF_CHECK_TYPE_SIZE (uint_fast64_t ${HDF_PREFIX}_SIZEOF_UINT_FAST64_T)
HDF_CHECK_TYPE_SIZE (size_t ${HDF_PREFIX}_SIZEOF_SIZE_T)
HDF_CHECK_TYPE_SIZE (ssize_t ${HDF_PREFIX}_SIZEOF_SSIZE_T)
if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
endif ()
if (MINGW OR NOT WINDOWS)
HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
endif ()
HDF_CHECK_TYPE_SIZE (off_t ${HDF_PREFIX}_SIZEOF_OFF_T)
HDF_CHECK_TYPE_SIZE (off64_t ${HDF_PREFIX}_SIZEOF_OFF64_T)
if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T)
set (${HDF_PREFIX}_SIZEOF_OFF64_T 0)
endif ()
HDF_CHECK_TYPE_SIZE (time_t ${HDF_PREFIX}_SIZEOF_TIME_T)
#-----------------------------------------------------------------------------
# Extra C99 types
#-----------------------------------------------------------------------------
# Size of bool
set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
if (MINGW OR NOT WINDOWS)
#-----------------------------------------------------------------------------
# Check if the dev_t type is a scalar type
#-----------------------------------------------------------------------------
HDF_FUNCTION_TEST (DEV_T_IS_SCALAR)
# ----------------------------------------------------------------------
# Check for MONOTONIC_TIMER support (used in clock_gettime). This has
# to be done after any POSIX/BSD defines to ensure that the test gets
# the correct POSIX level on linux.
CHECK_VARIABLE_EXISTS (CLOCK_MONOTONIC HAVE_CLOCK_MONOTONIC)
#-----------------------------------------------------------------------------
# Check a bunch of time functions
#-----------------------------------------------------------------------------
CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE_TM_GMTOFF)
CHECK_STRUCT_HAS_MEMBER("struct tm" __tm_gmtoff "time.h" ${HDF_PREFIX}_HAVE___TM_GMTOFF)
CHECK_STRUCT_HAS_MEMBER("struct tm" tm_sec "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_TIME_WITH_SYS_TIME)
if (${HDF_PREFIX}_HAVE_SYS_TIME_H)
CHECK_STRUCT_HAS_MEMBER("struct tm" tz_minuteswest "sys/types.h;sys/time.h;time.h" ${HDF_PREFIX}_HAVE_STRUCT_TIMEZONE)
else ()
CHECK_STRUCT_HAS_MEMBER("struct tm" tz_minuteswest "sys/types.h;time.h" ${HDF_PREFIX}_HAVE_STRUCT_TIMEZONE)
endif ()
CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY)
foreach (time_test
# HAVE_TIMEZONE
GETTIMEOFDAY_GIVES_TZ
HAVE_TM_ZONE
HAVE_STRUCT_TM_TM_ZONE
)
HDF_FUNCTION_TEST (${time_test})
endforeach ()
if (NOT CYGWIN AND NOT MINGW)
HDF_FUNCTION_TEST (HAVE_TIMEZONE)
endif ()
# ----------------------------------------------------------------------
# Does the struct stat have the st_blocks field? This field is not Posix.
#
CHECK_STRUCT_HAS_MEMBER("struct stat" st_blocks "sys/types.h;sys/stat.h" ${HDF_PREFIX}_HAVE_STAT_ST_BLOCKS)
# ----------------------------------------------------------------------
# How do we figure out the width of a tty in characters?
#
CHECK_FUNCTION_EXISTS (ioctl ${HDF_PREFIX}_HAVE_IOCTL)
CHECK_STRUCT_HAS_MEMBER ("struct videoconfig" numtextcols "" ${HDF_PREFIX}_HAVE_STRUCT_VIDEOCONFIG)
CHECK_STRUCT_HAS_MEMBER ("struct text_info" screenwidth "" ${HDF_PREFIX}_HAVE_STRUCT_TEXT_INFO)
CHECK_FUNCTION_EXISTS (_getvideoconfig ${HDF_PREFIX}_HAVE__GETVIDEOCONFIG)
CHECK_FUNCTION_EXISTS (gettextinfo ${HDF_PREFIX}_HAVE_GETTEXTINFO)
CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE)
if (NOT CYGWIN)
CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo ${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO)
endif ()
CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGWINSZ)
CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGETD)
# ----------------------------------------------------------------------
# cygwin user credentials are different then on linux
#
if (NOT CYGWIN AND NOT MINGW)
CHECK_FUNCTION_EXISTS (getpwuid ${HDF_PREFIX}_HAVE_GETPWUID)
endif ()
endif ()
#-----------------------------------------------------------------------------
# Check for some functions that are used
#
CHECK_FUNCTION_EXISTS (alarm ${HDF_PREFIX}_HAVE_ALARM)
CHECK_FUNCTION_EXISTS (fcntl ${HDF_PREFIX}_HAVE_FCNTL)
CHECK_FUNCTION_EXISTS (flock ${HDF_PREFIX}_HAVE_FLOCK)
CHECK_FUNCTION_EXISTS (fork ${HDF_PREFIX}_HAVE_FORK)
CHECK_FUNCTION_EXISTS (frexpf ${HDF_PREFIX}_HAVE_FREXPF)
CHECK_FUNCTION_EXISTS (frexpl ${HDF_PREFIX}_HAVE_FREXPL)
CHECK_FUNCTION_EXISTS (gethostname ${HDF_PREFIX}_HAVE_GETHOSTNAME)
CHECK_FUNCTION_EXISTS (getrusage ${HDF_PREFIX}_HAVE_GETRUSAGE)
CHECK_FUNCTION_EXISTS (lstat ${HDF_PREFIX}_HAVE_LSTAT)
CHECK_FUNCTION_EXISTS (pread ${HDF_PREFIX}_HAVE_PREAD)
CHECK_FUNCTION_EXISTS (pwrite ${HDF_PREFIX}_HAVE_PWRITE)
CHECK_FUNCTION_EXISTS (rand_r ${HDF_PREFIX}_HAVE_RAND_R)
CHECK_FUNCTION_EXISTS (random ${HDF_PREFIX}_HAVE_RANDOM)
CHECK_FUNCTION_EXISTS (setsysinfo ${HDF_PREFIX}_HAVE_SETSYSINFO)
CHECK_FUNCTION_EXISTS (signal ${HDF_PREFIX}_HAVE_SIGNAL)
CHECK_FUNCTION_EXISTS (longjmp ${HDF_PREFIX}_HAVE_LONGJMP)
CHECK_FUNCTION_EXISTS (setjmp ${HDF_PREFIX}_HAVE_SETJMP)
CHECK_FUNCTION_EXISTS (siglongjmp ${HDF_PREFIX}_HAVE_SIGLONGJMP)
CHECK_FUNCTION_EXISTS (sigsetjmp ${HDF_PREFIX}_HAVE_SIGSETJMP)
CHECK_FUNCTION_EXISTS (sigprocmask ${HDF_PREFIX}_HAVE_SIGPROCMASK)
CHECK_FUNCTION_EXISTS (snprintf ${HDF_PREFIX}_HAVE_SNPRINTF)
CHECK_FUNCTION_EXISTS (srandom ${HDF_PREFIX}_HAVE_SRANDOM)
CHECK_FUNCTION_EXISTS (strdup ${HDF_PREFIX}_HAVE_STRDUP)
CHECK_FUNCTION_EXISTS (strtoll ${HDF_PREFIX}_HAVE_STRTOLL)
CHECK_FUNCTION_EXISTS (strtoull ${HDF_PREFIX}_HAVE_STRTOULL)
CHECK_FUNCTION_EXISTS (symlink ${HDF_PREFIX}_HAVE_SYMLINK)
CHECK_FUNCTION_EXISTS (system ${HDF_PREFIX}_HAVE_SYSTEM)
CHECK_FUNCTION_EXISTS (tmpfile ${HDF_PREFIX}_HAVE_TMPFILE)
CHECK_FUNCTION_EXISTS (asprintf ${HDF_PREFIX}_HAVE_ASPRINTF)
CHECK_FUNCTION_EXISTS (vasprintf ${HDF_PREFIX}_HAVE_VASPRINTF)
CHECK_FUNCTION_EXISTS (waitpid ${HDF_PREFIX}_HAVE_WAITPID)
CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF)
if (MINGW OR NOT WINDOWS)
if (${HDF_PREFIX}_HAVE_VSNPRINTF)
HDF_FUNCTION_TEST (VSNPRINTF_WORKS)
endif ()
endif ()
#-----------------------------------------------------------------------------
# sigsetjmp is special; may actually be a macro
#-----------------------------------------------------------------------------
if (NOT ${HDF_PREFIX}_HAVE_SIGSETJMP)
if (${HDF_PREFIX}_HAVE_SETJMP_H)
CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" ${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
if (${HDF_PREFIX}_HAVE_MACRO_SIGSETJMP)
set (${HDF_PREFIX}_HAVE_SIGSETJMP 1)
endif ()
endif ()
endif ()
#-----------------------------------------------------------------------------
# Check a bunch of other functions
#-----------------------------------------------------------------------------
if (MINGW OR NOT WINDOWS)
foreach (other_test
HAVE_ATTRIBUTE
HAVE_C99_FUNC
HAVE_FUNCTION
HAVE_C99_DESIGNATED_INITIALIZER
SYSTEM_SCOPE_THREADS
HAVE_SOCKLEN_T
)
HDF_FUNCTION_TEST (${other_test})
endforeach ()
endif ()
#-----------------------------------------------------------------------------
# Check if InitOnceExecuteOnce is available
#-----------------------------------------------------------------------------
if (WINDOWS)
if (NOT HDF_NO_IOEO_TEST)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Checking for InitOnceExecuteOnce:")
endif ()
if (NOT DEFINED ${HDF_PREFIX}_HAVE_IOEO)
if (LARGEFILE)
set (CMAKE_REQUIRED_DEFINITIONS
"${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
)
endif ()
set (MACRO_CHECK_FUNCTION_DEFINITIONS "-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}")
if (CMAKE_REQUIRED_INCLUDES)
set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
else ()
set (CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif ()
TRY_RUN(HAVE_IOEO_EXITCODE HAVE_IOEO_COMPILED
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} ${MACRO_CHECK_FUNCTION_DEFINITIONS}"
LINK_LIBRARIES "${HDF5_REQUIRED_LIBRARIES}"
CMAKE_FLAGS "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES} -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}"
COMPILE_OUTPUT_VARIABLE OUTPUT
)
# if it did not compile make the return value fail code of 1
if (NOT HAVE_IOEO_COMPILED)
set (HAVE_IOEO_EXITCODE 1)
endif ()
# if the return value was 0 then it worked
if ("${HAVE_IOEO_EXITCODE}" EQUAL 0)
set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce")
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Performing Test InitOnceExecuteOnce - Success")
endif ()
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${HAVE_IOEO}\n")
else ()
if (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN")
set (${HDF_PREFIX}_HAVE_IOEO "${HAVE_IOEO_EXITCODE}")
else ()
set (${HDF_PREFIX}_HAVE_IOEO "" CACHE INTERNAL "Test InitOnceExecuteOnce")
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Performing Test InitOnceExecuteOnce - Failed")
endif ()
file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing InitOnceExecuteOnce Test failed with the following output:\n"
"${OUTPUT}\n"
"Return value: ${HAVE_IOEO_EXITCODE}\n")
endif ()
endif ()
endif ()
endif ()
#-----------------------------------------------------------------------------
# Determine how 'inline' is used
#-----------------------------------------------------------------------------
foreach (inline_test inline __inline__ __inline)
string (TOUPPER ${inline_test} INLINE_TEST_MACRO)
HDF_FUNCTION_TEST (HAVE_${INLINE_TEST_MACRO})
endforeach ()
#-----------------------------------------------------------------------------
# Check how to print a Long Long integer
#-----------------------------------------------------------------------------
if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown")
set (PRINT_LL_FOUND 0)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Checking for appropriate format for 64 bit long:")
endif ()
set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH")
if (${HDF_PREFIX}_SIZEOF_LONG_LONG)
set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG")
endif ()
TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE
${CMAKE_BINARY_DIR}
${HDF_RESOURCES_EXT_DIR}/HDFTests.c
COMPILE_DEFINITIONS "${CURRENT_TEST_DEFINITIONS}"
RUN_OUTPUT_VARIABLE OUTPUT
)
if (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE)
if (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0)
string(REGEX REPLACE ".*PRINTF_LL_WIDTH=\\[(.*)\\].*" "\\1" ${HDF_PREFIX}_PRINTF_LL "${OUTPUT}")
set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll")
set (PRINT_LL_FOUND 1)
else ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}")
endif ()
endif ()
else ()
file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed\n"
)
endif ()
if (PRINT_LL_FOUND)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}")
endif ()
else ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Checking for appropriate format for 64 bit long: not found")
endif ()
set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL
"Width for printf for type `long long' or `__int64', us. `ll"
)
endif ()
endif ()
# ----------------------------------------------------------------------
# Set the flag to indicate that the machine can handle converting
# denormalized floating-point values.
# (This flag should be set for all machines, except for the Crays, where
# the cache value is set in it's config file)
#
set (${HDF_PREFIX}_CONVERT_DENORMAL_FLOAT 1)