Skip to content

Commit 6d6e8b0

Browse files
committed
set custom name for hwloc lib
1 parent 19c67d1 commit 6d6e8b0

File tree

6 files changed

+103
-199
lines changed

6 files changed

+103
-199
lines changed

.github/workflows/basic.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,49 @@ 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+
name: "Windows dynamic UMF + mingw libhwloc"
360+
strategy:
361+
matrix:
362+
build_type: [Release]
363+
364+
runs-on: 'windows-2022'
365+
366+
steps:
367+
- name: Checkout
368+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
369+
with:
370+
fetch-depth: 0
371+
372+
- name: Get hwloc from offitial repo (mingw version)
373+
run: |
374+
curl https://download.open-mpi.org/release/hwloc/v2.10/hwloc-win64-build-2.10.0.zip -o ${{github.workspace}}\hwloc-win64-build-2.10.0.zip
375+
Expand-Archive ${{github.workspace}}\hwloc-win64-build-2.10.0.zip -DestinationPath ${{github.workspace}}
376+
377+
- name: Get TBB from github
378+
run: |
379+
curl https://github.com/oneapi-src/oneTBB/releases/download/v2021.12.0/oneapi-tbb-2021.12.0-win.zip -o ${{github.workspace}}\oneapi-tbb-2021.12.0-win.zip
380+
Expand-Archive ${{github.workspace}}\oneapi-tbb-2021.12.0-win.zip -DestinationPath ${{github.workspace}}
381+
382+
- name: Configure build
383+
run: >
384+
cmake
385+
-B ${{env.BUILD_DIR}}
386+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}};${{github.workspace}}\hwloc-win64-build-2.10.0;${{github.workspace}}\oneapi-tbb-2021.12.0"
387+
-DUMF_BUILD_SHARED_LIBRARY=ON
388+
-DUMF_BUILD_EXAMPLES=ON
389+
-DUMF_FORMAT_CODE_STYLE=ON
390+
-DUMF_DEVELOPER_MODE=ON
391+
-DUMF_TESTS_FAIL_ON_SKIP=ON
392+
-DUMF_HWLOC_NAME=libhwloc
393+
351394
- name: Build UMF
352395
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
353396

.github/workflows/fast.yml

Lines changed: 21 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -11,141 +11,45 @@ env:
1111
INSTL_DIR : "${{github.workspace}}/../install-dir"
1212

1313
jobs:
14-
FastBuild:
15-
name: Fast builds
16-
env:
17-
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
14+
windows-dynamic_mingw_hwloc:
15+
name: "Windows dynamic UMF + mingw libhwloc"
1816
strategy:
1917
matrix:
20-
include:
21-
- os: windows-latest
22-
disjoint: 'OFF'
23-
build_tests: 'ON'
24-
simple_cmake: 'OFF'
25-
# pure C build (Windows)
26-
- os: windows-latest
27-
disjoint: 'OFF'
28-
# Tests' building is off for a pure C build
29-
build_tests: 'OFF'
30-
simple_cmake: 'OFF'
31-
- os: ubuntu-latest
32-
disjoint: 'ON'
33-
build_tests: 'ON'
34-
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
35-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON'
36-
simple_cmake: 'OFF'
37-
# pure C build (Linux)
38-
- os: ubuntu-latest
39-
disjoint: 'OFF'
40-
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
41-
# Tests' building is off for a pure C build
42-
build_tests: 'OFF'
43-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON'
44-
simple_cmake: 'OFF'
45-
# simplest CMake on ubuntu-latest
46-
- os: ubuntu-latest
47-
disjoint: 'OFF'
48-
build_tests: 'ON'
49-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release'
50-
simple_cmake: 'ON'
51-
# simplest CMake ubuntu-20.04
52-
- os: ubuntu-20.04
53-
disjoint: 'OFF'
54-
build_tests: 'ON'
55-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release'
56-
simple_cmake: 'ON'
57-
runs-on: ${{ (matrix.os == 'ubuntu-latest' && github.repository_owner == 'oneapi-src') && 'intel-ubuntu-22.04' || matrix.os }}
18+
build_type: [Release]
19+
20+
runs-on: 'windows-2022'
5821

5922
steps:
60-
- name: Checkout repository
23+
- name: Checkout
6124
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6225
with:
6326
fetch-depth: 0
6427

