Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit a135758

Browse files
committed
SWDEV-301636 - Manually find NUMA
CMake does not provide a way to query the NUMA library, hence we need to find it manually. Change-Id: I370b286acdee75cbebc21340da3c432c79f8ffa7
1 parent c32bdf0 commit a135758

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

cmake/FindNUMA.cmake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2020 - 2021 Advanced Micro Devices, Inc. All rights reserved.
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a copy
4+
# of this software and associated documentation files (the "Software"), to deal
5+
# in the Software without restriction, including without limitation the rights
6+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
# copies of the Software, and to permit persons to whom the Software is
8+
# furnished to do so, subject to the following conditions:
9+
#
10+
# The above copyright notice and this permission notice shall be included in
11+
# all copies or substantial portions of the Software.
12+
#
13+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
# THE SOFTWARE.
20+
21+
find_path(NUMA_INCLUDE_DIR numa.h)
22+
find_library(NUMA_LIBRARIES numa)
23+
24+
include(FindPackageHandleStandardArgs)
25+
find_package_handle_standard_args(NUMA
26+
DEFAULT_MSG
27+
NUMA_LIBRARIES NUMA_INCLUDE_DIR)
28+
29+
mark_as_advanced(NUMA_LIBRARIES NUMA_INCLUDE_DIR)

cmake/ROCclrHSA.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ find_package(hsa-runtime64 1.3 REQUIRED CONFIG
2727
lib64/cmake/hsa-runtime64)
2828
target_link_libraries(rocclr PUBLIC hsa-runtime64::hsa-runtime64)
2929

30-
find_package(NUMA QUIET)
30+
find_package(NUMA)
3131
if(NUMA_FOUND)
3232
target_compile_definitions(rocclr PUBLIC ROCCLR_SUPPORT_NUMA_POLICY)
33-
target_link_libraries(rocclr PUBLIC NUMA)
33+
target_include_directories(rocclr PUBLIC ${NUMA_INCLUDE_DIR})
34+
target_link_libraries(rocclr PUBLIC ${NUMA_LIBRARIES})
3435
endif()
3536

3637
target_sources(rocclr PRIVATE

0 commit comments

Comments
 (0)