Skip to content

Commit 0acba5e

Browse files
committed
Use vcpkg manifest
1 parent 413e196 commit 0acba5e

File tree

6 files changed

+47
-45
lines changed

6 files changed

+47
-45
lines changed

.github/workflows/vcpkg.yml

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -92,27 +92,7 @@ jobs:
9292
echo "VCPKG_INSTALLATION_ROOT=$VCPKG_BASH_PATH" >> "$GITHUB_ENV"
9393
9494
- 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 }}
95+
run: vcpkg install --triplet ${{ matrix.triplet }} --host-triplet ${{ matrix.triplet }}
11696

11797
- name: On Failure, upload vcpkg logs
11898
if: failure()
@@ -125,9 +105,8 @@ jobs:
125105
- name: copy files for hash
126106
shell: bash
127107
run: |
128-
echo $VCPKG_INSTALLATION_ROOT
129108
mkdir -p vcpkg-info
130-
find $VCPKG_INSTALLATION_ROOT/installed/ -type f -name 'vcpkg_abi_info.txt' | \
109+
find vcpkg_installed/ -type f -name 'vcpkg_abi_info.txt' | \
131110
while read filepath; do
132111
triplet=$(echo "$filepath" | awk -F/ '{print $(NF-3)}')
133112
port=$(echo "$filepath" | awk -F/ '{print $(NF-1)}')
@@ -145,8 +124,8 @@ jobs:
145124
- name: Install python packages
146125
shell: bash
147126
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
127+
vcpkg_installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m ensurepip --upgrade
128+
vcpkg_installed/${{ matrix.triplet }}/tools/python3/${{ matrix.python }} -m pip install -r python/dev_requirements.txt
150129
151130
- name: Set Swap Space (Linux)
152131
if: runner.os == 'Linux'
@@ -162,7 +141,7 @@ jobs:
162141
163142
cmake . -B build -G Ninja \
164143
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake \
165-
-DVCPKG_INSTALLED_DIR=$VCPKG_INSTALLATION_ROOT/installed \
144+
-DVCPKG_INSTALLED_DIR=$RUNNER_WORKSPACE/vcpkg_installed \
166145
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} \
167146
-DVCPKG_HOST_TRIPLET=${{ matrix.triplet }} \
168147
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
@@ -192,7 +171,7 @@ jobs:
192171
- name: Run Python tests
193172
shell: bash
194173
run: |
195-
export PATH="$PATH:$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/bin"
174+
export PATH="$PATH:$RUNNER_WORKSPACE/vcpkg_installed/${{ matrix.triplet }}/bin"
196175
cmake --build build --target python-install
197176
cmake --build build --target python-test
198177
cmake --build build --target python-test-unstable

cmake/HandleBoost.cmake

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,8 @@ endif()
3939
################################################################################
4040

4141
# Set minimum required Boost version and components.
42-
# NOTE: "system" is intentionally omitted. It is a transitive dependency of other
43-
# components (like filesystem) and will be found automatically. Explicitly
44-
# requesting it can cause issues with modern header-only versions of Boost.
4542
set(BOOST_FIND_MINIMUM_VERSION 1.70)
46-
set(BOOST_FIND_MINIMUM_COMPONENTS serialization filesystem thread program_options date_time timer chrono regex)
43+
set(BOOST_FIND_MINIMUM_COMPONENTS serialization thread program_options date_time timer chrono regex)
4744

4845
# Find the Boost package. On systems with modern installations (vcpkg, Homebrew),
4946
# this will use CMake's "Config mode". With manual installations (especially on
@@ -53,7 +50,7 @@ find_package(Boost ${BOOST_FIND_MINIMUM_VERSION} REQUIRED
5350
)
5451

5552
# Verify that the required Boost component targets were successfully found and imported.
56-
foreach(_t IN ITEMS Boost::serialization Boost::filesystem Boost::thread Boost::date_time)
53+
foreach(_t IN ITEMS Boost::serialization Boost::thread Boost::date_time)
5754
if(NOT TARGET ${_t})
5855
message(FATAL_ERROR "Missing required Boost component target: ${_t}. Please install/upgrade Boost or set BOOST_ROOT/Boost_DIR correctly.")
5956
endif()
@@ -63,7 +60,6 @@ option(GTSAM_DISABLE_NEW_TIMERS "Disables using Boost.chrono for timing" OFF)
6360

