Add THREADS check to configuration file (#4746)

* Cleanup threads package checks

* Check first if package was found

* Remove unnecessary dependent checks

* Remove Unused options and fix names of option prefix
This commit is contained in:
Allen Byrne 2024-09-07 20:45:12 -05:00 committed by GitHub
parent 66cfc803ff
commit 5e94301e71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 106 additions and 163 deletions

View File

@ -11,7 +11,7 @@ add_subdirectory (${PROJECT_SOURCE_DIR}/H5T)
if (${H5_LIBVER_DIR} GREATER 16)
# add_subdirectory (${PROJECT_SOURCE_DIR}/Perf)
if (USE_SHARED_LIBS AND HDF_BUILD_FILTERS AND HDF5_ENABLE_PLUGIN_SUPPORT)
if (USE_SHARED_LIBS AND H5EX_BUILD_FILTERS AND HDF5_ENABLE_PLUGIN_SUPPORT)
add_subdirectory (${PROJECT_SOURCE_DIR}/H5FLT)
endif ()
endif ()

View File

@ -39,8 +39,8 @@ message (STATUS "HDF5 H5_LIBVER_DIR: ${H5_LIBVER_DIR} HDF5_VERSION_MAJOR: ${HDF5
#-----------------------------------------------------------------------------
# Option to build JAVA examples
#-----------------------------------------------------------------------------
option (HDF_BUILD_JAVA "Build JAVA support" OFF)
if (HDF_BUILD_JAVA)
option (H5EX_BUILD_JAVA "Build JAVA support" OFF)
if (H5EX_BUILD_JAVA)
find_package (Java)
include (${H5EX_RESOURCES_DIR}/UseJava.cmake)
@ -73,8 +73,8 @@ endif ()
# Option to Enable MPI Parallel
#-----------------------------------------------------------------------------
set (CMAKE_MODULE_PATH ${H5EX_RESOURCES_DIR} ${CMAKE_MODULE_PATH})
option (HDF_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF)
if (HDF_ENABLE_PARALLEL)
option (H5EX_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF)
if (H5EX_ENABLE_PARALLEL)
find_package(MPI REQUIRED)
if (MPI_C_FOUND)
set (H5_HAVE_PARALLEL 1)
@ -99,55 +99,6 @@ if (H5_HAVE_PARALLEL)
INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_DIRS})
endif ()
# Determine if a threading package is available on this system
option (HDF5_ENABLE_THREADS "Enable thread support" ON)
set (THREADS_PREFER_PTHREAD_FLAG ON)
find_package (Threads)
if (Threads_FOUND)
set (H5_HAVE_THREADS 1)
set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
# Determine which threading package to use
# Comment out check for C11 threads for now, since it conflicts with the
# current --std=c99 compile flags at configuration time. When we switch to
# --std=c11, this can be uncommented.
#CHECK_INCLUDE_FILE("threads.h" HAVE_THREADS_H)
if (WIN32)
# When Win32 is available, we use those threads
set (H5_HAVE_WIN_THREADS 1)
elseif (HAVE_THREADS_H)
# When C11 threads are available, those are the top choice
set (H5_HAVE_C11_THREADS 1)
elseif (CMAKE_USE_PTHREADS_INIT)
set (H5_HAVE_PTHREAD_H 1)
else ()
message (FATAL_ERROR " **** thread support requires C11 threads, Win32 threads or Pthreads **** ")
endif ()
# Check for compiler support for atomic variables
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC_H)
if (HAVE_STDATOMIC_H)
set (H5_HAVE_STDATOMIC_H 1)
endif()
endif ()
#-----------------------------------------------------------------------------
# Option to use threadsafe
#-----------------------------------------------------------------------------
option (HDF_ENABLE_THREADSAFE "Enable Threadsafety" OFF)
# Note that HDF_ENABLE_THREADSAFE is the CMake option for determining
# whether to enable thread-safety in the examples. HDF5_ENABLE_THREADSAFE
# is the CMake option determining whether HDF5 was configured with
# thread-safety enabled.
if (HDF_ENABLE_THREADSAFE AND HDF5_ENABLE_THREADSAFE)
# Check for threading package
if (NOT Threads_FOUND)
message (FATAL_ERROR " **** thread-safety option requires a threading package and none was found **** ")
endif ()
set (H5_HAVE_THREADSAFE 1)
endif ()
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${H5EX_HDF5_INCLUDE_DIRS}"
)
@ -176,8 +127,8 @@ if (${H5_LIBVER_DIR} GREATER 16)
set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) name ## _")
set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) name ## _")
if (EXISTS "${H5EXAMPLES_SOURCE_DIR}/FORTRAN" AND IS_DIRECTORY "${H5EXAMPLES_SOURCE_DIR}/FORTRAN")
option (HDF_BUILD_FORTRAN "Build examples FORTRAN support" OFF)
if (HDF_BUILD_FORTRAN AND HDF5_BUILD_FORTRAN)
option (H5EX_BUILD_FORTRAN "Build examples FORTRAN support" OFF)
if (H5EX_BUILD_FORTRAN AND HDF5_BUILD_FORTRAN)
set (H5EX_LINK_Fortran_LIBS ${H5EX_HDF5_LINK_LIBS})
# Parallel IO usage requires MPI to be Linked and Included
@ -191,10 +142,10 @@ if (${H5_LIBVER_DIR} GREATER 16)
configure_file (${H5EX_F90_SRC_DIR}/H5D/h5_version.h.in ${PROJECT_BINARY_DIR}/FORTRAN/H5D/h5_version.h @ONLY)
configure_file (${H5EX_F90_SRC_DIR}/H5D/h5_version.h.in ${PROJECT_BINARY_DIR}/FORTRAN/H5G/h5_version.h @ONLY)
else ()
set (HDF_BUILD_FORTRAN OFF CACHE BOOL "Build examples FORTRAN support" FORCE)
set (H5EX_BUILD_FORTRAN OFF CACHE BOOL "Build examples FORTRAN support" FORCE)
endif ()
else ()
set (HDF_BUILD_FORTRAN OFF CACHE BOOL "Build examples FORTRAN support" FORCE)
set (H5EX_BUILD_FORTRAN OFF CACHE BOOL "Build examples FORTRAN support" FORCE)
endif ()
if (${H5_LIBVER_DIR} GREATER 18)
@ -202,29 +153,29 @@ if (${H5_LIBVER_DIR} GREATER 16)
# Option to build JAVA examples
#-----------------------------------------------------------------------------
if (EXISTS "${H5EXAMPLES_SOURCE_DIR}/JAVA" AND IS_DIRECTORY "${H5EXAMPLES_SOURCE_DIR}/JAVA")
option (HDF_BUILD_JAVA "Build examples JAVA support" OFF)
option (H5EX_BUILD_JAVA "Build examples JAVA support" OFF)
else ()
set (HDF_BUILD_JAVA OFF CACHE BOOL "Build examples JAVA support" FORCE)
set (H5EX_BUILD_JAVA OFF CACHE BOOL "Build examples JAVA support" FORCE)
endif ()
else ()
set (HDF_BUILD_JAVA OFF CACHE BOOL "Build examples JAVA support" FORCE)
set (H5EX_BUILD_JAVA OFF CACHE BOOL "Build examples JAVA support" FORCE)
endif ()
#-----------------------------------------------------------------------------
# Build the CPP Examples
#-----------------------------------------------------------------------------
if (EXISTS "${H5EXAMPLES_SOURCE_DIR}/CXX" AND IS_DIRECTORY "${H5EXAMPLES_SOURCE_DIR}/CXX")
option (HDF_BUILD_CPP_LIB "Build examples C++ support" OFF)
option (H5EX_BUILD_CPP_LIB "Build examples C++ support" OFF)
else ()
set (HDF_BUILD_CPP_LIB OFF CACHE BOOL "Build examples C++ support" FORCE)
set (H5EX_BUILD_CPP_LIB OFF CACHE BOOL "Build examples C++ support" FORCE)
endif ()
#-----------------------------------------------------------------------------
# Option to build filter examples
#-----------------------------------------------------------------------------
if (EXISTS "${H5EXAMPLES_SOURCE_DIR}/C/H5FLT" AND IS_DIRECTORY "${H5EXAMPLES_SOURCE_DIR}/C/H5FLT")
option (HDF_BUILD_FILTERS "Build examples PLUGIN filter support" OFF)
if (HDF_BUILD_FILTERS AND HDF5_ENABLE_PLUGIN_SUPPORT)
option (H5EX_BUILD_FILTERS "Build examples PLUGIN filter support" OFF)
if (H5EX_BUILD_FILTERS AND HDF5_ENABLE_PLUGIN_SUPPORT)
if(DEFINED ENV{HDF5_PLUGIN_PATH})
message (STATUS "ENV PATH=$ENV{HDF5_PLUGIN_PATH}")
set (H5EX_HDF5_PLUGIN_PATH $ENV{HDF5_PLUGIN_PATH})
@ -236,32 +187,32 @@ if (${H5_LIBVER_DIR} GREATER 16)
endif ()
message (STATUS "H5EX_HDF5_PLUGIN_PATH=${H5EX_HDF5_PLUGIN_PATH}")
else ()
set (HDF_BUILD_FILTERS OFF CACHE BOOL "Build examples PLUGIN filter support" FORCE)
set (H5EX_BUILD_FILTERS OFF CACHE BOOL "Build examples PLUGIN filter support" FORCE)
endif ()
else ()
set (HDF_BUILD_FILTERS OFF CACHE BOOL "Build examples PLUGIN filter support" FORCE)
set (H5EX_BUILD_FILTERS OFF CACHE BOOL "Build examples PLUGIN filter support" FORCE)
endif ()
else ()
set (HDF_BUILD_FORTRAN OFF} CACHE BOOL "Build examples FORTRAN support" FORCE)
set (HDF_BUILD_JAVA OFF CACHE BOOL "Build examples JAVA support" FORCE)
set (HDF_BUILD_CPP_LIB OFF CACHE BOOL "Build examples C++ support" FORCE)
set (HDF_BUILD_FILTERS OFF CACHE BOOL "Build examples PLUGIN filter support" FORCE)
set (H5EX_BUILD_FORTRAN OFF} CACHE BOOL "Build examples FORTRAN support" FORCE)
set (H5EX_BUILD_JAVA OFF CACHE BOOL "Build examples JAVA support" FORCE)
set (H5EX_BUILD_CPP_LIB OFF CACHE BOOL "Build examples C++ support" FORCE)
set (H5EX_BUILD_FILTERS OFF CACHE BOOL "Build examples PLUGIN filter support" FORCE)
endif ()
#-----------------------------------------------------------------------------
# Build examples
#-----------------------------------------------------------------------------
add_subdirectory (C)
if (HDF_BUILD_FORTRAN AND HDF5_BUILD_FORTRAN)
if (H5EX_BUILD_FORTRAN AND HDF5_BUILD_FORTRAN)
add_subdirectory (FORTRAN)
endif ()
if (HDF_BUILD_JAVA AND HDF5_BUILD_JAVA)
if (H5EX_BUILD_JAVA AND HDF5_BUILD_JAVA)
add_subdirectory (JAVA)
endif ()
if (HDF_BUILD_CPP_LIB AND HDF5_BUILD_CPP_LIB)
if (H5EX_BUILD_CPP_LIB AND HDF5_BUILD_CPP_LIB)
add_subdirectory (CXX)
endif ()
if (HDF_BUILD_PYTHON)
if (H5EX_BUILD_PYTHON)
add_subdirectory (PYTHON)
endif ()

