Skip to content

Commit 748870f

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into develop
2 parents d1915f8 + 663bdb6 commit 748870f

File tree

1,353 files changed

+231409
-268135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,353 files changed

+231409
-268135
lines changed

.github/copilot-instructions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
For reviewing PRs:
2+
* All functions in header files should have doxygen-style API docs
3+
* Use /// for single-line comments rather than /** */
4+
* Use meaningful variable names, e.g. `measurement` not `msm`, avoid abbreviations.
5+
* Flag overly complex or long/functions: break up in smaller functions
6+
* On Windows it is necessary to explicitly export all functions from the library which should be externally accessible. To do this, include the macro `GTSAM_EXPORT` in your class or function definition.
7+
* If we add a C++ function to a `.i` file to expose it to the wrapper, we must ensure that the parameter names match exactly between the declaration in the header file and the declaration in the `.i`. Similarly, if we change any parameter names in a wrapped function in a header file, or change any parameter names in a `.i` file, we must change the corresponding function in the other file to reflect those changes.
8+
* Classes are Uppercase, methods and functions lowerMixedCase.
9+
* Apart from those naming conventions, we adopt Google C++ style.

.github/scripts/python.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ function build()
4545
{
4646
export CMAKE_GENERATOR=Ninja
4747
BUILD_PYBIND="ON"
48+
49+
# Add Boost hints on Windows
50+
BOOST_CMAKE_ARGS=""
51+
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" || "$OSTYPE" == "cygwin" ]]; then
52+
if [ -n "${BOOST_ROOT}" ]; then
53+
BOOST_ROOT_UNIX=$(echo "$BOOST_ROOT" | sed 's/\\/\//g')
54+
BOOST_CMAKE_ARGS="-DBOOST_ROOT=${BOOST_ROOT_UNIX} -DBOOST_INCLUDEDIR=${BOOST_ROOT_UNIX}/include -DBOOST_LIBRARYDIR=${BOOST_ROOT_UNIX}/lib"
55+
fi
56+
fi
57+
4858
cmake $GITHUB_WORKSPACE \
4959
-B build \
5060
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
@@ -58,9 +68,11 @@ function build()
5868
-DGTSAM_UNSTABLE_BUILD_PYTHON=${GTSAM_BUILD_UNSTABLE:-ON} \
5969
-DGTSAM_PYTHON_VERSION=$PYTHON_VERSION \
6070
-DPYTHON_EXECUTABLE:FILEPATH=$(which $PYTHON) \
71+
-DGTSAM_USE_BOOST_FEATURES=ON \
72+
-DGTSAM_ENABLE_BOOST_SERIALIZATION=ON \
6173
-DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \
62-
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/gtsam_install
63-
74+
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/gtsam_install \
75+
$BOOST_CMAKE_ARGS
6476

6577
# Set to 2 cores so that Actions does not error out during resource provisioning.
6678
cmake --build build -j2

.github/scripts/python_wheels/cibw_before_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ "$(uname)" == "Linux" ]; then
1616
# manylinux2014 is based on CentOS 7, so use yum to install dependencies
1717
yum install -y wget doxygen
1818
elif [ "$(uname)" == "Darwin" ]; then
19-
brew install cmake doxygen
19+
brew install doxygen
2020

2121
# If MACOSX_DEPLOYMENT_TARGET is not explicitly set, default to the version of the host system.
2222
if [[ -z "${MACOSX_DEPLOYMENT_TARGET}" ]]; then

.github/scripts/python_wheels/cleanup_gtsam_develop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ echo " of 'gtsam-develop' on PyPI for user '$PYPI_USER'."
3333
echo " This cannot be undone."
3434
echo "-----------------------------------------------------------------------"
3535
read -rp "Proceed? [y/N]: " REPLY
36-
REPLY=${REPLY,,} # to lowercase
36+
REPLY=$(echo "$REPLY" | tr '[:upper:]' '[:lower:]') # to lowercase
3737
[[ "$REPLY" != "y" && "$REPLY" != "yes" ]] && { echo "Aborted."; exit 0; }
3838

3939
echo "Running pypi_cleanup for user '$PYPI_USER'..."

.github/scripts/unix.sh

100644100755
Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,13 @@
88
set -e # Make sure any error makes the script to return an error code
99
set -x # echo
1010

