Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/vcpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
build_type: Release
test_target: RUN_TESTS
binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg\archives
vcpkg_info: C:/vcpkg/installed/vcpkg/info/*
vcpkg_installed: C:/vcpkg/installed/
python: python
# check_constraint_program fail on windows. should fix it for windows.
# Remove this excluded test when you fix it for windows.
Expand All @@ -31,15 +31,15 @@ jobs:
build_type: Release
test_target: test
binary_cache: /home/runner/.cache/vcpkg/archives
vcpkg_info: /usr/local/share/vcpkg/installed/vcpkg/info/*
vcpkg_installed: /usr/local/share/vcpkg/installed/
cxxflags: -DCMAKE_CXX_FLAGS="-Wno-error=nonnull -Wno-error=maybe-uninitialized"
python: python3
- os: macos-latest
triplet: arm64-osx
build_type: Release
test_target: test
binary_cache: /Users/runner/.cache/vcpkg/archives
vcpkg_info: /usr/local/share/vcpkg/installed/vcpkg/info/*
vcpkg_installed: /usr/local/share/vcpkg/installed/
python: python3
steps:
- name: Checkout
Expand Down Expand Up @@ -102,8 +102,14 @@ jobs:
- name: copy files for hash
shell: bash
run: |
echo $VCPKG_INSTALLATION_ROOT
mkdir -p vcpkg-info
cp ${{ matrix.vcpkg_info }} vcpkg-info
find $VCPKG_INSTALLATION_ROOT/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
Expand Down Expand Up @@ -136,11 +142,12 @@ jobs:
-DGTSAM_BUILD_EXAMPLES_ALWAYS=ON \
-DGTSAM_ROT3_EXPMAP=ON \
-DGTSAM_POSE3_EXPMAP=ON \
-DGTSAM_BUILD_PYTHON=OFF \
-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 }}
Expand All @@ -150,12 +157,11 @@ jobs:
run: |
cmake --build build --config Release

# TODO Add cmake detection of external pybind.
# - name: Run Python tests
# shell: bash
# run: |
# cmake --build build --target python-install
# cmake --build build --target python-test
- name: Run Python tests
shell: bash
run: |
cmake --build build --target python-install
cmake --build build --target python-test

- name: Run tests
shell: bash
Expand Down
11 changes: 9 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif()

# Use bundled pybind11 version
add_subdirectory(${PROJECT_SOURCE_DIR}/wrap/pybind11 pybind11)
option(GTSAM_USE_SYSTEM_PYBIND "Find and use system-installed Pybind. If 'off', use the one bundled with GTSAM" OFF)

if(GTSAM_USE_SYSTEM_PYBIND)
# try to find pybind11 on system
find_package(pybind11 REQUIRED)
else()
# Use bundled pybind11 version
add_subdirectory(${PROJECT_SOURCE_DIR}/wrap/pybind11 pybind11)
endif()

# Set the wrapping script variable
set(PYBIND_WRAP_SCRIPT "${PROJECT_SOURCE_DIR}/wrap/scripts/pybind_wrap.py")
Expand Down
Loading