View File

@ -18,21 +18,21 @@
"name": "ci-StdJava",
"hidden": true,
"cacheVariables": {
"HDF_BUILD_JAVA": "ON"
"H5EX_BUILD_JAVA": "ON"
}
},
{
"name": "ci-StdFortran",
"hidden": true,
"cacheVariables": {
"HDF_BUILD_FORTRAN": "ON"
"H5EX_BUILD_FORTRAN": "ON"
}
},
{
"name": "ci-StdPlugins",
"hidden": true,
"cacheVariables": {
"HDF_BUILD_FILTERS": "ON"
"H5EX_BUILD_FILTERS": "ON"
}
},
{

View File

@ -10,7 +10,7 @@ project (HDF5Examples_FORTRAN_H5D Fortran)
# Setup include Directories
#-----------------------------------------------------------------------------
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
"${CMAKE_Fortran_MODULE_DIRECTORY}${H5EX_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)
#-----------------------------------------------------------------------------

View File

@ -10,7 +10,7 @@ project (HDF5Examples_FORTRAN_H5G Fortran)
# Setup include Directories
#-----------------------------------------------------------------------------
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
"${CMAKE_Fortran_MODULE_DIRECTORY}${H5EX_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)
#-----------------------------------------------------------------------------
@ -47,7 +47,7 @@ foreach (example_name ${common_examples})
endif ()
endforeach ()
#if (HDF_ENABLE_F2003)
#if (H5EX_ENABLE_F2003)
# foreach (example_name ${f03examples})
# add_executable (${EXAMPLE_VARNAME}_f90_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.c)
# target_compile_options(${EXAMPLE_VARNAME}_f90_${example_name}
@ -149,7 +149,7 @@ if (HDF5_BUILD_TOOLS)
)
endif ()
#if (HDF_ENABLE_F2003)
#if (H5EX_ENABLE_F2003)
# foreach (example_name ${f03examples})
# add_custom_command (
# TARGET ${EXAMPLE_VARNAME}_f90_${example_name}
@ -432,7 +432,7 @@ if (H5EX_BUILD_TESTING)
#ADD_H5_CMP_TEST (h5ex_g_traverse)
#endif()
else ()
if (HDF_ENABLE_F2003)
if (H5EX_ENABLE_F2003)
ADD_H5_CMP_TEST (h5ex_g_intermediate)
ADD_H5_CMP_TEST (h5ex_g_iterate)
# ADD_H5_CMP_TEST (h5ex_g_traverse)