65-
- name: Initialize vcpkg
66-
if: matrix.os == 'windows-latest'
67-
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
68-
with:
69-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
70-
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
71-
vcpkgJsonGlob: '**/vcpkg.json'
72-
73-
- name: Install dependencies
74-
if: matrix.os == 'windows-latest'
75-
run: vcpkg install
76-
shell: pwsh # Specifies PowerShell as the shell for running the script.
77-
78-
- name: Install apt packages (ubuntu-latest)
79-
if: matrix.os == 'ubuntu-latest'
28+
- name: Get hwloc from offitial repo (mingw version)
8029
run: |
81-
sudo apt-get update
82-
sudo apt-get install -y cmake libjemalloc-dev libhwloc-dev libnuma-dev libtbb-dev
30+
curl https://download.open-mpi.org/release/hwloc/v2.10/hwloc-win64-build-2.10.0.zip -o ${{github.workspace}}\hwloc-win64-build-2.10.0.zip
31+
Expand-Archive ${{github.workspace}}\hwloc-win64-build-2.10.0.zip -DestinationPath ${{github.workspace}}
8332
84-
- name: Install apt packages (ubuntu-20.04)
85-
if: matrix.os == 'ubuntu-20.04'
33+
- name: Get TBB from github
8634
run: |
87-
sudo apt-get update
88-
sudo apt-get install -y cmake libjemalloc-dev libnuma-dev libtbb-dev
89-
.github/scripts/install_hwloc.sh # install hwloc-2.3.0 instead of hwloc-2.1.0 present in the OS package
90-
91-
- name: Set ptrace value for IPC test (on Linux only)
92-
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-20.04' }}
93-
run: sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"
35+
curl https://github.com/oneapi-src/oneTBB/releases/download/v2021.12.0/oneapi-tbb-2021.12.0-win.zip -o ${{github.workspace}}\oneapi-tbb-2021.12.0-win.zip
36+
Expand-Archive ${{github.workspace}}\oneapi-tbb-2021.12.0-win.zip -DestinationPath ${{github.workspace}}
9437
95-
- name: Configure CMake
96-
if: matrix.simple_cmake == 'OFF'
38+
- name: Configure build
9739
run: >
9840
cmake
9941
-B ${{env.BUILD_DIR}}
100-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
101-
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
102-
-DUMF_FORMAT_CODE_STYLE=OFF
103-
-DUMF_DEVELOPER_MODE=ON
104-
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=${{matrix.disjoint}}
105-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
106-
-DUMF_BUILD_TESTS=${{matrix.build_tests}}
107-
-DUMF_BUILD_EXAMPLES=ON
108-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
109-
-DUMF_TESTS_FAIL_ON_SKIP=ON
110-
-DUMF_BUILD_SHARED_LIBRARY=ON
111-
${{matrix.extra_build_options}}
112-
113-
- name: Configure CMake (simple)
114-
if: matrix.simple_cmake == 'ON'
115-
run: >
116-
cmake
117-
-B ${{env.BUILD_DIR}}
118-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
42+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}};${{github.workspace}}\hwloc-win64-build-2.10.0;${{github.workspace}}\oneapi-tbb-2021.12.0"
11943
-DUMF_BUILD_SHARED_LIBRARY=ON
44+
-DUMF_BUILD_EXAMPLES=ON
45+
-DUMF_FORMAT_CODE_STYLE=ON
46+
-DUMF_DEVELOPER_MODE=ON
12047
-DUMF_TESTS_FAIL_ON_SKIP=ON
121-
${{matrix.extra_build_options}}
122-
123-
- name: Build
124-
run: cmake --build ${{env.BUILD_DIR}} --config Release -j
48+
-DUMF_HWLOC_NAME=libhwloc
12549
126-
- name: Run examples
127-
working-directory: ${{env.BUILD_DIR}}
128-
run: ctest --output-on-failure --test-dir examples -C Release
50+
- name: Build UMF
51+
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
12952

13053
- name: Run tests
131-
if: matrix.build_tests == 'ON'
13254
working-directory: ${{env.BUILD_DIR}}
133-
run: ctest --output-on-failure --test-dir test -C Release
134-
135-
- name: check /DEPENDENTLOADFLAG (Windows only)
136-
if: matrix.os == 'windows-latest'
137-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/bin/Release/umf.dll
138-
shell: pwsh
139-
140-
- name: check /DEPENDENTLOADFLAG in umf_proxy.dll
141-
if: matrix.os == 'windows-latest'
142-
run: ${{github.workspace}}/.github/scripts/check_dll_flags.ps1 ${{env.BUILD_DIR}}/src/proxy_lib/Release/umf_proxy.dll
143-
shell: pwsh
144-
145-
# TODO: We could add some script to verify metadata of dll's (selected fields, perhaps)
146-
# ref. https://superuser.com/questions/381276/what-are-some-nice-command-line-ways-to-inspect-dll-exe-details
147-
- name: Print metadata of our dll's
148-
if: matrix.os == 'windows-latest'
149-
run: |
150-
get-command ${{github.workspace}}/build/bin/Release/umf.dll | format-list
151-
get-command ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll | format-list
55+
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test

.github/workflows/pr_push.yml

Lines changed: 31 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -15,94 +15,47 @@ permissions:
1515
contents: read
1616

1717
jobs:
18-
CodeStyle:
19-
name: Coding style
20-
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
2118

