Skip to content

Commit 5015283

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

File tree

5 files changed

+89
-0
lines changed

5 files changed

+89
-0
lines changed

.github/workflows/basic.yml

Lines changed: 19 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,28 @@ jobs:
208210
- name: Checkout
209211
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
210212

213+
- name: Get CMake for lukka/run-vcpkg
214+
uses: lukka/get-cmake@latest
215+
with:
216+
cmakeVersion: 3.22.6
217+
218+
- name: Initialize vcpkg
219+
uses: lukka/[email protected]
220+
with:
221+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
222+
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
223+
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'
224+
225+
- name: Install dependencies
226+
run: vcpkg install
227+
shell: pwsh # Specifies PowerShell as the shell for running the script.
228+
211229
- name: Configure build
212230
run: >
213231
cmake
214232
-B ${{env.BUILD_DIR}}
215233
${{matrix.toolset}}
234+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
216235
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
217236
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
218237
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}

.github/workflows/codeql.yml

Lines changed: 22 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,25 @@ jobs:
4143
with:
4244
languages: cpp
4345

46+
- name: Get CMake for lukka/run-vcpkg
47+
if: ${{ matrix.os == 'windows-latest' }}
48+
uses: lukka/get-cmake@latest
49+
with:
50+
cmakeVersion: 3.22.6
51+
52+
- name: Initialize vcpkg
53+
if: ${{ matrix.os == 'windows-latest' }}
54+
uses: lukka/[email protected]
55+
with:
56+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
57+
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
58+
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'
59+
60+
- name: Install dependencies
61+
if: ${{ matrix.os == 'windows-latest' }}
62+
run: vcpkg install
63+
shell: pwsh # Specifies PowerShell as the shell for running the script.
64+
4465
- name: Install apt packages
4566
if: matrix.os == 'ubuntu-latest'
4667
run: |
@@ -55,6 +76,7 @@ jobs:
5576
cmake
5677
-B ${{github.workspace}}/build
5778
${{matrix.extra_build_option}}
79+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
5880
-DUMF_FORMAT_CODE_STYLE=OFF
5981
-DUMF_DEVELOPER_MODE=ON
6082
-DUMF_ENABLE_POOL_TRACKING=ON

.github/workflows/pr_push.yml

Lines changed: 22 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,25 @@ jobs:
4749
- name: Checkout repository
4850
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4951

52+
- name: Get CMake for lukka/run-vcpkg
53+
if: ${{ matrix.os == 'windows-latest' }}
54+
uses: lukka/get-cmake@latest
55+
with:
56+
cmakeVersion: 3.22.6
57+
58+
- name: Initialize vcpkg
59+
if: ${{ matrix.os == 'windows-latest' }}
60+
uses: lukka/[email protected]
61+
with:
62+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
63+
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
64+
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'
65+
66+
- name: Install dependencies
67+
if: ${{ matrix.os == 'windows-latest' }}
68+
run: vcpkg install
69+
shell: pwsh # Specifies PowerShell as the shell for running the script.
70+
5071
- name: Install apt packages
5172
if: matrix.os == 'ubuntu-latest'
5273
run: |
@@ -57,6 +78,7 @@ jobs:
5778
run: >
5879
cmake
5980
-B ${{github.workspace}}/build
81+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
6082
-DUMF_FORMAT_CODE_STYLE=OFF
6183
-DUMF_DEVELOPER_MODE=ON
6284
-DUMF_ENABLE_POOL_TRACKING=ON

.github/workflows/sanitizers.yml

Lines changed: 19 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,29 @@ jobs:
131133
arch: x64
132134
toolset: 14.38.33130
133135

136+
- name: Get CMake for lukka/run-vcpkg
137+
uses: lukka/get-cmake@latest
138+
with:
139+
cmakeVersion: 3.22.6
140+
141+
- name: Initialize vcpkg
142+
uses: lukka/[email protected]
143+
with:
144+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
145+
vcpkgDirectory: ${{ github.workspace }}/build/vcpkg
146+
vcpkgConfigurationJsonGlob: '**/vcpkg-configuration.json'
147+
148+
- name: Install dependencies
149+
run: vcpkg install
150+
shell: pwsh # Specifies PowerShell as the shell for running the script.
151+
134152
- name: Configure build
135153
run: >
136154
cmake
137155
-B ${{env.BUILD_DIR}}
138156
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
139157
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
158+
-DCMAKE_PREFIX_PATH=${{env.HWLOC_PATH}}
140159
-DUMF_BUILD_SHARED_LIBRARY=OFF
141160
-DUMF_ENABLE_POOL_TRACKING=OFF
142161
-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)