<commit_before>#-----------------------------------------------------------------------------
# Include all the necessary files for macros
#-----------------------------------------------------------------------------
INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake)

#-----------------------------------------------------------------------------
# Always SET this for now IF we are on an OS X box
#-----------------------------------------------------------------------------
IF (APPLE)
  LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH)
  IF(ARCH_LENGTH GREATER 1)
    set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE)
    message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is"
    "due to technical reasons. The best approach would be build each architecture in separate directories"
    "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'"
    "variable has been set to a blank value which will build the default architecture for this system.")
  ENDIF()
  SET (H5_AC_APPLE_UNIVERSAL_BUILD 0)
ENDIF (APPLE)

#-----------------------------------------------------------------------------
# Option to Clear File Buffers before write --enable-clear-file-buffers
#-----------------------------------------------------------------------------
OPTION (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON)
IF (HDF5_Enable_Clear_File_Buffers)
  SET (H5_CLEAR_MEMORY 1)
ENDIF (HDF5_Enable_Clear_File_Buffers)
MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers)

#-----------------------------------------------------------------------------
# Option for --enable-instrument
#-----------------------------------------------------------------------------
IF (CMAKE_BUILD_TYPE MATCHES Debug)
  SET (HDF5_Enable_Instrument ON)
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
OPTION (HDF5_Enable_Instrument "Instrument The library" HDF5_Enable_Instrument)
IF (HDF5_Enable_Instrument)
  SET (H5_HAVE_INSTRUMENTED_LIBRARY 1)
ENDIF (HDF5_Enable_Instrument)
MARK_AS_ADVANCED (HDF5_Enable_Instrument)

#-----------------------------------------------------------------------------
# Option for --enable-strict-format-checks
#-----------------------------------------------------------------------------
OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF)
IF (HDF5_STRICT_FORMAT_CHECKS)
  SET (H5_STRICT_FORMAT_CHECKS 1)
ENDIF (HDF5_STRICT_FORMAT_CHECKS)
MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS)

#-----------------------------------------------------------------------------
# Option for --enable-metadata-trace-file
#-----------------------------------------------------------------------------
OPTION (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF)
IF (HDF5_METADATA_TRACE_FILE)
  SET (H5_METADATA_TRACE_FILE 1)
ENDIF (HDF5_METADATA_TRACE_FILE)
MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE)

# ----------------------------------------------------------------------
# Decide whether the data accuracy has higher priority during data
# conversions.  If not, some hard conversions will still be prefered even
# though the data may be wrong (for example, some compilers don't
# support denormalized floating values) to maximize speed.
#
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)
ENDIF(HDF5_WANT_DATA_ACCURACY)
MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY)

# ----------------------------------------------------------------------
# Decide whether the presence of user's exception handling functions is
# checked and data conversion exceptions are returned.  This is mainly
# for the speed optimization of hard conversions.  Soft conversions can
# actually benefit little.
#
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)
ENDIF (HDF5_WANT_DCONV_EXCEPTION)
MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION)

# ----------------------------------------------------------------------
# Check if they would like the function stack support compiled in
#
OPTION (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF)
IF (HDF5_ENABLE_CODESTACK)
  SET (H5_HAVE_CODESTACK 1)
ENDIF (HDF5_ENABLE_CODESTACK)
MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK)

OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON)

# ----------------------------------------------------------------------
# Set the flag to indicate that the machine can handle converting
# floating-point to long long values.
# (This flag should be _unset_ for all machines)
#
#  SET (H5_HW_FP_TO_LLONG_NOT_WORKS 0)

# so far we have no check for this
SET(H5_HAVE_TMPFILE 1)

#-----------------------------------------------------------------------------
# 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 (${VARIABLE})
ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT)

# ----------------------------------------------------------------------
# WINDOWS Hard code Values
# ----------------------------------------------------------------------

SET (WINDOWS)
IF (WIN32)
  IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
    SET (WINDOWS 1)
  ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
ENDIF (WIN32)

#IF (WIN32)
#  SET (DEFAULT_STREAM_VFD OFF)
#ELSE (WIN32)
#  SET (DEFAULT_STREAM_VFD ON)
#ENDIF (WIN32)
#OPTION (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD})

# TODO --------------------------------------------------------------------------
# Should the Default Virtual File Driver be compiled?
# This is hard-coded now but option should added to match configure
#
IF (WINDOWS)
  SET (H5_HAVE_WINDOWS 1)
