Skip to content

Commit 16ab7a1

Browse files
committed
Fallback to hwloc fetch if package not found
Fallback to fetching hwloc from source instead of failing UMF build. Add a workflow for testing the fallback. Unify correct paths to hwloc. Use target name instead of a library path for hwloc linkage.
1 parent ee16bcc commit 16ab7a1

File tree

6 files changed

+156
-194
lines changed

6 files changed

+156
-194
lines changed

.github/workflows/nightly.yml

Lines changed: 67 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
permissions:
1313
contents: read
1414

15+
env:
16+
BUILD_DIR : "${{github.workspace}}/build"
17+
1518
jobs:
1619
fuzz-test:
1720
if: false
@@ -92,18 +95,16 @@ jobs:
9295
- name: Run tests under valgrind
9396
run: ${{github.workspace}}/test/test_valgrind.sh ${{github.workspace}} ${{github.workspace}}/build ${{matrix.tool}}
9497

95-
Windows-Ninja-cl:
96-
name: Windows-Ninja-cl
97-
env:
98-
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"
99-
BUILD_DIR : "${{github.workspace}}/build"
98+
Windows-generators:
99+
name: Windows ${{matrix.generator}} generator
100100
strategy:
101101
matrix:
102102
os: ['windows-2019', 'windows-2022']
103-
build_type: [Debug, Release]
103+
build_type: [Release]
104104
compiler: [{c: cl, cxx: cl}]
105105
shared_library: ['ON', 'OFF']
106106
static_hwloc: ['ON', 'OFF']
107+
generator: ['Ninja', 'NMake Makefiles']
107108

108109
runs-on: ${{matrix.os}}
109110

@@ -113,8 +114,18 @@ jobs:
113114
with:
114115
fetch-depth: 0
115116

117+
- name: Set VCPKG_PATH with hwloc
118+
if: matrix.static_hwloc == 'OFF'
119+
run: echo "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'" >> $env:GITHUB_ENV
120+
121+
- name: Set VCPKG_PATH without hwloc
122+
if: matrix.static_hwloc == 'ON'
123+
run: echo "VCPKG_PATH='${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows'" >> $env:GITHUB_ENV
124+
116125
- name: Initialize vcpkg
117126
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
127+
env:
128+
VCPKG_PATH: ${{env.VCPKG_PATH}}
118129
with:
119130
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
120131
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
@@ -124,6 +135,7 @@ jobs:
124135
run: vcpkg install
125136

126137
- name: Install Ninja
138+
if: matrix.generator == 'Ninja'
127139
uses: seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # v5
128140

129141
- name: Configure MSVC environment
@@ -136,7 +148,7 @@ jobs:
136148
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
137149
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
138150
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
139-
-G Ninja
151+
-G "${{matrix.generator}}"
140152
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
141153
-DUMF_LINK_HWLOC_STATICALLY=${{matrix.static_hwloc}}
142154
-DUMF_FORMAT_CODE_STYLE=OFF
@@ -155,71 +167,10 @@ jobs:
155167
working-directory: ${{env.BUILD_DIR}}
156168
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
157169

158-
Windows-NMake:
159-
name: Windows-NMake
160-
env:
161-
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
162-
BUILD_DIR : "${{github.workspace}}/build"
163-
strategy:
164-
matrix:
165-
os: ['windows-2019', 'windows-2022']
166-
build_type: [Debug, Release]
167-
compiler: [{c: cl, cxx: cl}]
168-
shared_library: ['ON', 'OFF']
169-
170-
runs-on: ${{matrix.os}}
171-
172-
steps:
173-
- name: Checkout
174-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
175-
with:
176-
fetch-depth: 0
177-
178-
- name: Initialize vcpkg
179-
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
180-
with:
181-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
182-
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
183-
vcpkgJsonGlob: '**/vcpkg.json'
184-
185-
- name: Install dependencies
186-
run: vcpkg install
187-
188-
- name: Configure MSVC environment
189-
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
190-
191-
- name: Configure build
192-
run: >
193-
cmake
194-
-B ${{env.BUILD_DIR}}
195-
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
196-
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
197-
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
198-
-G "NMake Makefiles"
199-
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
200-
-DUMF_LINK_HWLOC_STATICALLY=ON
201-
-DUMF_FORMAT_CODE_STYLE=OFF
202-
-DUMF_DEVELOPER_MODE=ON
203-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
204-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
205-
-DUMF_BUILD_CUDA_PROVIDER=ON
206-
-DUMF_TESTS_FAIL_ON_SKIP=ON
207-
208-
- name: Build UMF
209-
shell: cmd
210-
run: cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j %NUMBER_OF_PROCESSORS%
211-
212-
- name: Run tests
213-
shell: cmd
214-
working-directory: ${{env.BUILD_DIR}}
215-
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
216-
217-
218170
icx:
219171
name: ICX
220172
env:
221173
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"
222-
BUILD_DIR : "${{github.workspace}}/build"
223174
strategy:
224175
matrix:
225176
os: ['windows-2019', 'windows-2022']
@@ -301,6 +252,54 @@ jobs:
301252
call "C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat"
302253
ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
303254
255+
hwloc-fallback:
256+
# Scenarios where UMF_LINK_HWLOC_STATICALLY is set to OFF and hwloc is not installed in the system
257+
# The hwloc library is fetched implicitly
258+
name: "Fallback to static hwloc build"
259+
strategy:
260+
matrix:
261+
include:
262+
- os: 'ubuntu-latest'
263+
build_type: Release
264+
number_of_processors: '$(nproc)'
265+
- os: 'windows-latest'
266+
build_type: Release
267+
number_of_processors: '$Env:NUMBER_OF_PROCESSORS'
268+
269+
runs-on: ${{matrix.os}}
270+
271+
steps:
272+
- name: Install dependencies
273+
if: matrix.os == 'ubuntu-latest'
274+
run: sudo apt-get install -y libnuma-dev
275+
276+
- name: Checkout
277+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
278+
with:
279+
fetch-depth: 0
280+
281+
- name: Configure build
282+
run: >
283+
cmake
284+
-B ${{env.BUILD_DIR}}
285+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
286+
-DUMF_BUILD_SHARED_LIBRARY=ON
287+
-DUMF_BUILD_EXAMPLES=OFF
288+
-DUMF_DEVELOPER_MODE=ON
289+
-DUMF_LINK_HWLOC_STATICALLY=OFF
290+
-DUMF_TESTS_FAIL_ON_SKIP=ON
291+
292+
- name: Build UMF
293+
run: >
294+
cmake
295+
--build ${{env.BUILD_DIR}}
296+
--config ${{matrix.build_type}}
297+
-j ${{matrix.number_of_processors}}
298+
299+
- name: Run tests
300+
working-directory: ${{env.BUILD_DIR}}
301+
run: ctest -C ${{matrix.build_type}} --output-on-failure --test-dir test
302+
304303
L0:
305304
uses: ./.github/workflows/reusable_gpu.yml
306305
with:

0 commit comments

Comments
 (0)