22-
steps:
23-
- name: Checkout repository
24-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25-
with:
26-
fetch-depth: 0
19+
windows-dynamic_mingw_hwloc:
20+
name: "Windows dynamic UMF + mingw libhwloc"
21+
strategy:
22+
matrix:
23+
build_type: [Release]
2724

28-
- name: Install apt packages
29-
run: |
30-
sudo apt-get update
31-
sudo apt-get install -y black cmake clang-format-15 cmake-format libhwloc-dev
32-
33-
- name: Configure CMake
34-
run: >
35-
cmake
36-
-B ${{github.workspace}}/build
37-
-DUMF_FORMAT_CODE_STYLE=ON
38-
-DUMF_BUILD_TESTS=OFF
39-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
40-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=OFF
41-
42-
- name: Check C/C++ formatting
43-
run: cmake --build build --target clang-format-check
44-
45-
- name: Check CMake formatting
46-
run: |
47-
cmake --build build --target cmake-format-apply
48-
git diff --exit-code
49-
50-
- name: Check Python formatting
51-
run: cmake --build build --target black-format-check
52-
53-
DocsBuild:
54-
name: Build docs
55-
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
25+
runs-on: 'windows-2022'
5626

5727
steps:
58-
- name: Checkout repository
28+
- name: Checkout
5929
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6030
with:
6131
fetch-depth: 0
6232

63-
- name: Install doxygen
33+
- name: Get hwloc from offitial repo (mingw version)
6434
run: |
65-
sudo apt-get update
66-
sudo apt-get install -y doxygen
35+
curl https://download.open-mpi.org/release/hwloc/v2.10/hwloc-win64-build-2.10.0.zip -o ${{github.workspace}}\hwloc-win64-build-2.10.0.zip
36+
Expand-Archive ${{github.workspace}}\hwloc-win64-build-2.10.0.zip -DestinationPath ${{github.workspace}}
6737
68-
- name: Install pip requirements
69-
run: python3 -m pip install -r third_party/requirements.txt
38+
- name: Get TBB from github
39+
run: curl https://github.com/oneapi-src/oneTBB/releases/download/v2021.12.0/oneapi-tbb-2021.12.0-win.zip -o ${{github.workspace}}\oneapi-tbb-2021.12.0-win.zip
40+
41+
- name: aaa
42+
run: Expand-Archive ${{github.workspace}}\oneapi-tbb-2021.12.0-win.zip -DestinationPath ${{github.workspace}}
7043

71-
- name: Setup PATH for python
72-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
44+
- name: Configure build
45+
run: >
46+
cmake
47+
-B ${{env.BUILD_DIR}}
48+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}};${{github.workspace}}\hwloc-win64-build-2.10.0;${{github.workspace}}\oneapi-tbb-2021.12.0"
49+
-DUMF_BUILD_SHARED_LIBRARY=ON
50+
-DUMF_BUILD_EXAMPLES=ON
51+
-DUMF_FORMAT_CODE_STYLE=ON
52+
-DUMF_DEVELOPER_MODE=ON
53+
-DUMF_TESTS_FAIL_ON_SKIP=ON
54+
-DUMF_HWLOC_NAME=libhwloc
7355
74-
- name: Build the documentation
75-
working-directory: scripts
76-
run: python3 generate_docs.py
56+
- name: Build UMF
57+
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS
7758

78-
Spellcheck:
79-
uses: ./.github/workflows/spellcheck.yml
80-
FastBuild:
81-
name: Fast builds
82-
needs: [Spellcheck, CodeStyle]
83-
uses: ./.github/workflows/fast.yml
84-
Build:
85-
name: Basic builds
86-
needs: [FastBuild]
87-
uses: ./.github/workflows/basic.yml
88-
Sanitizers:
89-
needs: [FastBuild]
90-
uses: ./.github/workflows/sanitizers.yml
91-
Qemu:
92-
needs: [FastBuild]
93-
uses: ./.github/workflows/qemu.yml
94-
Benchmarks:
95-
needs: [Build]
96-
uses: ./.github/workflows/benchmarks.yml
97-
ProxyLib:
98-
needs: [Build]
99-
uses: ./.github/workflows/proxy_lib.yml
100-
GPU:
101-
needs: [Build]
102-
uses: ./.github/workflows/gpu.yml
103-
Valgrind:
104-
needs: [Build]
105-
uses: ./.github/workflows/valgrind.yml
106-
MultiNuma:
107-
needs: [Build]
108-
uses: ./.github/workflows/multi_numa.yml
59+
- name: Run tests
60+
working-directory: ${{env.BUILD_DIR}}
61+
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test

CMakeLists.txt

Lines changed: 4 additions & 0 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)

cmake/FindLIBHWLOC.cmake

Lines changed: 2 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,7 @@ 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")
4242
get_filename_component(LIBHWLOC_DLL_DIR ${LIBHWLOC_DLL} DIRECTORY)
4343
set(LIBHWLOC_DLL_DIRS ${LIBHWLOC_DLL_DIR})
4444
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)