summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-07-26 21:20:16 (GMT)
committerGitHub <noreply@github.com>2022-07-26 21:20:16 (GMT)
commit213eac2588369f75a11df6bb1788dde33c4b82e2 (patch)
treecd2ca57125ea1555d331f2c3c7d08aef7b289064 /CMakeLists.txt
parent96edaa304cbc771a36372725c395b9c2e1bd81dd (diff)
downloadhdf5-213eac2588369f75a11df6bb1788dde33c4b82e2.zip
hdf5-213eac2588369f75a11df6bb1788dde33c4b82e2.tar.gz
hdf5-213eac2588369f75a11df6bb1788dde33c4b82e2.tar.bz2
Subfiling VFD misc fixes (#1938)
* Remove generated file h5fuse.sh * Link pthreads library when Subfiling VFD is built
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d27962d..4e42153 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -758,6 +758,18 @@ if (HDF5_ENABLE_SUBFILING_VFD)
if (NOT HDF5_ENABLE_PARALLEL)
message (FATAL_ERROR "Subfiling VFD requires a parallel HDF5 build")
endif()
+
+ if (NOT DEFINED Threads_FOUND)
+ set (THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package (Threads REQUIRED)
+ endif ()
+
+ # For now, make sure we're using pthreads. Once Subfiling can be
+ # supported on Windows, we should allow Win32 threads as well
+ if (NOT ${Threads_FOUND} OR NOT ${CMAKE_USE_PTHREADS_INIT})
+ message (FATAL_ERROR "Subfiling requires pthreads for system thread library")
+ endif ()
+
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_STDATOMIC_H)
if (NOT HAVE_STDATOMIC_H)
message (FATAL_ERROR "Subfiling VFD requires atomic operations support. C11 stdatomic.h NOT available.")