Skip to content

Commit 6071d32

Browse files
committed
Install hwloc on Windows using Vcpkg
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 36261a2 commit 6071d32

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

.github/workflows/basic.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ jobs:
174174

175175
windows-build:
176176
name: Windows
177+
env:
178+
HWLOC_PATH: "C:\\vcpkg\\packages\\hwloc_x64-windows\\"
177179
strategy:
178180
matrix:
179181
os: ['windows-2019', 'windows-2022']
@@ -208,11 +210,23 @@ jobs:
208210
- name: Checkout
209211
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
210212

213+
- name: Cache hwloc vcpkg package
214+
uses: actions/cache@v4
215+
id: cache-hwloc-package
216+
with:
217+
path: ${{ env.HWLOC_PATH }}
218+
key: vcpkg-packages-1
219+
220+
- if: ${{ steps.cache-hwloc-package.outputs.cache-hit != 'true' }}
221+
name: Install vcpkg packages
222+
run: vcpkg install hwloc
223+
211224
- name: Configure build
212225
run: >
213226
cmake
214227
-B ${{env.BUILD_DIR}}
215228
${{matrix.toolset}}
229+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
216230
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
217231
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
218232
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}

.github/workflows/codeql.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
name: Analyze
2020
permissions:
2121
security-events: write
22+
env:
23+
HWLOC_PATH: "C:\\vcpkg\\packages\\hwloc_x64-windows\\"
2224
strategy:
2325
fail-fast: false
2426
matrix:
@@ -41,6 +43,18 @@ jobs:
4143
with:
4244
languages: cpp
4345

46+
- if: ${{ matrix.os == 'windows-latest' }}
47+
name: Cache hwloc vcpkg package
48+
uses: actions/cache@v4
49+
id: cache-hwloc-package
50+
with:
51+
path: ${{ env.HWLOC_PATH }}
52+
key: vcpkg-packages-1
53+
54+
- if: ${{ matrix.os == 'windows-latest' }} && ${{ steps.cache-hwloc-package.outputs.cache-hit != 'true' }}
55+
name: Install vcpkg packages
56+
run: vcpkg install hwloc
57+
4458
- name: Install apt packages
4559
if: matrix.os == 'ubuntu-latest'
4660
run: |
@@ -55,6 +69,7 @@ jobs:
5569
cmake
5670
-B ${{github.workspace}}/build
5771
${{matrix.extra_build_option}}
72+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
5873
-DUMF_FORMAT_CODE_STYLE=OFF
5974
-DUMF_DEVELOPER_MODE=ON
6075
-DUMF_ENABLE_POOL_TRACKING=ON

.github/workflows/pr_push.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ permissions:
1313
jobs:
1414
FastBuild:
1515
name: Fast build
16+
env:
17+
HWLOC_PATH: "C:\\vcpkg\\packages\\hwloc_x64-windows\\"
1618
strategy:
1719
matrix:
1820
include:
@@ -47,6 +49,18 @@ jobs:
4749
- name: Checkout repository
4850
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4951

52+
- if: ${{ matrix.os == 'windows-latest' }}
53+
name: Cache hwloc vcpkg package
54+
uses: actions/cache@v4
55+
id: cache-hwloc-package
56+
with:
57+
path: ${{ env.HWLOC_PATH }}
58+
key: vcpkg-packages-1
59+
60+
- if: ${{ matrix.os == 'windows-latest' }} && ${{ steps.cache-hwloc-package.outputs.cache-hit != 'true' }}
61+
name: Install vcpkg packages
62+
run: vcpkg install hwloc
63+
5064
- name: Install apt packages
5165
if: matrix.os == 'ubuntu-latest'
5266
run: |
@@ -57,6 +71,7 @@ jobs:
5771
run: >
5872
cmake
5973
-B ${{github.workspace}}/build
74+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
6075
-DUMF_FORMAT_CODE_STYLE=OFF
6176
-DUMF_DEVELOPER_MODE=ON
6277
-DUMF_ENABLE_POOL_TRACKING=ON

.github/workflows/sanitizers.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ jobs:
108108

109109
windows-build:
110110
name: cl and clang-cl on Windows
111+
env:
112+
HWLOC_PATH: "C:\\vcpkg\\packages\\hwloc_x64-windows\\"
111113
strategy:
112114
matrix:
113115
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
@@ -131,12 +133,24 @@ jobs:
131133
arch: x64
132134
toolset: 14.38.33130
133135

136+
- name: Cache hwloc vcpkg package
137+
uses: actions/cache@v4
138+
id: cache-hwloc-package
139+
with:
140+
path: ${{ env.HWLOC_PATH }}
141+
key: vcpkg-packages-1
142+
143+
- if: ${{ steps.cache-hwloc-package.outputs.cache-hit != 'true' }}
144+
name: Install vcpkg packages
145+
run: vcpkg install hwloc
146+
134147
- name: Configure build
135148
run: >
136149
cmake
137150
-B ${{env.BUILD_DIR}}
138151
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
139152
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
153+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
140154
-DUMF_BUILD_SHARED_LIBRARY=OFF
141155
-DUMF_ENABLE_POOL_TRACKING=OFF
142156
-DUMF_FORMAT_CODE_STYLE=OFF

0 commit comments

Comments
 (0)