Skip to content

Commit b6b4ffd

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

File tree

5 files changed

+85
-0
lines changed

5 files changed

+85
-0
lines changed

.github/workflows/basic.yml

Lines changed: 18 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: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows"
177179
strategy:
178180
matrix:
179181
os: ['windows-2019', 'windows-2022']
@@ -208,11 +210,27 @@ jobs:
208210
- name: Checkout
209211
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
210212

213+
- uses: lukka/get-cmake@latest
214+
with:
215+
cmakeVersion: 3.22.6
216+
217+
- name: Initialize vcpkg
218+
uses: lukka/[email protected]
219+
with:
220+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
221+
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
222+
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'
223+
224+
- name: Install dependencies
225+
run: vcpkg install
226+
shell: pwsh # Specifies PowerShell as the shell for running the script.
227+
211228
- name: Configure build
212229
run: >
213230
cmake
214231
-B ${{env.BUILD_DIR}}
215232
${{matrix.toolset}}
233+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
216234
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
217235
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
218236
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}

.github/workflows/codeql.yml

Lines changed: 21 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: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows"
2224
strategy:
2325
fail-fast: false
2426
matrix:
@@ -41,6 +43,24 @@ jobs:
4143
with:
4244
languages: cpp
4345

46+
- if: ${{ matrix.os == 'windows-latest' }}
47+
uses: lukka/get-cmake@latest
48+
with:
49+
cmakeVersion: 3.22.6
50+
51+
- if: ${{ matrix.os == 'windows-latest' }}
52+
name: Initialize vcpkg
53+
uses: lukka/[email protected]
54+
with:
55+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
56+
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
57+
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'
58+
59+
- if: ${{ matrix.os == 'windows-latest' }}
60+
name: Install dependencies
61+
run: vcpkg install
62+
shell: pwsh # Specifies PowerShell as the shell for running the script.
63+
4464
- name: Install apt packages
4565
if: matrix.os == 'ubuntu-latest'
4666
run: |
@@ -55,6 +75,7 @@ jobs:
5575
cmake
5676
-B ${{github.workspace}}/build
5777
${{matrix.extra_build_option}}
78+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
5879
-DUMF_FORMAT_CODE_STYLE=OFF
5980
-DUMF_DEVELOPER_MODE=ON
6081
-DUMF_ENABLE_POOL_TRACKING=ON

.github/workflows/pr_push.yml

Lines changed: 21 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: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows"
1618
strategy:
1719
matrix:
1820
include:
@@ -47,6 +49,24 @@ jobs:
4749
- name: Checkout repository
4850
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4951

52+
- if: ${{ matrix.os == 'windows-latest' }}
53+
uses: lukka/get-cmake@latest
54+
with:
55+
cmakeVersion: 3.22.6
56+
57+
- if: ${{ matrix.os == 'windows-latest' }}
58+
name: Initialize vcpkg
59+
uses: lukka/[email protected]
60+
with:
61+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
62+
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
63+
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'
64+
65+
- if: ${{ matrix.os == 'windows-latest' }}
66+
name: Install dependencies
67+
run: vcpkg install
68+
shell: pwsh # Specifies PowerShell as the shell for running the script.
69+
5070
- name: Install apt packages
5171
if: matrix.os == 'ubuntu-latest'
5272
run: |
@@ -57,6 +77,7 @@ jobs:
5777
run: >
5878
cmake
5979
-B ${{github.workspace}}/build
80+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
6081
-DUMF_FORMAT_CODE_STYLE=OFF
6182
-DUMF_DEVELOPER_MODE=ON
6283
-DUMF_ENABLE_POOL_TRACKING=ON

.github/workflows/sanitizers.yml

Lines changed: 18 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: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows"
111113
strategy:
112114
matrix:
113115
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}]
@@ -131,12 +133,28 @@ jobs:
131133
arch: x64
132134
toolset: 14.38.33130
133135

136+
- uses: lukka/get-cmake@latest
137+
with:
138+
cmakeVersion: 3.22.6
139+
140+
- name: Initialize vcpkg
141+
uses: lukka/[email protected]
142+
with:
143+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
144+
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
145+
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'
146+
147+
- name: Install dependencies
148+
run: vcpkg install
149+
shell: pwsh # Specifies PowerShell as the shell for running the script.
150+
134151
- name: Configure build
135152
run: >
136153
cmake
137154
-B ${{env.BUILD_DIR}}
138155
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
139156
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
157+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
140158
-DUMF_BUILD_SHARED_LIBRARY=OFF
141159
-DUMF_ENABLE_POOL_TRACKING=OFF
142160
-DUMF_FORMAT_CODE_STYLE=OFF

vcpkg.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "main",
3+
"version-string": "latest",
4+
"dependencies": [
5+
"hwloc"
6+
]
7+
}

0 commit comments

Comments
 (0)