-
Notifications
You must be signed in to change notification settings - Fork 921
168 lines (151 loc) · 5.55 KB
/
vcpkg.yml
File metadata and controls
168 lines (151 loc) · 5.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: vcpkg
on:
pull_request:
# Every time you make a push to your PR, it cancel immediately the previous checks,
# and start a new one. The other runner will be available more quickly to your PR.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
triplet: x64-windows-release
build_type: Release
test_target: RUN_TESTS
binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg\archives
python: python
# check_constraint_program fail on windows. should fix it for windows.
# Remove this excluded test when you fix it for windows.
ctest_extra_flags: -E check_constraint_program
- os: ubuntu-latest
triplet: x64-linux-release
build_type: Release
test_target: test
binary_cache: /home/runner/.cache/vcpkg/archives
cxxflags: -DCMAKE_CXX_FLAGS="-Wno-error=nonnull -Wno-error=maybe-uninitialized"
python: python3
- os: macos-latest
triplet: arm64-osx-release
build_type: Release
test_target: test
binary_cache: /Users/runner/.cache/vcpkg/archives
python: python3
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore cache dependencies
uses: actions/cache/restore@v3
with:
path: ${{ matrix.binary_cache }}
key: ${{ matrix.os }}
restore-keys: ${{ matrix.os }}
- name: Setup msbuild
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
toolset: 14.40
- name: cl version
if: runner.os == 'Windows'
shell: cmd
run: cl
- name: Install vcpkg python dependencies
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get install autoconf automake autoconf-archive
- name: Install vcpkg python dependencies
if: runner.os == 'macOS'
shell: bash
run: |
brew install autoconf automake autoconf-archive
- name: "Install dependencies"
run: >
vcpkg x-set-installed --triplet ${{ matrix.triplet }} --host-triplet ${{ matrix.triplet }}
boost-assign
boost-bimap
boost-chrono
boost-date-time
boost-filesystem
boost-format
boost-graph
boost-math
boost-program-options
boost-regex
boost-serialization
boost-system
boost-thread
boost-timer
eigen3
metis
tbb
pybind11
geographiclib
- name: copy files for hash
shell: bash
run: |
VCPKG_BASH_PATH=${VCPKG_INSTALLATION_ROOT//\\//}
echo $VCPKG_BASH_PATH
mkdir -p vcpkg-info
find $VCPKG_BASH_PATH/installed/ -type f -name 'vcpkg_abi_info.txt' | \
while read filepath; do
triplet=$(echo "$filepath" | awk -F/ '{print $(NF-3)}')
port=$(echo "$filepath" | awk -F/ '{print $(NF-1)}')
cp "$filepath" "vcpkg-info/${triplet}_${port}.txt"
done
- name: Save cache dependencies
uses: actions/cache/save@v4
with:
path: ${{ matrix.binary_cache }}
key: ${{ matrix.os }}-${{ hashFiles('vcpkg-info/*') }}
- name: Install python packages
shell: bash
run: |
$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m ensurepip --upgrade
$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m pip install -r python/dev_requirements.txt
- name: cmake config
if: success()
shell: bash
run: |
export CL=-openmp:experimental
# This is due an error in linux:
# error: argument 2 null where non-null expected [-Werror=nonnull]
# return __builtin_memcmp(__first1, __first2, sizeof(_Tp) * __num);
# Remove `${{ matrix.cxxflags }}` when the compilation error solved
cmake . -B build -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_INSTALLED_DIR=$VCPKG_INSTALLATION_ROOT/installed \
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
-DVCPKG_HOST_TRIPLET=${{ matrix.triplet }} \
-DCMAKE_BUILD_TYPE=Release \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=ON \
-DGTSAM_ROT3_EXPMAP=ON \
-DGTSAM_POSE3_EXPMAP=ON \
-DGTSAM_BUILD_PYTHON=ON \
-DGTSAM_BUILD_TESTS=ON \
-DGTSAM_BUILD_UNSTABLE=OFF \
-DGTSAM_USE_SYSTEM_EIGEN=ON \
-DGTSAM_USE_SYSTEM_METIS=ON \
-DGTSAM_USE_SYSTEM_PYBIND=ON \
-DGTSAM_SUPPORT_NESTED_DISSECTION=ON \
-DCTEST_EXTRA_ARGS="${{ matrix.ctest_extra_flags }}" \
${{ matrix.cxxflags }}
- name: cmake build
shell: bash
run: |
cmake --build build --config Release
- name: Run Python tests
shell: bash
run: |
cmake --build build --target python-install
cmake --build build --target python-test
- name: Run tests
shell: bash
run: |
cmake --build build --target check