View File

@ -23,7 +23,7 @@ if (HDF5_VERSION_STRING VERSION_GREATER_EQUAL "1.10.0")
)
endif()
else ()
if (HDF_ENABLE_F2003)
if (H5EX_ENABLE_F2003)
set (common_examples
${common_examples}
h5ex_g_intermediate

View File

@ -10,7 +10,7 @@ project (HDF5Examples_FORTRAN_H5PAR Fortran)
# Setup include Directories
#-----------------------------------------------------------------------------
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
"${CMAKE_Fortran_MODULE_DIRECTORY}${H5EX_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)
#-----------------------------------------------------------------------------

View File

@ -5,7 +5,7 @@ project (HDF5Examples_FORTRAN_H5T Fortran)
# Setup include Directories
#-----------------------------------------------------------------------------
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
"${CMAKE_Fortran_MODULE_DIRECTORY}${H5EX_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)
#-----------------------------------------------------------------------------
@ -13,7 +13,7 @@ set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
#-----------------------------------------------------------------------------
include (Fortran_sourcefiles.cmake)
#if (HDF_ENABLE_F2003)
#if (H5EX_ENABLE_F2003)
foreach (example_name ${f03_examples})
add_executable (${EXAMPLE_VARNAME}_f90_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.F90)
target_compile_options(${EXAMPLE_VARNAME}_f90_${example_name}
@ -126,7 +126,7 @@ if (HDF5_BUILD_TOOLS)
)
endforeach ()
#if (HDF_ENABLE_F2003)
#if (H5EX_ENABLE_F2003)
foreach (example_name ${f03_examples})
if (NOT ${example_name} STREQUAL "h5ex_t_convert_F03")
if (${example_name} STREQUAL "h5ex_t_vlen_F03" OR ${example_name} STREQUAL "h5ex_t_vlenatt_F03")
@ -404,7 +404,7 @@ if (H5EX_BUILD_TESTING)
endif ()
endmacro ()
#if (HDF_ENABLE_F2003)
#if (H5EX_ENABLE_F2003)
foreach (example_name ${f03_examples} ${common_examples})
TEST_EXAMPLE (${example_name})
endforeach ()

View File

@ -5,7 +5,7 @@ project (HDF5Examples_FORTRAN_TUTR Fortran)
# Setup include Directories
#-----------------------------------------------------------------------------
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
"${CMAKE_Fortran_MODULE_DIRECTORY}${H5EX_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)
#-----------------------------------------------------------------------------
@ -13,7 +13,7 @@ set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
#-----------------------------------------------------------------------------
include (Fortran_sourcefiles.cmake)
#if (HDF_ENABLE_F2003)
#if (H5EX_ENABLE_F2003)
foreach (example_name ${f03_examples})
add_executable (${EXAMPLE_VARNAME}_f90_tutr_${example_name} ${PROJECT_SOURCE_DIR}/${example_name}.f90)
target_compile_options(${EXAMPLE_VARNAME}_f90_tutr_${example_name}
@ -112,7 +112,7 @@ if (H5EX_BUILD_TESTING)
set (last_test "${EXAMPLE_VARNAME}_f90_tutr_${testname}")
endmacro ()
#if (HDF_ENABLE_F2003)
#if (H5EX_ENABLE_F2003)
foreach (example_name ${f03_examples} ${common_examples})
ADD_H5_TEST (${example_name})
endforeach ()

View File

@ -99,8 +99,8 @@ These steps are described in more detail below.
<options> is:
* H5EX_BUILD_TESTING:BOOL=ON
* BUILD_SHARED_LIBS:BOOL=[ON | OFF]
* HDF_BUILD_FORTRAN:BOOL=[ON | OFF]
* HDF_BUILD_JAVA:BOOL=[ON | OFF]
* H5EX_BUILD_FORTRAN:BOOL=[ON | OFF]
* H5EX_BUILD_JAVA:BOOL=[ON | OFF]
if the hdf5 library was built with a namespace (i.e. "hdf5::") add:
-D HDF5_NAMESPACE:STRING=hdf5::

View File

@ -34,7 +34,7 @@ macro (BASIC_SETTINGS varname)
set (CMAKE_C_STANDARD 99)
set (CMAKE_C_STANDARD_REQUIRED TRUE)
if (HDF_BUILD_CPP_LIB)
if (H5EX_BUILD_CPP_LIB)
ENABLE_LANGUAGE (CXX)
set (CMAKE_CXX_STANDARD 98)
@ -66,12 +66,12 @@ macro (BASIC_SETTINGS varname)
#-----------------------------------------------------------------------------
# Option to allow the user to disable compiler warnings
#-----------------------------------------------------------------------------
option (HDF_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF)
if (HDF_DISABLE_COMPILER_WARNINGS)
option (H5EX_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF)
if (H5EX_DISABLE_COMPILER_WARNINGS)
# MSVC uses /w to suppress warnings. It also complains if another
# warning level is given, so remove it.
if (MSVC)
set (HDF_WARNINGS_BLOCKED 1)
set (H5EX_WARNINGS_BLOCKED 1)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@ -84,12 +84,12 @@ macro (BASIC_SETTINGS varname)
endif ()
# Borland uses -w- to suppress warnings.
if (BORLAND)
set (HDF_WARNINGS_BLOCKED 1)
set (H5EX_WARNINGS_BLOCKED 1)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-")
endif ()
# Most compilers use -w to suppress warnings.
if (NOT HDF_WARNINGS_BLOCKED)
if (NOT H5EX_WARNINGS_BLOCKED)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
@ -106,8 +106,8 @@ macro (BASIC_SETTINGS varname)
endmacro ()
macro (PYTHON_SUPPORT)
option (HDF_BUILD_PYTHON "Test Python3 support" OFF)
if (HDF_BUILD_PYTHON)
option (H5EX_BUILD_PYTHON "Test Python3 support" OFF)
if (H5EX_BUILD_PYTHON)
find_package (Python3 COMPONENTS Interpreter Development NumPy)
if (Python3_FOUND AND Python3_NumPy_FOUND)
include (ExternalProject)
@ -122,7 +122,7 @@ macro (PYTHON_SUPPORT)
INSTALL_COMMAND python3 -m pip --no-cache-dir install -v .
)
else ()
set (HDF_BUILD_PYTHON OFF CACHE BOOL "Test Python3 support" FORCE)
set (H5EX_BUILD_PYTHON OFF CACHE BOOL "Test Python3 support" FORCE)
message (STATUS "Python3:${Python3_FOUND} or numpy:${Python3_NumPy_FOUND} not found - disable test of Python examples")
endif ()
endif ()
@ -137,16 +137,16 @@ macro (HDF5_SUPPORT)
set (FIND_HDF_COMPONENTS C shared)
else ()
set (FIND_HDF_COMPONENTS C static)
set (HDF_BUILD_JAVA OFF CACHE BOOL "Build Java support" FORCE)
set (HDEXF_BUILD_JAVA OFF CACHE BOOL "Build Java support" FORCE)
message (STATUS "Using static HDF5 - disable build of Java examples")
endif ()
if (HDF_BUILD_FORTRAN)
if (H5EX_BUILD_FORTRAN)
set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} Fortran)
endif ()
if (HDF_BUILD_CPP_LIB)
if (H5EX_BUILD_CPP_LIB)
set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} CXX)
endif ()
if (HDF_BUILD_JAVA)
if (H5EX_BUILD_JAVA)
set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} Java)
set (HDF5_Java_FOUND 1) #default setting for 1.10.1 and earlier
endif ()
@ -161,13 +161,13 @@ macro (HDF5_SUPPORT)
if (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
#find library from non-dual-binary package
set (FIND_HDF_COMPONENTS C)
if (HDF_BUILD_FORTRAN)
if (H5EX_BUILD_FORTRAN)
set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} Fortran)
endif ()
if (HDF_BUILD_JAVA)
if (H5EX_BUILD_JAVA)
set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} Java)
endif ()
if (HDF_BUILD_CPP_LIB)
if (H5EX_BUILD_CPP_LIB)
set (FIND_HDF_COMPONENTS ${FIND_HDF_COMPONENTS} CXX)
endif ()
message (STATUS "HDF5 find comps: ${FIND_HDF_COMPONENTS}")
@ -185,7 +185,7 @@ macro (HDF5_SUPPORT)
else ()
set_property (TARGET ${HDF5_NAMESPACE}h5dump PROPERTY IMPORTED_LOCATION "${HDF5_TOOLS_DIR}/h5dump")
endif ()
if (HDF_BUILD_JAVA)
if (H5EX_BUILD_JAVA)
set (CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH};${HDF5_JAVA_INCLUDE_DIRS}")
message (STATUS "HDF5 jars:${HDF5_JAVA_INCLUDE_DIRS}")
endif ()
@ -218,21 +218,21 @@ macro (HDF5_SUPPORT)
endif()
if (NOT HDF5_static_Fortran_FOUND AND NOT HDF5_shared_Fortran_FOUND)
set (HDF_BUILD_FORTRAN OFF CACHE BOOL "Build FORTRAN support" FORCE)
set (H5EX_BUILD_FORTRAN OFF CACHE BOOL "Build FORTRAN support" FORCE)
message (STATUS "HDF5 Fortran libs not found - disable build of Fortran examples")
else ()
if (HDF_BUILD_FORTRAN AND ${HDF5_BUILD_FORTRAN})
if (H5EX_BUILD_FORTRAN AND ${HDF5_BUILD_FORTRAN})
if (BUILD_SHARED_LIBS AND HDF5_shared_Fortran_FOUND)
set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_FORTRAN_SHARED_LIBRARY})
elseif (HDF5_static_Fortran_FOUND)
set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_FORTRAN_STATIC_LIBRARY})
else ()
set (HDF_BUILD_FORTRAN OFF CACHE BOOL "Build FORTRAN support" FORCE)
set (H5EX_BUILD_FORTRAN OFF CACHE BOOL "Build FORTRAN support" FORCE)
message (STATUS "HDF5 Fortran libs not found - disable build of Fortran examples")
endif ()
endif ()
endif ()
if (HDF_BUILD_JAVA AND HDF5_Java_FOUND)
if (H5EX_BUILD_JAVA AND HDF5_Java_FOUND)
if (${HDF5_BUILD_JAVA})
set (CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH};${HDF5_JAVA_INCLUDE_DIRS}")
get_target_property (libsoname ${HDF5_JAVA_LIBRARY} IMPORTED_SONAME${UPPER_BUILD_TYPE})
@ -243,11 +243,11 @@ macro (HDF5_SUPPORT)
set (H5EX_JAVA_LIBRARIES ${HDF5_JAVA_LIBRARY})
message (STATUS "HDF5 lib:${H5EX_JAVA_LIBRARY} jars:${HDF5_JAVA_INCLUDE_DIRS}}")
else ()
set (HDF_BUILD_JAVA OFF CACHE BOOL "Build Java support" FORCE)
set (H5EX_BUILD_JAVA OFF CACHE BOOL "Build Java support" FORCE)
message (STATUS "HDF5 Java libs not found - disable build of Java examples")
endif ()
else ()
set (HDF_BUILD_JAVA OFF CACHE BOOL "Build Java support" FORCE)
set (H5EX_BUILD_JAVA OFF CACHE BOOL "Build Java support" FORCE)
endif ()
endif ()
else ()
@ -283,7 +283,7 @@ macro (HDF5_SUPPORT)
set (H5EX_HDF5_HAVE_HDF5 1)
message (STATUS "HDF5-${HDF5_VERSION_STRING} used")
endif ()
if (HDF_BUILD_FORTRAN)
if (H5EX_BUILD_FORTRAN)
list (APPEND H5EX_HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR_FORTRAN})
endif ()
message (STATUS "HDF5 link libs: ${H5EX_HDF5_LINK_LIBS} Includes: ${H5EX_HDF5_INCLUDE_DIRS}")

