Skip to content

Commit c38b708

Browse files
Merge pull request #697 from bratpiorka/rrudnick_hwloc_prefix
set custom name for hwloc lib
2 parents e45bb3c + 7a8c1d6 commit c38b708

File tree

8 files changed

+67
-14
lines changed

8 files changed

+67
-14
lines changed

.github/workflows/basic.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,56 @@ jobs:
348348
-DUMF_TESTS_FAIL_ON_SKIP=ON
349349
-DUMF_LINK_HWLOC_STATICALLY=ON
350350
351+
- name: Build UMF
352+
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS -v
353+
354+
- name: Run tests
355+
working-directory: ${{env.BUILD_DIR}}
356+
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
357+
358+
windows-dynamic_mingw_hwloc:
359+
env:
360+
HWLOC_PACKAGE_NAME: hwloc-win64-build-2.10.0
361+
TBB_PACKAGE_NAME: oneapi-tbb-2021.12.0
362+
TBB_LIB_DIR: lib\intel64\vc14
363+
TBB_BIN_DIR: redist\intel64\vc14
364+
365+
name: "Windows dynamic UMF + mingw libhwloc"
366+
strategy:
367+
matrix:
368+
build_type: [Release]
369+
370+
runs-on: 'windows-2022'
371+
372+
steps:
373+
- name: Checkout
374+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
375+
with:
376+
fetch-depth: 0
377+
378+
- name: Get hwloc from official repo (mingw version)
379+
run: |
380+
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
381+
Expand-Archive ${{github.workspace}}\${{env.HWLOC_PACKAGE_NAME}}.zip -DestinationPath ${{github.workspace}}
382+
383+
- name: Get TBB from github
384+
run: |
385+
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
386+
Expand-Archive "${{github.workspace}}\${{env.TBB_PACKAGE_NAME}}-win.zip" -DestinationPath ${{github.workspace}}
387+
388+
- name: Configure build
389+
run: >
390+
cmake
391+
-B ${{env.BUILD_DIR}}
392+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
393+
-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}}"
394+
-DUMF_BUILD_SHARED_LIBRARY=ON
395+
-DUMF_BUILD_EXAMPLES=ON
396+
-DUMF_FORMAT_CODE_STYLE=OFF
397+
-DUMF_DEVELOPER_MODE=ON
398+
-DUMF_TESTS_FAIL_ON_SKIP=ON
399+
-DUMF_HWLOC_NAME=libhwloc
400+
351401
- name: Build UMF
352402
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
353403

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ option(
5959
option(UMF_FORMAT_CODE_STYLE
6060
"Add clang, cmake, and black -format-check and -format-apply targets"
6161
OFF)
62+
set(UMF_HWLOC_NAME
63+
"hwloc"
64+
CACHE STRING "Custom name for hwloc library w/o extension")
65+
6266
# Only a part of skips is treated as a failure now. TODO: extend to all tests
6367
option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF)
6468
option(UMF_USE_ASAN "Enable AddressSanitizer checks" OFF)
@@ -120,8 +124,7 @@ else()
120124

121125
# add PATH to DLL on Windows
122126
set(DLL_PATH_LIST
123-
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_LIBRARY_DIRS}/../bin"
124-
)
127+
"${DLL_PATH_LIST};PATH=path_list_append:${LIBHWLOC_DLL_DIRS}")
125128
elseif(WINDOWS)
126129
include(FetchContent)
127130
set(HWLOC_ENABLE_TESTING OFF)
@@ -336,8 +339,7 @@ if(NOT TBB_FOUND)
336339
endif()
337340
if(TBB_FOUND OR TBB_LIBRARY_DIRS)
338341
# add PATH to DLL on Windows
339-
set(DLL_PATH_LIST
340-
"${DLL_PATH_LIST};PATH=path_list_append:${TBB_LIBRARY_DIRS}/../bin")
342+
set(DLL_PATH_LIST "${DLL_PATH_LIST};PATH=path_list_append:${TBB_DLL_DIRS}")
341343
set(UMF_POOL_SCALABLE_ENABLED TRUE)
342344
else()
343345
message(
@@ -354,8 +356,7 @@ if(UMF_BUILD_LIBUMF_POOL_JEMALLOC)
354356
endif()
355357
# add PATH to DLL on Windows
356358
set(DLL_PATH_LIST
357-
"${DLL_PATH_LIST};PATH=path_list_append:${JEMALLOC_LIBRARY_DIRS}/../bin"
358-
)
359+
"${DLL_PATH_LIST};PATH=path_list_append:${JEMALLOC_DLL_DIRS}")
359360
endif()
360361

361362
if(WINDOWS)

cmake/FindJEMALLOC.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ else()
2828
endif()
2929

3030
if(WINDOWS)
31-
find_file(JEMALLOC_DLL NAMES "bin/jemalloc.dll")
31+
find_file(JEMALLOC_DLL NAMES "bin/jemalloc.dll" "jemalloc.dll")
3232
get_filename_component(JEMALLOC_DLL_DIR ${JEMALLOC_DLL} DIRECTORY)
3333
set(JEMALLOC_DLL_DIRS ${JEMALLOC_DLL_DIR})
3434
endif()

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()

cmake/FindTBB.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ else()
2626
endif()
2727

2828
if(WINDOWS)
29-
find_file(TBB_DLL NAMES "bin/tbbmalloc.dll")
29+
find_file(TBB_DLL NAMES "bin/tbbmalloc.dll" "tbbmalloc.dll")
3030
get_filename_component(TBB_DLL_DIR ${TBB_DLL} DIRECTORY)
3131
set(TBB_DLL_DIRS ${TBB_DLL_DIR})
3232
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")
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()

examples/cmake/FindTBB.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ else()
2626
endif()
2727

2828
if(WINDOWS)
29-
find_file(TBB_DLL NAMES "bin/tbbmalloc.dll")
29+
find_file(TBB_DLL NAMES "bin/tbbmalloc.dll" "tbbmalloc.dll")
3030
get_filename_component(TBB_DLL_DIR ${TBB_DLL} DIRECTORY)
3131
set(TBB_DLL_DIRS ${TBB_DLL_DIR})
3232
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)