Skip to content

Commit 490ed4d

Browse files
committed
add custom hwloc lib name
1 parent 65e4659 commit 490ed4d

File tree

5 files changed

+65
-13
lines changed

5 files changed

+65
-13
lines changed

.github/workflows/basic.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,56 @@ jobs:
332332
-DUMF_TESTS_FAIL_ON_SKIP=ON
333333
-DUMF_LINK_HWLOC_STATICALLY=ON
334334
335+
- name: Build UMF
336+
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS -v
337+
338+
- name: Run tests
339+
working-directory: ${{env.BUILD_DIR}}
340+
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
341+
342+
windows-dynamic_mingw_hwloc:
343+
env:
344+
HWLOC_PACKAGE_NAME: hwloc-win64-build-2.10.0
345+
TBB_PACKAGE_NAME: oneapi-tbb-2021.12.0
346+
TBB_LIB_DIR: lib\intel64\vc14
347+
TBB_BIN_DIR: redist\intel64\vc14
348+
349+
name: "Windows dynamic UMF + mingw libhwloc"
350+
strategy:
351+
matrix:
352+
build_type: [Release]
353+
354+
runs-on: 'windows-2022'
355+
356+
steps:
357+
- name: Checkout
358+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
359+
with:
360+
fetch-depth: 0
361+
362+
- name: Get hwloc from official repo (mingw version)
363+
run: |
364+
Invoke-WebRequest -Uri https://download.open-mpi.org/release/hwloc/v2.10/${{env.HWLOC_PACKAGE_NAME}}.zip -OutFile ${{github.workspace}}\${{env.HWLOC_PACKAGE_NAME}}.zip -TimeoutSec 360
365+
Expand-Archive ${{github.workspace}}\${{env.HWLOC_PACKAGE_NAME}}.zip -DestinationPath ${{github.workspace}}
366+
367+
- name: Get TBB from github
368+
run: |
369+
Invoke-WebRequest -Uri https://github.com/oneapi-src/oneTBB/releases/download/v2021.12.0/${{env.TBB_PACKAGE_NAME}}-win.zip -OutFile "${{github.workspace}}\${{env.TBB_PACKAGE_NAME}}-win.zip" -TimeoutSec 360
370+
Expand-Archive "${{github.workspace}}\${{env.TBB_PACKAGE_NAME}}-win.zip" -DestinationPath ${{github.workspace}}
371+
372+
- name: Configure build
373+
run: >
374+
cmake
375+
-B ${{env.BUILD_DIR}}
376+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
377+
-DCMAKE_PREFIX_PATH="${{github.workspace}}\${{env.HWLOC_PACKAGE_NAME}};${{github.workspace}}\${{env.TBB_PACKAGE_NAME}};${{github.workspace}}\${{env.TBB_PACKAGE_NAME}}\${{env.TBB_LIB_DIR}};${{github.workspace}}\${{env.TBB_PACKAGE_NAME}}\${{env.TBB_BIN_DIR}}"
378+
-DUMF_BUILD_SHARED_LIBRARY=ON
379+
-DUMF_BUILD_EXAMPLES=ON
380+
-DUMF_FORMAT_CODE_STYLE=OFF
381+
-DUMF_DEVELOPER_MODE=ON
382+
-DUMF_TESTS_FAIL_ON_SKIP=ON
383+
-DUMF_HWLOC_NAME=libhwloc
384+
335385
- name: Build UMF
336386
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
337387

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ option(
5555
option(UMF_FORMAT_CODE_STYLE
5656
"Add clang, cmake, and black -format-check and -format-apply targets"
5757
OFF)
58+
set(UMF_HWLOC_NAME
59+
"hwloc"
60+
CACHE STRING "Custom name for hwloc library w/o extension")
61+
5862
# Only a part of skips is treated as a failure now. TODO: extend to all tests
5963
option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF)
6064
option(UMF_USE_ASAN "Enable AddressSanitizer checks" OFF)
@@ -117,13 +121,11 @@ if(NOT UMF_LINK_HWLOC_STATICALLY)
117121