View File

@ -8,17 +8,15 @@ set (BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Libraries" FORCE)
set (H5EX_BUILD_TESTING ON CACHE BOOL "Build HDF5 Unit Testing" FORCE)
#set (HDF_ENABLE_PARALLEL ON CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
#set (H5EX_ENABLE_PARALLEL ON CACHE BOOL "Enable parallel build (requires MPI)" FORCE)
#set (HDF_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
#set (H5EX_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE)
#set (HDF_BUILD_FILTERS ON CACHE BOOL "Build filter support" FORCE)
#set (H5EX_BUILD_FILTERS ON CACHE BOOL "Build filter support" FORCE)
#set (HDF_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
#set (H5EX_ENABLE_F2003 ON CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE)
#set (HDF_ENABLE_THREADSAFE ON CACHE BOOL "Enable Threadsafety" FORCE)
#set (HDF_BUILD_JAVA ON CACHE BOOL "Build JAVA support" FORCE)
#set (H5EX_BUILD_JAVA ON CACHE BOOL "Build JAVA support" FORCE)
set (HDF5_PACKAGE_NAME "hdf5" CACHE STRING "Name of HDF5 package" FORCE)

View File

@ -7,13 +7,13 @@
# set example options to match build options
set (H5EX_BUILD_TESTING ${BUILD_TESTING} CACHE BOOL "Enable examples testing" FORCE)
set (H5EX_BUILD_EXAMPLES ${HDF5_BUILD_EXAMPLES} CACHE BOOL "Build Examples" FORCE)
set (HDF_BUILD_FORTRAN ${HDF5_BUILD_FORTRAN} CACHE BOOL "Build examples FORTRAN support" FORCE)
set (HDF_BUILD_JAVA ${HDF5_BUILD_JAVA} CACHE BOOL "Build examples JAVA support" FORCE)
set (HDF_BUILD_FILTERS ${HDF5_ENABLE_PLUGIN_SUPPORT} CACHE BOOL "Build examples PLUGIN filter support" FORCE)
set (HDF_BUILD_CPP_LIB ${HDF5_BUILD_CPP_LIB} CACHE BOOL "Build HDF5 C++ Library" FORCE)
set (HDF_BUILD_HL_LIB ${HDF5_BUILD_HL_LIB} CACHE BOOL "Build HIGH Level examples" FORCE)
set (HDF_ENABLE_THREADSAFE ${HDF5_ENABLE_THREADSAFE} CACHE BOOL "Enable examples thread-safety" FORCE)
set (HDF_ENABLE_PARALLEL ${HDF5_ENABLE_PARALLEL} CACHE BOOL "Enable examples parallel build (requires MPI)" FORCE)
set (H5EX_BUILD_FORTRAN ${HDF5_BUILD_FORTRAN} CACHE BOOL "Build examples FORTRAN support" FORCE)
set (H5EX_BUILD_JAVA ${HDF5_BUILD_JAVA} CACHE BOOL "Build examples JAVA support" FORCE)
set (H5EX_BUILD_FILTERS ${HDF5_ENABLE_PLUGIN_SUPPORT} CACHE BOOL "Build examples PLUGIN filter support" FORCE)
set (H5EX_BUILD_CPP_LIB ${HDF5_BUILD_CPP_LIB} CACHE BOOL "Build HDF5 C++ Library" FORCE)
set (H5EX_BUILD_HL_LIB ${HDF5_BUILD_HL_LIB} CACHE BOOL "Build HIGH Level examples" FORCE)
set (H5EX_ENABLE_THREADSAFE ${HDF5_ENABLE_THREADSAFE} CACHE BOOL "Enable examples thread-safety" FORCE)
set (H5EX_ENABLE_PARALLEL ${HDF5_ENABLE_PARALLEL} CACHE BOOL "Enable examples parallel build (requires MPI)" FORCE)
set (H5EX_USE_GNU_DIRS ${HDF5_USE_GNU_DIRS} CACHE BOOL "ON to use GNU Coding Standard install directory variables, OFF to use historical settings" FORCE)
#preset HDF5 cache vars to this projects libraries instead of searching
@ -46,7 +46,7 @@ if (NOT BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
set (H5EX_HDF5_LINK_LIBS ${HDF5_LIB_TARGET} CACHE STRING "HDF5 target" FORCE)
if (HDF5_BUILD_FORTRAN)
set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_F90_LIB_TARGET})
set (HDF_MOD_EXT "/static" CACHE STRING "Use Static Modules for Examples" FORCE)
set (H5EX_MOD_EXT "/static" CACHE STRING "Use Static Modules for Examples" FORCE)
endif ()
if (HDF5_BUILD_CPP_LIB)
set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_CPP_LIB_TARGET})
@ -56,7 +56,7 @@ else ()
set (H5EX_HDF5_LINK_LIBS ${HDF5_LIBSH_TARGET} CACHE STRING "HDF5 target" FORCE)
if (HDF5_BUILD_FORTRAN)
set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_F90_LIBSH_TARGET})
set (HDF_MOD_EXT "/shared" CACHE STRING "Use Shared Modules for Examples" FORCE)
set (H5EX_MOD_EXT "/shared" CACHE STRING "Use Shared Modules for Examples" FORCE)
endif ()
if (HDF5_BUILD_CPP_LIB)
set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} ${HDF5_CPP_LIBSH_TARGET})