#  SET (H5_WINDOWS_USE_STDIO 0)
  # ----------------------------------------------------------------------
  # 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 (WINDOWS_MAX_BUF (1024 * 1024 * 1024))
  SET (H5_DEFAULT_VFD H5FD_WINDOWS)
  SET (LINK_LIBS ${LINK_LIBS} "kernel32")
ELSE (WINDOWS)
  SET (H5_DEFAULT_VFD H5FD_SEC2)
ENDIF (WINDOWS)

IF (WINDOWS)
  SET (H5_HAVE_IO_H 1)
  SET (H5_HAVE_SETJMP_H 1)
  SET (H5_HAVE_STDDEF_H 1)
  SET (H5_HAVE_SYS_STAT_H 1)
  SET (H5_HAVE_SYS_TIMEB_H 1)
  SET (H5_HAVE_SYS_TYPES_H 1)
  SET (H5_HAVE_WINSOCK_H 1)
  SET (H5_HAVE_LIBM 1)
  SET (H5_HAVE_STRDUP 1)
  SET (H5_HAVE_SYSTEM 1)
  SET (H5_HAVE_DIFFTIME 1)
  SET (H5_HAVE_LONGJMP 1)
  SET (H5_STDC_HEADERS 1)
  SET (H5_HAVE_GETHOSTNAME 1)
  SET (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1)
  SET (H5_HAVE_FUNCTION 1)
  SET (H5_GETTIMEOFDAY_GIVES_TZ 1)
  SET (H5_HAVE_TIMEZONE 1)
  SET (H5_HAVE_GETTIMEOFDAY 1)
  SET (H5_LONE_COLON 0)<commit_msg>hdf5: MinGW may not provide timezone<commit_after>#-----------------------------------------------------------------------------
# Include all the necessary files for macros
#-----------------------------------------------------------------------------
INCLUDE (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFiles.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake)
INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake)

#-----------------------------------------------------------------------------
# Always SET this for now IF we are on an OS X box
#-----------------------------------------------------------------------------
IF (APPLE)
  LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_LENGTH)
  IF(ARCH_LENGTH GREATER 1)
    set (CMAKE_OSX_ARCHITECTURES "" CACHE STRING "" FORCE)
    message(FATAL_ERROR "Building Universal Binaries on OS X is NOT supported by the HDF5 project. This is"
    "due to technical reasons. The best approach would be build each architecture in separate directories"
    "and use the 'lipo' tool to combine them into a single executable or library. The 'CMAKE_OSX_ARCHITECTURES'"
    "variable has been set to a blank value which will build the default architecture for this system.")
  ENDIF()
  SET (H5_AC_APPLE_UNIVERSAL_BUILD 0)
ENDIF (APPLE)

#-----------------------------------------------------------------------------
# Option to Clear File Buffers before write --enable-clear-file-buffers
#-----------------------------------------------------------------------------
OPTION (HDF5_Enable_Clear_File_Buffers "Securely clear file buffers before writing to file" ON)
IF (HDF5_Enable_Clear_File_Buffers)
  SET (H5_CLEAR_MEMORY 1)
ENDIF (HDF5_Enable_Clear_File_Buffers)
MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers)

#-----------------------------------------------------------------------------
# Option for --enable-instrument
#-----------------------------------------------------------------------------
IF (CMAKE_BUILD_TYPE MATCHES Debug)
  SET (HDF5_Enable_Instrument ON)
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
OPTION (HDF5_Enable_Instrument "Instrument The library" HDF5_Enable_Instrument)
IF (HDF5_Enable_Instrument)
  SET (H5_HAVE_INSTRUMENTED_LIBRARY 1)
ENDIF (HDF5_Enable_Instrument)
MARK_AS_ADVANCED (HDF5_Enable_Instrument)

#-----------------------------------------------------------------------------
# Option for --enable-strict-format-checks
#-----------------------------------------------------------------------------
OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF)
IF (HDF5_STRICT_FORMAT_CHECKS)
  SET (H5_STRICT_FORMAT_CHECKS 1)
ENDIF (HDF5_STRICT_FORMAT_CHECKS)
MARK_AS_ADVANCED (HDF5_STRICT_FORMAT_CHECKS)

#-----------------------------------------------------------------------------
# Option for --enable-metadata-trace-file
#-----------------------------------------------------------------------------
OPTION (HDF5_METADATA_TRACE_FILE "Enable metadata trace file collection" OFF)
IF (HDF5_METADATA_TRACE_FILE)
  SET (H5_METADATA_TRACE_FILE 1)
ENDIF (HDF5_METADATA_TRACE_FILE)
MARK_AS_ADVANCED (HDF5_METADATA_TRACE_FILE)