11-
# install TBB with _debug.so files
12-
function install_tbb()
13-
{
14-
echo install_tbb
15-
if [ "$(uname)" == "Linux" ]; then
16-
sudo apt-get -y install libtbb-dev
17-
18-
elif [ "$(uname)" == "Darwin" ]; then
19-
brew install tbb
20-
fi
21-
}
2211

2312
# common tasks before either build or test
2413
function configure()
2514
{
2615
# delete old build
2716
rm -rf build
2817

29-
if [ "${GTSAM_WITH_TBB:-OFF}" == "ON" ]; then
30-
install_tbb
31-
fi
32-
33-
if [ ! -z "$GCC_VERSION" ]; then
34-
export CC=gcc-$GCC_VERSION
35-
export CXX=g++-$GCC_VERSION
36-
fi
37-
3818
# GTSAM_BUILD_WITH_MARCH_NATIVE=OFF: to avoid crashes in builder VMs
3919
# CMAKE_CXX_FLAGS="-w": Suppress warnings to avoid IO latency in CI logs
4020
export CMAKE_GENERATOR=Ninja
@@ -52,10 +32,11 @@ function configure()
5232
-DGTSAM_POSE3_EXPMAP=${GTSAM_POSE3_EXPMAP:-ON} \
5333
-DGTSAM_USE_SYSTEM_EIGEN=${GTSAM_USE_SYSTEM_EIGEN:-OFF} \
5434
-DGTSAM_USE_SYSTEM_METIS=${GTSAM_USE_SYSTEM_METIS:-OFF} \
55-
-DGTSAM_USE_BOOST_FEATURES=${GTSAM_USE_BOOST_FEATURES:-ON} \
56-
-DGTSAM_ENABLE_BOOST_SERIALIZATION=${GTSAM_ENABLE_BOOST_SERIALIZATION:-ON} \
35+
-DGTSAM_USE_BOOST_FEATURES=${GTSAM_USE_BOOST_FEATURES:-OFF} \
36+
-DGTSAM_ENABLE_BOOST_SERIALIZATION=${GTSAM_ENABLE_BOOST_SERIALIZATION:-OFF} \
5737
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
58-
-DGTSAM_SINGLE_TEST_EXE=OFF
38+
-DGTSAM_SINGLE_TEST_EXE=${GTSAM_SINGLE_TEST_EXE:-OFF} \
39+
-DGTSAM_ENABLE_GEOGRAPHICLIB=${GTSAM_ENABLE_GEOGRAPHICLIB:-OFF}
5940
}
6041

6142

.github/workflows/build-linux.yml

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
- "**.md"
77
- "**.ipynb"
88
- "myst.yml"
9+
910

10-
# Every time you make a push to your PR, it cancel immediately the previous checks,
11-
# and start a new one. The other runner will be available more quickly to your PR.
11+
# Cancels any in-progress workflow runs for the same PR when a new push is made,
12+
# allowing the runner to become available more quickly for the latest changes.
1213
concurrency:
1314
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1415
cancel-in-progress: true
@@ -17,13 +18,13 @@ jobs:
1718
build:
1819
name: ${{ matrix.name }} ${{ matrix.build_type }}
1920
runs-on: ${{ matrix.os }}
20-
21-
env:
22-
CTEST_OUTPUT_ON_FAILURE: ON
23-
CTEST_PARALLEL_LEVEL: 2
24-
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
25-
GTSAM_BUILD_UNSTABLE: ${{ matrix.build_unstable }}
26-
21+
container:
22+
image: borglab/gtsam-ci:${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.version }}
23+
env:
24+
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
25+
GTSAM_BUILD_UNSTABLE: ${{ matrix.build_unstable }}
26+
volumes:
27+
- ${{ github.workspace }}:/gtsam
2728
strategy:
2829
fail-fast: true
2930
matrix:
@@ -35,6 +36,8 @@ jobs:
3536
ubuntu-22.04-clang-11,
3637
ubuntu-24.04-gcc-14,
3738
ubuntu-24.04-clang-16,
39+
ubuntu-24.04-clang-16-boost,
40+
ubuntu-24.04-clang-16-geographiclib,
3841
]
3942

4043
build_type: [Debug, Release]
@@ -60,40 +63,38 @@ jobs:
6063
compiler: clang
6164
version: "16"
6265

