Skip to content

Commit

Permalink
disable GINKGO_BUILD_HWLOC by default
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelKoch committed Feb 9, 2024
1 parent fce6ec6 commit 0669549
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 32 deletions.
16 changes: 4 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ option(GINKGO_SPLIT_TEMPLATE_INSTANTIATIONS "Split template instantiations for s
mark_as_advanced(GINKGO_SPLIT_TEMPLATE_INSTANTIATIONS)
option(GINKGO_JACOBI_FULL_OPTIMIZATIONS "Use all the optimizations for the CUDA Jacobi algorithm" OFF)
option(BUILD_SHARED_LIBS "Build shared (.so, .dylib, .dll) libraries" ON)
if(MSVC OR WIN32 OR CYGWIN OR APPLE)
option(GINKGO_BUILD_HWLOC "Build Ginkgo with HWLOC. Default is OFF. Ginkgo does not support HWLOC on Windows/MacOS" OFF)
else()
option(GINKGO_BUILD_HWLOC "Build Ginkgo with HWLOC. Enabled if a system installation is found." ${HWLOC_FOUND})
endif()
option(GINKGO_BUILD_HWLOC "Build Ginkgo with HWLOC. Default is OFF." OFF)
option(GINKGO_BUILD_PAPI_SDE "Build Ginkgo with PAPI SDE. Enabled if a system installation is found." ${PAPI_SDE_FOUND})
option(GINKGO_DPCPP_SINGLE_MODE "Do not compile double kernels for the DPC++ backend." OFF)
option(GINKGO_INSTALL_RPATH "Set the RPATH when installing its libraries." ON)
Expand Down Expand Up @@ -275,13 +271,9 @@ endif()
# System provided, third party libraries (not bundled!)
set(GINKGO_HAVE_HWLOC 0)
if(GINKGO_BUILD_HWLOC)
find_package(HWLOC 2.1)
if (HWLOC_FOUND)
set(GINKGO_HAVE_HWLOC 1)
else()
message(WARNING "HWLOC could not be found. HWLOC support will be disabled.")
set(GINKGO_BUILD_HWLOC OFF CACHE BOOL "HWLOC support was disabled because a system package could not be found." FORCE)
endif()
find_package(HWLOC 2.1 REQUIRED)
set(GINKGO_HAVE_HWLOC 1)
message(WARNING "The GINKGO_BUILD_HWLOC option has no beneficial effect. Consider setting it to GINKGO_BUILD_HWLOC=OFF.")
endif()

set(GINKGO_HAVE_PAPI_SDE 0)
Expand Down
4 changes: 1 addition & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ Ginkgo adds the following additional switches to control what is being built:
`OFF` otherwise.
* `-DGINKGO_HIP_AMDGPU="gpuarch1;gpuarch2"` the amdgpu_target(s) variable
passed to hipcc for the `hcc` HIP backend. The default is none (auto).
* `-DGINKGO_BUILD_HWLOC={ON, OFF}` builds Ginkgo with HWLOC. If system HWLOC
is not found, Ginkgo will try to build it. Default is `ON` on Linux. Ginkgo
does not support HWLOC on Windows/MacOS, so the default is `OFF` on Windows/MacOS.
* `-DGINKGO_BUILD_HWLOC={ON, OFF}` builds Ginkgo with HWLOC. Default is `OFF`.
* `-DGINKGO_BUILD_DOC={ON, OFF}` creates an HTML version of Ginkgo's documentation
from inline comments in the code. The default is `OFF`.
* `-DGINKGO_DOC_GENERATE_EXAMPLES={ON, OFF}` generates the documentation of examples
Expand Down
23 changes: 14 additions & 9 deletions cmake/Modules/FindHWLOC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,20 @@ if (HWLOC_INCLUDE_DIRS)
endif()
endif()

if (NOT HWLOC_FIND_QUIETLY)
if (HWLOC_INCLUDE_DIRS AND HWLOC_LIBRARIES)
message(STATUS "Looking for HWLOC - found version ${HWLOC_VERSION}")
else()
message(STATUS "${Magenta}Looking for HWLOC - not found"
"\n Please check that your environment variable HWLOC_DIR"
"\n has been set properly.${ColourReset}")
unset(HWLOC_LIBRARIES CACHE)
unset(HWLOC_INCLUDE_DIRS CACHE)
if (HWLOC_INCLUDE_DIRS AND HWLOC_LIBRARIES)
if (NOT HWLOC_FIND_QUIETLY)
message(STATUS "Looking for HWLOC - found version ${HWLOC_VERSION}")
endif()
else()
unset(HWLOC_LIBRARIES CACHE)
unset(HWLOC_INCLUDE_DIRS CACHE)
set(hwloc_err_msg "${Magenta}Looking for HWLOC - not found
Please check that your environment variable HWLOC_DIR has been set properly.${ColourReset}")
if(HWLOC_FIND_REQUIRED)
message(FATAL_ERROR "${hwloc_err_msg}")
endif()
if(NOT HWLOC_FIND_QUIETLY)
message(STATUS "${hwloc_err_msg}")
endif()
endif()

Expand Down
4 changes: 0 additions & 4 deletions cmake/autodetect_system_libs.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
if (NOT DEFINED GINKGO_BUILD_HWLOC)
find_package(HWLOC 2.1)
endif()

if (NOT DEFINED GINKGO_BUILD_PAPI_SDE)
find_package(PAPI 7.0.1.0 COMPONENTS sde)
endif()
8 changes: 6 additions & 2 deletions cuda/test/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ ginkgo_create_test(array EXECUTABLE_NAME array_test RESOURCE_TYPE cudagpu) # arr
ginkgo_create_cuda_test(cuda_executor)
ginkgo_create_test(index_set RESOURCE_TYPE cudagpu)
if(GINKGO_HAVE_HWLOC)
find_package(NUMA REQUIRED)
ginkgo_create_cuda_test(cuda_executor_topology ADDITIONAL_LIBRARIES NUMA::NUMA)
find_package(NUMA)
if(NUMA_FOUND)
ginkgo_create_cuda_test(cuda_executor_topology ADDITIONAL_LIBRARIES NUMA::NUMA)
else()
message(STATUS "NUMA not found, disabling HWLOC test.")
endif()
endif()
ginkgo_create_cuda_test(exception_helpers)
ginkgo_create_cuda_test(kernel_launch)
Expand Down
8 changes: 6 additions & 2 deletions hip/test/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
ginkgo_create_hip_test(hip_executor)
ginkgo_create_test(index_set RESOURCE_TYPE hipgpu)
if(GINKGO_HAVE_HWLOC)
find_package(NUMA REQUIRED)
ginkgo_create_hip_test(hip_executor_topology ADDITIONAL_LIBRARIES NUMA::NUMA)
find_package(NUMA)
if(NUMA_FOUND)
ginkgo_create_hip_test(hip_executor_topology ADDITIONAL_LIBRARIES NUMA::NUMA)
else()
message(STATUS "NUMA not found, disabling HWLOC test.")
endif()
endif()
ginkgo_create_hip_test(kernel_launch)
# correct flags for kernel_launch.hpp are set in GINKGO_HIPCC_OPTIONS
Expand Down

0 comments on commit 0669549

Please sign in to comment.