# ----------------------------------------------------------------------
# Decide whether the data accuracy has higher priority during data
# conversions.  If not, some hard conversions will still be prefered even
# though the data may be wrong (for example, some compilers don't
# support denormalized floating values) to maximize speed.
#
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)
ENDIF(HDF5_WANT_DATA_ACCURACY)
MARK_AS_ADVANCED (HDF5_WANT_DATA_ACCURACY)

# ----------------------------------------------------------------------
# Decide whether the presence of user's exception handling functions is
# checked and data conversion exceptions are returned.  This is mainly
# for the speed optimization of hard conversions.  Soft conversions can
# actually benefit little.
#
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)
ENDIF (HDF5_WANT_DCONV_EXCEPTION)
MARK_AS_ADVANCED (HDF5_WANT_DCONV_EXCEPTION)

# ----------------------------------------------------------------------
# Check if they would like the function stack support compiled in
#
OPTION (HDF5_ENABLE_CODESTACK "Enable the function stack tracing (for developer debugging)." OFF)
IF (HDF5_ENABLE_CODESTACK)
  SET (H5_HAVE_CODESTACK 1)
ENDIF (HDF5_ENABLE_CODESTACK)
MARK_AS_ADVANCED (HDF5_ENABLE_CODESTACK)

OPTION (HDF5_ENABLE_HSIZET "Enable datasets larger than memory" ON)

# ----------------------------------------------------------------------
# Set the flag to indicate that the machine can handle converting
# floating-point to long long values.
# (This flag should be _unset_ for all machines)
#
#  SET (H5_HW_FP_TO_LLONG_NOT_WORKS 0)

# so far we have no check for this
SET(H5_HAVE_TMPFILE 1)

#-----------------------------------------------------------------------------
# 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 (${VARIABLE})
ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT)

# ----------------------------------------------------------------------
# WINDOWS Hard code Values
# ----------------------------------------------------------------------

SET (WINDOWS)
IF (WIN32)
  IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
    SET (WINDOWS 1)
  ENDIF (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
ENDIF (WIN32)

#IF (WIN32)
#  SET (DEFAULT_STREAM_VFD OFF)
#ELSE (WIN32)
#  SET (DEFAULT_STREAM_VFD ON)
#ENDIF (WIN32)
#OPTION (HDF5_STREAM_VFD "Compile Stream Virtual File Driver support" ${DEFAULT_STREAM_VFD})

# TODO --------------------------------------------------------------------------
# Should the Default Virtual File Driver be compiled?
# This is hard-coded now but option should added to match configure
#
IF (WINDOWS)
  SET (H5_HAVE_WINDOWS 1)
#  SET (H5_WINDOWS_USE_STDIO 0)
  # ----------------------------------------------------------------------
  # 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 (WINDOWS_MAX_BUF (1024 * 1024 * 1024))
  SET (H5_DEFAULT_VFD H5FD_WINDOWS)
  SET (LINK_LIBS ${LINK_LIBS} "kernel32")
ELSE (WINDOWS)
  SET (H5_DEFAULT_VFD H5FD_SEC2)
ENDIF (WINDOWS)

IF (WINDOWS)
  SET (H5_HAVE_IO_H 1)
  SET (H5_HAVE_SETJMP_H 1)
  SET (H5_HAVE_STDDEF_H 1)
  SET (H5_HAVE_SYS_STAT_H 1)
  SET (H5_HAVE_SYS_TIMEB_H 1)
  SET (H5_HAVE_SYS_TYPES_H 1)
  SET (H5_HAVE_WINSOCK_H 1)
  SET (H5_HAVE_LIBM 1)
  SET (H5_HAVE_STRDUP 1)
  SET (H5_HAVE_SYSTEM 1)
  SET (H5_HAVE_DIFFTIME 1)
  SET (H5_HAVE_LONGJMP 1)
  SET (H5_STDC_HEADERS 1)
  SET (H5_HAVE_GETHOSTNAME 1)
  SET (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1)
  SET (H5_HAVE_FUNCTION 1)
  SET (H5_GETTIMEOFDAY_GIVES_TZ 1)
  IF (NOT MINGW)
    SET (H5_HAVE_TIMEZONE 1)
  ENDIF (NOT MINGW)
  SET (H5_HAVE_GETTIMEOFDAY 1)
  SET (H5_LONE_COLON 0)
{'fraction_non_alphanumeric': 0.2727330860723878, 'fraction_numerical': 0.016690113825297354, 'mean_word_length': 2.0261222910216716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5088899', 'n_tokens_mistral': 5036, 'n_tokens_neox': 4690, 'n_words': 1300}