66+
- name: ubuntu-24.04-clang-16-boost
67+
os: ubuntu-24.04
68+
compiler: clang
69+
version: "16"
70+
71+
- name: ubuntu-24.04-clang-16-geographiclib
72+
os: ubuntu-24.04
73+
compiler: clang
74+
version: "16"
75+
76+
exclude:
77+
- name: ubuntu-24.04-clang-16-boost
78+
build_type: Debug
79+
- name: ubuntu-24.04-clang-16-geographiclib
80+
build_type: Debug
81+
6382
steps:
6483
- name: Checkout
6584
uses: actions/checkout@v4
6685

67-
- name: Install Dependencies
86+
- name: Set Boost Environment (Conditional)
87+
if : contains(matrix.name, 'boost') && matrix.build_type == 'Release'
6888
run: |
69-
# LLVM (clang) 9/14 is not in Bionic's repositories so we add the official LLVM repository.
70-
if [ "${{ matrix.compiler }}" = "clang" ]; then
71-
# (ipv4|ha).pool.sks-keyservers.net is the SKS GPG global keyserver pool
72-
# ipv4 avoids potential timeouts because of crappy IPv6 infrastructure
73-
# 15CF4D18AF4F7421 is the GPG key for the LLVM apt repository
74-
# This key is not in the keystore by default for Ubuntu so we need to add it.
75-
LLVM_KEY=15CF4D18AF4F7421
76-
gpg --keyserver keyserver.ubuntu.com --recv-key $LLVM_KEY || gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key $LLVM_KEY
77-
gpg -a --export $LLVM_KEY | sudo apt-key add -
78-
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main"
79-
fi
80-
81-
sudo apt-get -y update
82-
sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libicu-dev ninja-build
83-
84-
if [ "${{ matrix.compiler }}" = "gcc" ]; then
85-
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib
86-
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
87-
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
88-
else
89-
sudo apt-get install -y clang-${{ matrix.version }} g++-multilib
90-
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV
91-
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV
92-
fi
93-
94-
- name: Install Boost
89+
echo "GTSAM_USE_BOOST_FEATURES=ON" >> $GITHUB_ENV
90+
echo "GTSAM_ENABLE_BOOST_SERIALIZATION=ON" >> $GITHUB_ENV
91+
echo "Using Boost features."
92+
93+
- name: Set GeographicLib Environment (Conditional)
94+
if: contains(matrix.name, 'geographiclib') && matrix.build_type == 'Release'
9595
run: |
96-
sudo apt-get -y install libboost-all-dev
96+
echo "GTSAM_ENABLE_GEOGRAPHICLIB=ON" >> $GITHUB_ENV
9797
9898
- name: Build and Test
99-
run: bash .github/scripts/unix.sh -t
99+
run: |
100+
.github/scripts/unix.sh -t

.github/workflows/build-macos.yml

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
- '**.md'
77
- '**.ipynb'
88
- 'myst.yml'
9-
# Every time you make a push to your PR, it cancel immediately the previous checks,
10-
# and start a new one. The other runner will be available more quickly to your PR.
9+
# Cancels any in-progress workflow runs for the same PR when a new push is made,
10+
# allowing the runner to become available more quickly for the latest changes.
1111
concurrency:
1212
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1313
cancel-in-progress: true
@@ -22,6 +22,7 @@ jobs:
2222
CTEST_PARALLEL_LEVEL: 2
2323
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
2424
GTSAM_BUILD_UNSTABLE: ${{ matrix.build_unstable }}
25+
GTSAM_ALLOW_DEPRECATED_SINCE_V43: OFF
2526

2627
strategy:
2728
fail-fast: true
@@ -31,6 +32,8 @@ jobs:
3132
name: [
3233
macos-13-xcode-14.2,
3334
macos-14-xcode-15.4,
35+
macos-14-xcode-15.4-boost,
36+
macos-14-xcode-15.4-geographiclib,
3437
]
3538

3639
build_type: [Debug, Release]
@@ -46,16 +49,46 @@ jobs:
4649
compiler: xcode
4750
version: "15.4"
4851

