summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/cmake/config-ix.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/cmake/config-ix.cmake')
-rw-r--r--openmp/runtime/cmake/config-ix.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/openmp/runtime/cmake/config-ix.cmake b/openmp/runtime/cmake/config-ix.cmake
index 9c7848b3bcf..eccb8634b3b 100644
--- a/openmp/runtime/cmake/config-ix.cmake
+++ b/openmp/runtime/cmake/config-ix.cmake
@@ -12,6 +12,7 @@
include(CheckCCompilerFlag)
include(CheckCSourceCompiles)
include(CheckCXXCompilerFlag)
+include(CheckIncludeFile)
include(CheckLibraryExists)
include(CheckIncludeFiles)
include(LibompCheckLinkerFlag)
@@ -211,3 +212,25 @@ else()
endif()
endif()
+# Check if HWLOC support is available
+if(${LIBOMP_USE_HWLOC})
+ if(WIN32)
+ set(LIBOMP_HAVE_HWLOC FALSE)
+ libomp_say("Using hwloc not supported on Windows yet")
+ else()
+ set(CMAKE_REQUIRED_INCLUDES ${LIBOMP_HWLOC_INSTALL_DIR}/include)
+ check_include_file(hwloc.h LIBOMP_HAVE_HWLOC_H)
+ set(CMAKE_REQUIRED_INCLUDES)
+ check_library_exists(hwloc hwloc_topology_init
+ ${LIBOMP_HWLOC_INSTALL_DIR}/lib LIBOMP_HAVE_LIBHWLOC)
+ find_library(LIBOMP_HWLOC_LIBRARY hwloc ${LIBOMP_HWLOC_INSTALL_DIR}/lib)
+ get_filename_component(LIBOMP_HWLOC_LIBRARY_DIR ${LIBOMP_HWLOC_LIBRARY} PATH)
+ if(LIBOMP_HAVE_HWLOC_H AND LIBOMP_HAVE_LIBHWLOC AND LIBOMP_HWLOC_LIBRARY)
+ set(LIBOMP_HAVE_HWLOC TRUE)
+ else()
+ set(LIBOMP_HAVE_HWLOC FALSE)
+ libomp_say("Could not find hwloc")
+ endif()
+ endif()
+endif()
+
OpenPOWER on IntegriCloud