Skip to content

Commit b619b12

Browse files
committed
Use vcpkg manifest
1 parent 2cd0a7c commit b619b12

File tree

3 files changed

+44
-43
lines changed

3 files changed

+44
-43
lines changed

.github/workflows/vcpkg.yml

Lines changed: 13 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
uses: actions/cache/restore@v3
4949
with:
5050
path: ${{ matrix.binary_cache }}
51-
key: ${{ matrix.os }}
52-
restore-keys: ${{ matrix.os }}
51+
key: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}
52+
restore-keys: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}
5353

5454
- name: Setup msbuild
5555
if: runner.os == 'Windows'
@@ -61,13 +61,6 @@ jobs:
6161
- name: Install sccache
6262
uses: mozilla-actions/sccache-action@v0.0.9
6363

64-
- name: Use sccache
65-
shell: bash
66-
run: |
67-
echo "SCCACHE_GHA_ENABLED=ON" >> "$GITHUB_ENV"
68-
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
69-
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
70-
7164
- name: cl version
7265
if: runner.os == 'Windows'
7366
shell: cmd
@@ -85,34 +78,8 @@ jobs:
8578
run: |
8679
brew install autoconf autoconf-archive automake libtool
8780
88-
- name: Set vcpkg installtion root env
89-
shell: bash
90-
run: |
91-
VCPKG_BASH_PATH=${VCPKG_INSTALLATION_ROOT//\\//}
92-
echo "VCPKG_INSTALLATION_ROOT=$VCPKG_BASH_PATH" >> "$GITHUB_ENV"
93-
9481
- name: "Install dependencies"
95-
run: >
96-
vcpkg x-set-installed --triplet ${{ matrix.triplet }} --host-triplet ${{ matrix.triplet }}
97-
boost-assign
98-
boost-bimap
99-
boost-chrono
100-
boost-date-time
101-
boost-filesystem
102-
boost-format
103-
boost-graph
104-
boost-math
105-
boost-program-options
106-
boost-regex
107-
boost-serialization
108-
boost-system
109-
boost-thread
110-
boost-timer
111-
tbb
112-
pybind11
113-
geographiclib
114-
eigen3
115-
${{ matrix.additional_vcpkg_ports }}
82+
run: vcpkg install --triplet ${{ matrix.triplet }} --host-triplet ${{ matrix.triplet }}
11683

11784
- name: On Failure, upload vcpkg logs
11885
if: failure()
@@ -125,9 +92,8 @@ jobs:
12592
- name: copy files for hash
12693
shell: bash
12794
run: |
128-
echo $VCPKG_INSTALLATION_ROOT
12995
mkdir -p vcpkg-info
130-
find $VCPKG_INSTALLATION_ROOT/installed/ -type f -name 'vcpkg_abi_info.txt' | \
96+
find vcpkg_installed/ -type f -name 'vcpkg_abi_info.txt' | \
13197
while read filepath; do
13298
triplet=$(echo "$filepath" | awk -F/ '{print $(NF-3)}')
13399
port=$(echo "$filepath" | awk -F/ '{print $(NF-1)}')
@@ -136,17 +102,17 @@ jobs:
136102
137103
- name: Save cache dependencies
138104
# Don't save if it's the exact same
139-
if: steps.cache-restore.outputs.cache-matched-key != format('{0}-{1}', matrix.os, hashFiles('vcpkg-info/*'))
105+
if: steps.cache-restore.outputs.cache-matched-key != format('{0}-{1}-{2}', matrix.os, hashFiles('vcpkg.json'), hashFiles('vcpkg-info/*'))
140106
uses: actions/cache/save@v4
141107
with:
142108
path: ${{ matrix.binary_cache }}
143-
key: ${{ matrix.os }}-${{ hashFiles('vcpkg-info/*') }}
109+
key: ${{ matrix.os }}-${{ hashFiles('vcpkg.json') }}-${{ hashFiles('vcpkg-info/*') }}
144110

145111
- name: Install python packages
146112
shell: bash
147113
run: |
148-
$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m ensurepip --upgrade
149-
$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m pip install -r python/dev_requirements.txt
114+
vcpkg_installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m ensurepip --upgrade
115+
vcpkg_installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m pip install -r python/dev_requirements.txt
150116
151117
- name: Set Swap Space (Linux)
152118
if: runner.os == 'Linux'
@@ -162,7 +128,7 @@ jobs:
162128
163129
cmake . -B build -G Ninja \
164130
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake \
165-
-DVCPKG_INSTALLED_DIR=$VCPKG_INSTALLATION_ROOT/installed \
131+
-DVCPKG_INSTALLED_DIR=$RUNNER_WORKSPACE/vcpkg_installed \
166132
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
167133
-DVCPKG_HOST_TRIPLET=${{ matrix.triplet }} \
168134
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
@@ -183,6 +149,10 @@ jobs:
183149
-DGTSAM_WITH_EIGEN_MKL_OPENMP=ON \
184150
-DCTEST_EXTRA_ARGS='${{ matrix.ctest_extra_flags }}' \
185151
-DPYTEST_EXTRA_ARGS='${{ matrix.pytest_extra_flags }}'
152+
env:
153+
SCCACHE_GHA_ENABLED: ON
154+
CMAKE_C_COMPILER_LAUNCHER: sccache
155+
CMAKE_CXX_COMPILER_LAUNCHER: sccache
186156

187157
- name: cmake build
188158
shell: bash

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
.vscode
1515
.env
1616
/.vs/
17+
vcpkg_installed/
1718
/CMakeSettings.json
1819
# for QtCreator:
1920
CMakeLists.txt.user*

vcpkg.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"dependencies": [
3+
"boost-concept-check",
4+
"boost-fusion",
5+
"boost-graph",
6+
"boost-move",
7+
"boost-optional",
8+
"boost-phoenix",
9+
"boost-pool",
10+
"boost-program-options",
11+
"boost-random",
12+
"boost-range",
13+
"boost-serialization",
14+
"boost-smart-ptr",
15+
"boost-spirit",
16+
"boost-thread",
17+
"boost-timer",
18+
"boost-tokenizer",
19+
"boost-type-traits",
20+
{
21+
"name": "intel-mkl",
22+
"platform": "windows,linux"
23+
},
24+
"tbb",
25+
"pybind11",
26+
"geographiclib",
27+
"eigen3"
28+
],
29+
"builtin-baseline": "84bab45d415d22042bd0b9081aea57f362da3f35"
30+
}

0 commit comments

Comments
 (0)