52+
- name: macos-14-xcode-15.4-boost
53+
os: macos-14
54+
compiler: xcode
55+
version: "15.4"
56+
57+
- name: macos-14-xcode-15.4-geographiclib
58+
os: macos-14
59+
compiler: xcode
60+
version: "15.4"
61+
62+
exclude:
63+
- name: macos-14-xcode-15.4-boost
64+
build_type: Debug
65+
- name: macos-14-xcode-15.4-geographiclib
66+
build_type: Debug
67+
4968
steps:
5069
- name: Checkout
5170
uses: actions/checkout@v4
5271

5372
- name: Install Dependencies
5473
run: |
55-
brew install cmake ninja
56-
brew install boost
74+
brew upgrade cmake --quiet || brew install cmake --quiet
75+
brew upgrade ninja --quiet || brew install ninja --quiet
5776
sudo xcode-select -switch /Applications/Xcode.app
5877
echo "CC=clang" >> $GITHUB_ENV
5978
echo "CXX=clang++" >> $GITHUB_ENV
79+
80+
- name: Install Boost
81+
if: contains(matrix.name, 'boost') && matrix.build_type == 'Release'
82+
run: |
83+
brew upgrade boost --quiet || brew install boost --quiet
84+
echo "GTSAM_USE_BOOST_FEATURES=ON" >> $GITHUB_ENV
85+
echo "GTSAM_ENABLE_BOOST_SERIALIZATION=ON" >> $GITHUB_ENV
86+
87+
- name: Install GeographicLib
88+
if: contains(matrix.name, 'geographiclib') && matrix.build_type == 'Release'
89+
run: |
90+
brew upgrade geographiclib --quiet || brew install geographiclib --quiet
91+
echo "GTSAM_ENABLE_GEOGRAPHICLIB=ON" >> $GITHUB_ENV
92+
6093
- name: Build and Test
6194
run: bash .github/scripts/unix.sh -t

.github/workflows/build-python.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,19 @@ name: Python CI
33
# Since this is a required check, specify paths-ignore in the check-paths job
44
# instead of under 'pull_request:'. Otherwise, the check is still required but
55
# never runs, and a maintainer must bypass the check in order to merge the PR.
6-
on: [pull_request]
6+
on:
7+
push:
8+
branches:
9+
- develop
10+
paths-ignore:
11+
- '**.md'
12+
- '**.ipynb'
13+
- 'myst.yml'
14+
pull_request:
15+
paths-ignore:
16+
- '**.md'
17+
- '**.ipynb'
18+
- 'myst.yml'
719

820
# Every time you make a push to your PR, it cancel immediately the previous checks,
921
# and start a new one. The other runner will be available more quickly to your PR.
@@ -18,11 +30,13 @@ jobs:
1830
outputs:
1931
should_run: ${{ steps.filter.outputs.relevant_changes }}
2032
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
2136
- name: Check modified files
2237
id: filter
2338
uses: dorny/paths-filter@v3
2439
with:
25-
predicate-quantifier: "every" # If any changed file matches every filter, proceed with build
2640
filters: |
2741
relevant_changes:
2842
- '!**.md'
@@ -44,6 +58,7 @@ jobs:
4458
PYTHON_VERSION: ${{ matrix.python_version }}
4559
BOOST_VERSION: 1.72.0
4660
BOOST_EXE: boost_1_72_0-msvc-14.2
61+
GTSAM_ALLOW_DEPRECATED_SINCE_V43: OFF
4762

4863
strategy:
4964
fail-fast: true
@@ -120,9 +135,17 @@ jobs:
120135
- name: Install (macOS)
121136
if: runner.os == 'macOS'
122137
run: |
123-
brew tap ProfFan/robotics
124-
brew install cmake ninja
125-
brew install boost
138+
brew update
139+
# Avoid reinstalling cmake when a pinned/local tap version is preinstalled on the runner.
140+
if brew list cmake >/dev/null 2>&1; then
141+
echo "cmake already installed"
142+
cmake --version
143+
else
144+
brew install cmake
145+
fi
146+
# Install ninja and boost only if missing
147+
brew list ninja >/dev/null 2>&1 || brew install ninja
148+
brew list boost >/dev/null 2>&1 || brew install boost
126149
sudo xcode-select -switch /Applications/Xcode.app
127150
echo "CC=clang" >> $GITHUB_ENV
128151
echo "CXX=clang++" >> $GITHUB_ENV

0 commit comments

Comments
 (0)