118122
# add PATH to DLL on Windows
119123
set(DLL_PATH_LIST
120-
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_DLL_DIRS}"
121-
)
124+
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_DLL_DIRS}")
122125
endif()
123126
# add PATH to DLL on Windows
124127
set(DLL_PATH_LIST
125-
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_LIBRARY_DIRS}/../bin"
126-
)
128+
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_DLL_DIRS}")
127129
elseif(WINDOWS AND NOT UMF_DISABLE_HWLOC)
128130
include(FetchContent)
129131
set(HWLOC_ENABLE_TESTING OFF)
@@ -336,8 +338,7 @@ if(NOT TBB_FOUND)
336338
endif()
337339
if(TBB_FOUND OR TBB_LIBRARY_DIRS)
338340
# add PATH to DLL on Windows
339-
set(DLL_PATH_LIST
340-
"${DLL_PATH_LIST};PATH=path_list_append:${TBB_DLL_DIRS}")
341+
set(DLL_PATH_LIST "${DLL_PATH_LIST};PATH=path_list_append:${TBB_DLL_DIRS}")
341342
set(UMF_POOL_SCALABLE_ENABLED TRUE)
342343
else()
343344
message(
@@ -354,8 +355,7 @@ if(UMF_BUILD_LIBUMF_POOL_JEMALLOC)
354355
endif()
355356
# add PATH to DLL on Windows
356357
set(DLL_PATH_LIST
357-
"${DLL_PATH_LIST};PATH=path_list_append:${JEMALLOC_DLL_DIRS}"
358-
)
358+
"${DLL_PATH_LIST};PATH=path_list_append:${JEMALLOC_DLL_DIRS}")
359359
endif()
360360

361361
# set UMF_PROXY_LIB_ENABLED

cmake/FindLIBHWLOC.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
message(STATUS "Checking for module 'libhwloc' using find_library()")
66

7-
find_library(LIBHWLOC_LIBRARY NAMES libhwloc hwloc)
7+
find_library(LIBHWLOC_LIBRARY NAMES ${UMF_HWLOC_NAME})
88
set(LIBHWLOC_LIBRARIES ${LIBHWLOC_LIBRARY})
99

1010
get_filename_component(LIBHWLOC_LIB_DIR ${LIBHWLOC_LIBRARIES} DIRECTORY)
@@ -38,7 +38,8 @@ try_run(
3838
RUN_OUTPUT_VARIABLE LIBHWLOC_API_VERSION)
3939

4040
if(WINDOWS)
41-
find_file(LIBHWLOC_DLL NAMES "bin/hwloc-15.dll" "bin/libhwloc-15.dll")
41+
find_file(LIBHWLOC_DLL NAMES "bin/${UMF_HWLOC_NAME}-15.dll"
42+
"${UMF_HWLOC_NAME}-15.dll")
4243
get_filename_component(LIBHWLOC_DLL_DIR ${LIBHWLOC_DLL} DIRECTORY)
4344
set(LIBHWLOC_DLL_DIRS ${LIBHWLOC_DLL_DIR})
4445
endif()

examples/cmake/FindLIBHWLOC.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ try_run(
3838
RUN_OUTPUT_VARIABLE LIBHWLOC_API_VERSION)
3939

4040
if(WINDOWS)
41-
find_file(LIBHWLOC_DLL NAMES "bin/hwloc-15.dll" "bin/libhwloc-15.dll" "hwloc-15.dll" "libhwloc-15.dll")
41+
find_file(LIBHWLOC_DLL NAMES "bin/hwloc-15.dll" "bin/libhwloc-15.dll"
42+
"hwloc-15.dll" "libhwloc-15.dll")
4243
get_filename_component(LIBHWLOC_DLL_DIR ${LIBHWLOC_DLL} DIRECTORY)
4344
set(LIBHWLOC_DLL_DIRS ${LIBHWLOC_DLL_DIR})
4445
endif()

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ endif()
154154

155155
if(UMF_BUILD_SHARED_LIBRARY)
156156
if(NOT UMF_DISABLE_HWLOC)
157-
set(HWLOC_LIB hwloc)
157+
set(HWLOC_LIB ${UMF_HWLOC_NAME})
158158
endif()
159159
add_umf_library(
160160
NAME umf
@@ -184,7 +184,7 @@ if(UMF_DISABLE_HWLOC)
184184
endif()
185185

186186
if(UMF_LINK_HWLOC_STATICALLY)
187-
add_dependencies(umf hwloc)
187+
add_dependencies(umf ${UMF_HWLOC_NAME})
188188
endif()
189189

190190
target_link_directories(umf PRIVATE ${UMF_PRIVATE_LIBRARY_DIRS})

0 commit comments

Comments
 (0)