View File

@ -14,14 +14,13 @@
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
#### DEFAULT: ###
#### BUILD_SHARED_LIBS:BOOL=OFF ###
#### HDF_BUILD_C:BOOL=ON ###
#### HDF_BUILD_CXX:BOOL=OFF ###
#### HDF_BUILD_FORTRAN:BOOL=OFF ###
#### HDF_BUILD_JAVA:BOOL=OFF ###
#### HDF_BUILD_FILTERS:BOOL=OFF ###
#### BUILD_TESTING:BOOL=OFF ###
#### HDF_ENABLE_PARALLEL:BOOL=OFF ###
#### HDF_ENABLE_THREADSAFE:BOOL=OFF ###
#### H5EX_BUILD_C:BOOL=ON ###
#### H5EX_BUILD_CXX:BOOL=OFF ###
#### H5EX_BUILD_FORTRAN:BOOL=OFF ###
#### H5EX_BUILD_JAVA:BOOL=OFF ###
#### H5EX_BUILD_FILTERS:BOOL=OFF ###
#### H5EX_BUILD_TESTING:BOOL=OFF ###
#### H5EX_ENABLE_PARALLEL:BOOL=OFF ###
#############################################################################################
### uncomment/comment and change the following lines for other configuration options
@ -44,38 +43,34 @@
#############################################################################################
#### languages ####
### disable C builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_C:BOOL=OFF")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DH5EX_BUILD_C:BOOL=OFF")
### enable C++ builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_CXX:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DH5EX_BUILD_CXX:BOOL=ON")
### enable Fortran builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DH5EX_BUILD_FORTRAN:BOOL=ON")
### enable JAVA builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DH5EX_BUILD_JAVA:BOOL=ON")
#############################################################################################
### enable FILTERS builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FILTERS:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DH5EX_BUILD_FILTERS:BOOL=ON")
### default HDF5_PLUGIN_PATH to where the filter libraries are located
#set(ENV{HDF5_PLUGIN_PATH} "${INSTALLDIR}/lib/plugin")
#############################################################################################
### enable parallel program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DH5EX_ENABLE_PARALLEL:BOOL=ON")
#############################################################################################
### match the hdf5 library namespace
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_NAMESPACE:STRING=hdf5::")
#############################################################################################
### enable threadsafe program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON")
#############################################################################################
### enable test program builds, requires reference files in testfiles subdirectory
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DH5EX_BUILD_TESTING:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DH5EX_COMPARE_TESTING:BOOL=ON")
#############################################################################################

