summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/cmake
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2016-06-16 20:23:11 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2016-06-16 20:23:11 +0000
commit0f3c2b921d044cd1dc6747b8db5082e4f930b59c (patch)
tree5147aaaef94b8d68bf5311ef99555d6213c35fdd /openmp/runtime/cmake
parentc505ab6733997775b4aa9cd64cca455b79a7a371 (diff)
downloadbcm5719-llvm-0f3c2b921d044cd1dc6747b8db5082e4f930b59c.tar.gz
bcm5719-llvm-0f3c2b921d044cd1dc6747b8db5082e4f930b59c.zip
Teach OpenMP Library to use Hwloc on Windows
This patch allows a user to enable Hwloc on windows. There are three main changes in here: 1.kmp.h - Move definitions/declarations out of KMP_OS_WINDOWS guard (our windows implementation of affinity) because they need to be defined when KMP_USE_HWLOC is on as well. 2.teach __kmp_set_system_affinity, __kmp_get_system_affinity, __kmp_get_proc_group, and __kmp_affinity_bind_thread how to use hwloc. 3.teach CMake how to include hwloc when building Windows Another minor change in here is to make sure that anything under KMP_USE_HWLOC is also guarded by KMP_AFFINITY_SUPPORTED as well. This is to prevent Mac builds from requiring anything from Hwloc. Differential Revision: http://reviews.llvm.org/D21441 llvm-svn: 272951
Diffstat (limited to 'openmp/runtime/cmake')
-rw-r--r--openmp/runtime/cmake/config-ix.cmake29
1 files changed, 14 insertions, 15 deletions
diff --git a/openmp/runtime/cmake/config-ix.cmake b/openmp/runtime/cmake/config-ix.cmake
index b1f8b6711c0..206e689029d 100644
--- a/openmp/runtime/cmake/config-ix.cmake
+++ b/openmp/runtime/cmake/config-ix.cmake
@@ -246,23 +246,22 @@ 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
+ set(CMAKE_REQUIRED_INCLUDES ${LIBOMP_HWLOC_INSTALL_DIR}/include)
+ check_include_file(hwloc.h LIBOMP_HAVE_HWLOC_H)
+ set(CMAKE_REQUIRED_INCLUDES)
+ find_library(LIBOMP_HWLOC_LIBRARY
+ NAMES hwloc libhwloc
+ HINTS ${LIBOMP_HWLOC_INSTALL_DIR}/lib)
+ if(LIBOMP_HWLOC_LIBRARY)
+ check_library_exists(${LIBOMP_HWLOC_LIBRARY} 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()
+ 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()
OpenPOWER on IntegriCloud