6461
set(GTSAM_BOOST_LIBRARIES
6562
Boost::serialization
66-
Boost::filesystem
6763
Boost::thread
6864
Boost::date_time
6965
Boost::regex

gtsam/base/serializationTestHelpers.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#if GTSAM_ENABLE_BOOST_SERIALIZATION
2525

26+
#include <filesystem>
2627
#include <iostream>
2728
#include <sstream>
2829
#include <string>
@@ -31,7 +32,6 @@
3132
#include <gtsam/base/TestableAssertions.h>
3233

3334
#include <boost/serialization/serialization.hpp>
34-
#include <boost/filesystem.hpp>
3535

3636

3737
// whether to print the serialized text to stdout
@@ -47,10 +47,10 @@ T create() {
4747
}
4848

4949
// Creates or empties a folder in the build folder and returns the relative path
50-
inline boost::filesystem::path resetFilesystem(
51-
boost::filesystem::path folder = "actual") {
52-
boost::filesystem::remove_all(folder);
53-
boost::filesystem::create_directory(folder);
50+
inline std::filesystem::path resetFilesystem(
51+
std::filesystem::path folder = "actual") {
52+
std::filesystem::remove_all(folder);
53+
std::filesystem::create_directory(folder);
5454
return folder;
5555
}
5656

@@ -65,7 +65,7 @@ void roundtrip(const T& input, T& output) {
6565
// Templated round-trip serialization using a file
6666
template<class T>
6767
void roundtripFile(const T& input, T& output) {
68-
boost::filesystem::path path = resetFilesystem()/"graph.dat";
68+
std::filesystem::path path = resetFilesystem()/"graph.dat";
6969
serializeToFile(input, path.string());
7070
deserializeFromFile(path.string(), output);
7171
}
@@ -106,7 +106,7 @@ void roundtripXML(const T& input, T& output) {
106106
// Templated round-trip serialization using XML File
107107
template<class T>
108108
void roundtripXMLFile(const T& input, T& output) {
109-
boost::filesystem::path path = resetFilesystem()/"graph.xml";
109+
std::filesystem::path path = resetFilesystem()/"graph.xml";
110110
serializeToXMLFile(input, path.string());
111111
deserializeFromXMLFile(path.string(), output);
112112
}
@@ -147,7 +147,7 @@ void roundtripBinary(const T& input, T& output) {
147147
// Templated round-trip serialization using Binary file
148148
template<class T>
149149
void roundtripBinaryFile(const T& input, T& output) {
150-
boost::filesystem::path path = resetFilesystem()/"graph.bin";
150+
std::filesystem::path path = resetFilesystem()/"graph.bin";
151151
serializeToBinaryFile(input, path.string());
152152
deserializeFromBinaryFile(path.string(), output);
153153
}

gtsam_unstable/linear/QPSParser.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#include <boost/fusion/include/vector.hpp>
3434
#include <boost/fusion/sequence.hpp>
35-
#include <boost/lambda/lambda.hpp>
3635
#include <boost/phoenix/bind.hpp>
3736
#include <boost/spirit/include/classic.hpp>
3837
#include <boost/spirit/include/qi.hpp>

gtsam_unstable/slam/tests/testSerialization.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717

1818
#include <CppUnitLite/TestHarness.h>
1919

20-
#include <boost/filesystem.hpp>
21-
20+
#include <filesystem>
2221
#include <iostream>
2322
#include <cstdlib>
2423
#include <fstream>
2524
#include <sstream>
2625

2726
using namespace std;
2827
using namespace gtsam;
29-
namespace fs = boost::filesystem;
28+
namespace fs = std::filesystem;
3029
#ifdef TOPSRCDIR
3130
static string topdir = TOPSRCDIR;
3231
#else

vcpkg.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
],
28+
"builtin-baseline": "74e6536215718009aae747d86d84b78376bf9e09"
29+
}

0 commit comments

Comments
 (0)