Skip to content

Commit f6a6d53

Browse files
Merge branch 'borglab:develop' into develop
2 parents 70f96bf + 3a1188a commit f6a6d53

File tree

130 files changed

+43071
-1833
lines changed

Some content is hidden

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

130 files changed

+43071
-1833
lines changed

.github/scripts/python_wheels/cibw_before_all.sh

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,47 @@ export PYTHON="python${PYTHON_VERSION}"
1414

1515
if [ "$(uname)" == "Linux" ]; then
1616
# manylinux2014 is based on CentOS 7, so use yum to install dependencies
17-
yum install -y wget
18-
19-
# Install Boost from source
20-
wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz --quiet
21-
tar -xzf boost_1_87_0.tar.gz
22-
cd boost_1_87_0
23-
./bootstrap.sh --prefix=/opt/boost
24-
./b2 install --prefix=/opt/boost --with=all
25-
cd ..
17+
yum install -y wget doxygen
2618
elif [ "$(uname)" == "Darwin" ]; then
27-
brew install wget cmake boost
19+
brew install cmake doxygen
20+
21+
# If MACOSX_DEPLOYMENT_TARGET is not explicitly set, default to the version of the host system.
22+
if [[ -z "${MACOSX_DEPLOYMENT_TARGET}" ]]; then
23+
export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -d '.' -f 1-2)"
24+
fi
25+
fi
26+
27+
# Install Boost from source
28+
wget https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz --quiet
29+
tar -xzf boost_1_87_0.tar.gz
30+
cd boost_1_87_0
31+
32+
BOOST_PREFIX="$HOME/opt/boost"
33+
./bootstrap.sh --prefix=${BOOST_PREFIX}
34+
35+
if [ "$(uname)" == "Linux" ]; then
36+
./b2 install --prefix=${BOOST_PREFIX} --with=all -d0
37+
elif [ "$(uname)" == "Darwin" ]; then
38+
./b2 install --prefix=${BOOST_PREFIX} --with=all -d0 \
39+
cxxflags="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
40+
linkflags="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
41+
fi
42+
cd ..
43+
44+
# Export paths so CMake or build system can find Boost
45+
export BOOST_ROOT="${BOOST_PREFIX}"
46+
export BOOST_INCLUDEDIR="${BOOST_PREFIX}/include"
47+
export BOOST_LIBRARYDIR="${BOOST_PREFIX}/lib"
48+
49+
# Ensure runtime linker can find Boost libraries
50+
export LD_LIBRARY_PATH="${BOOST_LIBRARYDIR}:$LD_LIBRARY_PATH" # For Linux
51+
export REPAIR_LIBRARY_PATH="${BOOST_LIBRARYDIR}:$DYLD_LIBRARY_PATH" # For macOS, REPAIR_LIBRARY_PATH is used by delocate
52+
53+
if [ "$(uname)" == "Darwin" ]; then
54+
# Explicitly add rpath to Boost dylibs so delocate can find them
55+
for dylib in ${BOOST_LIBRARYDIR}/*.dylib; do
56+
install_name_tool -add_rpath "@loader_path" "$dylib"
57+
done
2858
fi
2959

3060
$(which $PYTHON) -m pip install -r $PROJECT_DIR/python/dev_requirements.txt
@@ -48,11 +78,15 @@ cmake $PROJECT_DIR \
4878
-DGTSAM_PYTHON_VERSION=$PYTHON_VERSION \
4979
-DPYTHON_EXECUTABLE:FILEPATH=$(which $PYTHON) \
5080
-DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \
51-
-DCMAKE_INSTALL_PREFIX=$PROJECT_DIR/gtsam_install
81+
-DCMAKE_INSTALL_PREFIX=$PROJECT_DIR/gtsam_install \
82+
-DGTSAM_GENERATE_DOC_XML=1 \
83+
-DGTWRAP_ADD_DOCSTRINGS=ON
5284

53-
cd $PROJECT_DIR/build/python
85+
# Generate Doxygen XML documentation
86+
doxygen build/doc/Doxyfile
5487

5588
# Install the Python wrapper module and generate Python stubs
89+
cd $PROJECT_DIR/build/python
5690
if [ "$(uname)" == "Linux" ]; then
5791
make -j $(nproc) install
5892
make -j $(nproc) python-stubs

.github/workflows/build-cibw.yml

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,40 @@ jobs:
7676
manylinux_image: manylinux2014
7777

7878
# MacOS x86_64
79-
# - os: macos-13
80-
# python_version: "3.10"
81-
# cibw_python_version: 310
82-
# platform_id: macosx_x86_64
83-
# - os: macos-13
84-
# python_version: "3.11"
85-
# cibw_python_version: 311
86-
# platform_id: macosx_x86_64
87-
# - os: macos-13
88-
# python_version: "3.12"
89-
# cibw_python_version: 312
90-
# platform_id: macosx_x86_64
91-
# - os: macos-13
92-
# python_version: "3.13"
93-
# cibw_python_version: 313
94-
# platform_id: macosx_x86_64
79+
- os: macos-13
80+
python_version: "3.10"
81+
cibw_python_version: 310
82+
platform_id: macosx_x86_64
83+
- os: macos-13
84+
python_version: "3.11"
85+
cibw_python_version: 311
86+
platform_id: macosx_x86_64
87+
- os: macos-13
88+
python_version: "3.12"
89+
cibw_python_version: 312
90+
platform_id: macosx_x86_64
91+
- os: macos-13
92+
python_version: "3.13"
93+
cibw_python_version: 313
94+
platform_id: macosx_x86_64
95+
96+
# MacOS arm64
97+
- os: macos-14
98+
python_version: "3.10"
99+
cibw_python_version: 310
100+
platform_id: macosx_arm64
101+
- os: macos-14
102+
python_version: "3.11"
103+
cibw_python_version: 311
104+
platform_id: macosx_arm64
105+
- os: macos-14
106+
python_version: "3.12"
107+
cibw_python_version: 312
108+
platform_id: macosx_arm64
109+
- os: macos-14
110+
python_version: "3.13"
111+
cibw_python_version: 313
112+
platform_id: macosx_arm64
95113

96114
steps:
97115
- name: Checkout
@@ -130,6 +148,14 @@ jobs:
130148
run: |
131149
cmake . -B build -DGTSAM_BUILD_PYTHON=1 -DGTSAM_PYTHON_VERSION=${{ matrix.python_version }}
132150
151+
# If on macOS, we previously installed boost using homebrew for the first build.
152+
# We need to uninstall it before building the wheels with cibuildwheel, which will
153+
# install boost from source.
154+
- name: Uninstall Boost (MacOS)
155+
if: runner.os == 'macOS'
156+
run: |
157+
brew uninstall boost
158+
133159
- name: Build and test wheels
134160
env:
135161
# Generate the platform identifier. See https://cibuildwheel.pypa.io/en/stable/options/#build-skip.
@@ -139,6 +165,13 @@ jobs:
139165
CIBW_ARCHS: all
140166
CIBW_ENVIRONMENT_PASS_LINUX: DEVELOP TIMESTAMP
141167

168+
# Set the minimum required MacOS version for the wheels.
169+
MACOSX_DEPLOYMENT_TARGET: 10.15
170+
171+
# Set DYLD_LIBRARY_PATH to REPAIR_LIBRARY_PATH, which is set in cibw_before_all.sh. REPAIR_LIBRARY_PATH
172+
# simply appends BOOST_LIBRARYDIR to the path, which is required during during link-time repair.
173+
CIBW_REPAIR_WHEEL_COMMAND_MACOS: DYLD_LIBRARY_PATH=$REPAIR_LIBRARY_PATH delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
174+
142175
# Use build instead of pip wheel to build the wheels. This is recommended by PyPA.
143176
# See https://cibuildwheel.pypa.io/en/stable/options/#build-frontend.
144177
CIBW_BUILD_FRONTEND: "build"

.github/workflows/build-linux.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Linux CI
33
on:
44
pull_request:
55
paths-ignore:
6-
- '**.md'
7-
- '**.ipynb'
8-
- 'myst.yml'
6+
- "**.md"
7+
- "**.ipynb"
8+
- "myst.yml"
99

1010
# Every time you make a push to your PR, it cancel immediately the previous checks,
1111
# and start a new one. The other runner will be available more quickly to your PR.
@@ -30,25 +30,25 @@ jobs:
3030
# Github Actions requires a single row to be added to the build matrix.
3131
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
3232
name: [
33-
# "Bracket" the versions from GCC [9-14] and Clang [9-16]
34-
ubuntu-20.04-gcc-9,
35-
ubuntu-20.04-clang-9,
33+
# "Bracket" the versions from GCC [9-14] and Clang [11-16]
34+
ubuntu-22.04-gcc-9,
35+
ubuntu-22.04-clang-11,
3636
ubuntu-24.04-gcc-14,
3737
ubuntu-24.04-clang-16,
3838
]
3939

4040
build_type: [Debug, Release]
4141
build_unstable: [ON]
4242
include:
43-
- name: ubuntu-20.04-gcc-9
44-
os: ubuntu-20.04
43+
- name: ubuntu-22.04-gcc-9
44+
os: ubuntu-22.04
4545
compiler: gcc
4646
version: "9"
4747

48-
- name: ubuntu-20.04-clang-9
49-
os: ubuntu-20.04
48+
- name: ubuntu-22.04-clang-11
49+
os: ubuntu-22.04
5050
compiler: clang
51-
version: "9"
51+
version: "11"
5252

5353
- name: ubuntu-24.04-gcc-14
5454
os: ubuntu-24.04

.github/workflows/build-python.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ jobs:
2222
id: filter
2323
uses: dorny/paths-filter@v3
2424
with:
25-
predicate-quantifier: 'every' # If any changed file matches every filter, proceed with build
25+
predicate-quantifier: "every" # If any changed file matches every filter, proceed with build
2626
filters: |
2727
relevant_changes:
2828
- '!**.md'
2929
- '!**.ipynb'
3030
- '!myst.yml'
31-
31+
3232
build:
3333
# Only run build if relevant files have been modified in this PR.
3434
needs: check-paths
3535
if: needs.check-paths.outputs.should_run == 'true'
36-
36+
3737
name: ${{ matrix.name }} ${{ matrix.build_type }} Python ${{ matrix.python_version }}
3838
runs-on: ${{ matrix.os }}
3939

@@ -52,8 +52,8 @@ jobs:
5252
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions.
5353
name:
5454
[
55-
ubuntu-20.04-gcc-9,
56-
ubuntu-20.04-clang-9,
55+
ubuntu-22.04-gcc-9,
56+
ubuntu-22.04-clang-11,
5757
macos-13-xcode-14.2,
5858
macos-14-xcode-15.4,
5959
windows-2022-msbuild,
@@ -62,15 +62,15 @@ jobs:
6262
build_type: [Release]
6363
python_version: [3]
6464
include:
65-
- name: ubuntu-20.04-gcc-9
66-
os: ubuntu-20.04
65+
- name: ubuntu-22.04-gcc-9
66+
os: ubuntu-22.04
6767
compiler: gcc
6868
version: "9"
6969

70-
- name: ubuntu-20.04-clang-9
71-
os: ubuntu-20.04
70+
- name: ubuntu-22.04-clang-11
71+
os: ubuntu-22.04
7272
compiler: clang
73-
version: "9"
73+
version: "11"
7474

7575
- name: macos-13-xcode-14.2
7676
os: macos-13

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ matrices.
1515

1616
The current support matrix is:
1717

18-
| Platform | Compiler | Build Status |
19-
|:------------------:|:---------:|:--------------------------------------------------------------------------------:|
20-
| Ubuntu 20.04/22.04 | gcc/clang | ![Linux CI](https://github.com/borglab/gtsam/workflows/Linux%20CI/badge.svg) |
21-
| macOS | clang | ![macOS CI](https://github.com/borglab/gtsam/workflows/macOS%20CI/badge.svg) |
22-
| Windows | MSVC | ![Windows CI](https://github.com/borglab/gtsam/workflows/Windows%20CI/badge.svg) |
18+
| Platform | Compiler | Build Status |
19+
| :----------------: | :-------: | :------------------------------------------------------------------------------: |
20+
| Ubuntu 22.04/24.04 | gcc/clang | ![Linux CI](https://github.com/borglab/gtsam/workflows/Linux%20CI/badge.svg) |
21+
| macOS | clang | ![macOS CI](https://github.com/borglab/gtsam/workflows/macOS%20CI/badge.svg) |
22+
| Windows | MSVC | ![Windows CI](https://github.com/borglab/gtsam/workflows/Windows%20CI/badge.svg) |
2323

2424

2525
On top of the C++ library, GTSAM includes [wrappers for MATLAB & Python](#wrappers).

doc/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ option(GTSAM_BUILD_DOCS "Enable/Disable building of doxygen doc
44
# configure doxygen
55
option(GTSAM_BUILD_DOC_HTML "Enable/Disable doxygen HTML output" ON)
66
option(GTSAM_BUILD_DOC_LATEX "Enable/Disable doxygen LaTeX output" OFF)
7+
option(GTSAM_GENERATE_DOC_XML "Enable/Disable doxygen XML output" OFF)
78

89
# add a target to generate API documentation with Doxygen
910
if (GTSAM_BUILD_DOCS)
10-
# Convert configuration to YES/NO variables
11+
# The following if statements convert ON/OFF CMake flags to YES/NO variables
12+
# since Doxygen expects YES/NO for boolean options.
1113
if (GTSAM_BUILD_DOC_HTML)
1214
set(GTSAM_BUILD_DOC_HTML_YN "YES")
1315
else()
@@ -20,6 +22,12 @@ if (GTSAM_BUILD_DOCS)
2022
set(GTSAM_BUILD_DOC_LATEX_YN "NO")
2123
endif()
2224

25+
if (GTSAM_GENERATE_DOC_XML)
26+
set(GTSAM_GENERATE_XML_YN "YES")
27+
else()
28+
set(GTSAM_GENERATE_XML_YN "NO")
29+
endif()
30+
2331
# GTSAM core subfolders
2432
set(gtsam_doc_subdirs
2533
gtsam/base

doc/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2120,7 +2120,7 @@ MAN_LINKS = NO
21202120
# captures the structure of the code including all documentation.
21212121
# The default value is: NO.
21222122

2123-
GENERATE_XML = NO
2123+
GENERATE_XML = @GTSAM_GENERATE_XML_YN@
21242124

21252125
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
21262126
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of

doc/examples.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Examples
2+
3+
This section contains python examples in interactive Python notebooks (`*.ipynb`). Python notebooks with an <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> button near the top can be opened in your browser, where you can run the files yourself and make edits to play with and understand GTSAM.

0 commit comments

Comments
 (0)