View File

@ -92,7 +92,7 @@ if (${HDF5_PACKAGE_NAME}_ENABLE_PARALLEL)
find_package(MPI QUIET REQUIRED)
endif ()
if (${HDF5_PACKAGE_NAME}_ENABLE_THREADSAFE OR ${HDF5_PACKAGE_NAME}_ENABLE_SUBFILING_VFD)
if (${HDF5_PACKAGE_NAME}_ENABLE_THREADS)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads QUIET REQUIRED)
endif ()

View File

@ -78,12 +78,11 @@ III. Defaults in the HDF5_Examples_options.cmake file
#### DEFAULT: ###
#### BUILD_SHARED_LIBS:BOOL=OFF ###
#### HDF_BUILD_C:BOOL=ON ###
#### HDF_BUILD_CXX:BOOL=OFF ###
#### HDF_BUILD_FORTRAN:BOOL=OFF ###
#### HDF_BUILD_JAVA:BOOL=OFF ###
#### HDF_BUILD_FILTERS:BOOL=OFF ###
#### BUILD_TESTING:BOOL=OFF ###
#### HDF_ENABLE_PARALLEL:BOOL=OFF ###
#### HDF_ENABLE_THREADSAFE:BOOL=OFF ###
#### H5EX_BUILD_C:BOOL=ON ###
#### H5EX_BUILD_CXX:BOOL=OFF ###
#### H5EX_BUILD_FORTRAN:BOOL=OFF ###
#### H5EX_BUILD_JAVA:BOOL=OFF ###
#### H5EX_BUILD_FILTERS:BOOL=OFF ###
#### H5EX_BUILD_TESTING:BOOL=OFF ###
#### H5EX_ENABLE_PARALLEL:BOOL=OFF ###