|
261 | 261 | when importing GTSAM using the python wrapper. |
262 | 262 |
|
263 | 263 |
|
| 264 | +## Compile gtsam with vcpkg. (For linux/wsl) |
| 265 | +Install python dependencies + ninja + build essential in linux: |
| 266 | +``` |
| 267 | +sudo apt update |
| 268 | +sudo apt-get install autoconf automake autoconf-archive ninja-build build-essential -y |
| 269 | +``` |
| 270 | + |
| 271 | +On your home dir near gtsam dir: |
| 272 | +Setup vcpkg |
| 273 | +```bash |
| 274 | +git clone https://github.com/microsoft/vcpkg |
| 275 | +cd vcpkg |
| 276 | +./bootstrap-vcpkg.sh |
| 277 | +``` |
| 278 | + |
| 279 | +vcpkg install dependencies |
| 280 | +on vcpkg dir: |
| 281 | +```bash |
| 282 | +./vcpkg x-set-installed \ |
| 283 | + boost-assign \ |
| 284 | + boost-bimap \ |
| 285 | + boost-chrono \ |
| 286 | + boost-date-time \ |
| 287 | + boost-filesystem \ |
| 288 | + boost-format \ |
| 289 | + boost-graph \ |
| 290 | + boost-math \ |
| 291 | + boost-program-options \ |
| 292 | + boost-regex \ |
| 293 | + boost-serialization \ |
| 294 | + boost-system \ |
| 295 | + boost-thread \ |
| 296 | + boost-timer \ |
| 297 | + tbb \ |
| 298 | + pybind11 |
| 299 | +``` |
| 300 | + |
| 301 | +Setup python dependencies |
| 302 | +Go to your gtsam folder `cd gtsam`: |
| 303 | +```bash |
| 304 | +../vcpkg/installed/x64-linux/tools/python3/python3 -m ensurepip --upgrade |
| 305 | +../vcpkg/installed/x64-linux/tools/python3/python3 -m pip install -r python/dev_requirements.txt |
| 306 | +``` |
| 307 | + |
| 308 | +Cmake config: |
| 309 | +In gtsam folder |
| 310 | +```bash |
| 311 | +cmake . -B build -G Ninja \ |
| 312 | + -DCMAKE_TOOLCHAIN_FILE=../scripts/buildsystems/vcpkg.cmake \ |
| 313 | + -DVCPKG_INSTALLED_DIR=../installed \ |
| 314 | + -DVCPKG_TARGET_TRIPLET=x64-linux \ |
| 315 | + -DVCPKG_HOST_TRIPLET=x64-linux \ |
| 316 | + -DCMAKE_BUILD_TYPE=Release \ |
| 317 | + -DGTSAM_BUILD_EXAMPLES_ALWAYS=ON \ |
| 318 | + -DGTSAM_ROT3_EXPMAP=ON \ |
| 319 | + -DGTSAM_POSE3_EXPMAP=ON \ |
| 320 | + -DGTSAM_BUILD_PYTHON=ON \ |
| 321 | + -DGTSAM_BUILD_TESTS=ON \ |
| 322 | + -DGTSAM_BUILD_UNSTABLE=ON \ |
| 323 | + -DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \ |
| 324 | + -DGTSAM_USE_SYSTEM_EIGEN=OFF \ |
| 325 | + -DGTSAM_USE_SYSTEM_METIS=OFF \ |
| 326 | + -DGTSAM_USE_SYSTEM_PYBIND=ON \ |
| 327 | + -DGTSAM_SUPPORT_NESTED_DISSECTION=ON |
| 328 | +``` |
| 329 | + |
| 330 | +cmake compile: |
| 331 | +In gtsam folder: |
| 332 | +```bash |
| 333 | +cmake --build build |
| 334 | +``` |
| 335 | + |
| 336 | +Run python tests: |
| 337 | +``` |
| 338 | +VCPKG_INSTALLATION_ROOT=<abs path to vcpkg root dir> |
| 339 | +export PATH="$PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-linux/bin" |
| 340 | +cmake --build build --target python-install |
| 341 | +cmake --build build --target python-test |
| 342 | +cmake --build build --target python-test-unstable |
| 343 | +``` |
| 344 | + |
| 345 | +Run gtsam tests: |
| 346 | +```bash |
| 347 | +cmake --build build --target check |
| 348 | +``` |
0 commit comments