Skip to content

Commit 3ad4b4c

Browse files
authored
Merge pull request #2141 from borglab/release/4.3a0
Release/4.3a0
2 parents 4f66a49 + ce5f93f commit 3ad4b4c

File tree

2,700 files changed

+310116
-58541
lines changed

Some content is hidden

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

2,700 files changed

+310116
-58541
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BasedOnStyle: Google

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name: "Bug Report"
33
about: Submit a bug report to help us improve GTSAM
44
---
55

6+
<!-- This is a channel to report bugs/issues, not a support channel to help install/use/debug your own code. We'd love to help, but just don't have the bandwidth. Please post questions in the GTSAM Google group (https://groups.google.com/forum/#!forum/gtsam-users) -->
7+
68
<!--Please only submit issues/bug reports that come with enough information to reproduce them, ideally a unit test that fails, and possible ideas on what might be wrong. -->
79

810
<!-- Even better yet, fix the bug and/or documentation, add a unit test, and create a pull request! -->
911

10-
<!-- This is a channel to report bugs/issues, not a support channel to help install/use/debug your own code. We'd love to help, but just don't have the bandwidth. Please post questions in the GTSAM Google group (https://groups.google.com/forum/#!forum/gtsam-users) -->
11-
1212
## Description
1313

1414
<!-- A clear description of the bug -->

.github/scripts/boost.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/scripts/python.sh

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,13 @@ set -x -e
99
# install TBB with _debug.so files
1010
function install_tbb()
1111
{
12-
TBB_BASEURL=https://github.com/oneapi-src/oneTBB/releases/download
13-
TBB_VERSION=4.4.5
14-
TBB_DIR=tbb44_20160526oss
15-
TBB_SAVEPATH="/tmp/tbb.tgz"
16-
12+
echo install_tbb
1713
if [ "$(uname)" == "Linux" ]; then
18-
OS_SHORT="lin"
19-
TBB_LIB_DIR="intel64/gcc4.4"
20-
SUDO="sudo"
14+
sudo apt-get -y install libtbb-dev
2115

2216
elif [ "$(uname)" == "Darwin" ]; then
23-
OS_SHORT="osx"
24-
TBB_LIB_DIR=""
25-
SUDO=""
26-
17+
brew install tbb
2718
fi
28-
29-
wget "${TBB_BASEURL}/${TBB_VERSION}/${TBB_DIR}_${OS_SHORT}.tgz" -O $TBB_SAVEPATH
30-
tar -C /tmp -xf $TBB_SAVEPATH
31-
32-
TBBROOT=/tmp/$TBB_DIR
33-
# Copy the needed files to the correct places.
34-
# This works correctly for CI builds, instead of setting path variables.
35-
# This is what Homebrew does to install TBB on Macs
36-
$SUDO cp -R $TBBROOT/lib/$TBB_LIB_DIR/* /usr/local/lib/
37-
$SUDO cp -R $TBBROOT/include/ /usr/local/include/
38-
3919
}
4020

4121
if [ -z ${PYTHON_VERSION+x} ]; then
@@ -56,19 +36,18 @@ function install_dependencies()
5636

5737
export PATH=$PATH:$($PYTHON -c "import site; print(site.USER_BASE)")/bin
5838

59-
[ "${GTSAM_WITH_TBB:-OFF}" = "ON" ] && install_tbb
60-
61-
$PYTHON -m pip install -r $GITHUB_WORKSPACE/python/requirements.txt
39+
if [ "${GTSAM_WITH_TBB:-OFF}" == "ON" ]; then
40+
install_tbb
41+
fi
6242
}
6343

6444
function build()
6545
{
66-
mkdir $GITHUB_WORKSPACE/build
67-
cd $GITHUB_WORKSPACE/build
68-
46+
export CMAKE_GENERATOR=Ninja
6947
BUILD_PYBIND="ON"
70-
71-
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
48+
cmake $GITHUB_WORKSPACE \
49+
-B build \
50+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
7251
-DGTSAM_BUILD_TESTS=OFF \
7352
-DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \
7453
-DGTSAM_USE_QUATERNIONS=OFF \
@@ -79,21 +58,28 @@ function build()
7958
-DGTSAM_UNSTABLE_BUILD_PYTHON=${GTSAM_BUILD_UNSTABLE:-ON} \
8059
-DGTSAM_PYTHON_VERSION=$PYTHON_VERSION \
8160
-DPYTHON_EXECUTABLE:FILEPATH=$(which $PYTHON) \
82-
-DGTSAM_ALLOW_DEPRECATED_SINCE_V42=OFF \
61+
-DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \
8362
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/gtsam_install
8463

8564

8665
# Set to 2 cores so that Actions does not error out during resource provisioning.
87-
make -j2 install
66+
cmake --build build -j2
8867

89-
cd $GITHUB_WORKSPACE/build/python
90-
$PYTHON -m pip install --user .
68+
cmake --build build --target python-install
9169
}
9270

9371
function test()
9472
{
9573
cd $GITHUB_WORKSPACE/python/gtsam/tests
9674
$PYTHON -m unittest discover -v
75+
cd $GITHUB_WORKSPACE
76+
77+
cd $GITHUB_WORKSPACE/python/gtsam_unstable/tests
78+
$PYTHON -m unittest discover -v
79+
cd $GITHUB_WORKSPACE
80+
81+
# cmake --build build --target python-test
82+
# cmake --build build --target python-test-unstable
9783
}
9884

9985
# select between build or test
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# This script calls cibuildwheel to build the wheels for the project. It is used in the build-cibw.yml workflow in .github/workflows.
4+
# Note that the build/python directory contains the wrapper module built for the specified Python version.
5+
6+
set -e
7+
set -x
8+
9+
python -m pip install cibuildwheel
10+
python -m cibuildwheel build/python --output-dir wheelhouse
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
#!/bin/bash
2+
3+
# This script is invoked prior to building the wheels with cibuildwheel. It is used in the build-cibw.yml workflow in .github/workflows.
4+
# It installs the necessary dependencies and builds the wrapper module for the specified Python version.
5+
6+
set -e
7+
set -x
8+
9+
PYTHON_VERSION="$1"
10+
PROJECT_DIR="$2"
11+
ARCH=$(uname -m)
12+
13+
export PYTHON="python${PYTHON_VERSION}"
14+
15+
if [ "$(uname)" == "Linux" ]; then
16+
# manylinux2014 is based on CentOS 7, so use yum to install dependencies
17+
yum install -y wget doxygen
18+
elif [ "$(uname)" == "Darwin" ]; then
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
58+
fi
59+
60+
$(which $PYTHON) -m pip install -r $PROJECT_DIR/python/dev_requirements.txt
61+
62+
# Remove build/cache files that were generated on host
63+
rm -rf $PROJECT_DIR/build
64+
rm -rf CMakeCache.txt CMakeFiles
65+
66+
# Build the Python wrapper module
67+
cmake $PROJECT_DIR \
68+
-B build \
69+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
70+
-DGTSAM_BUILD_TESTS=OFF \
71+
-DGTSAM_BUILD_UNSTABLE=${GTSAM_BUILD_UNSTABLE:-ON} \
72+
-DGTSAM_USE_QUATERNIONS=OFF \
73+
-DGTSAM_WITH_TBB=${GTSAM_WITH_TBB:-OFF} \
74+
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
75+
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \
76+
-DGTSAM_BUILD_PYTHON=ON \
77+
-DGTSAM_UNSTABLE_BUILD_PYTHON=${GTSAM_BUILD_UNSTABLE:-ON} \
78+
-DGTSAM_PYTHON_VERSION=$PYTHON_VERSION \
79+
-DPYTHON_EXECUTABLE:FILEPATH=$(which $PYTHON) \
80+
-DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \
81+
-DCMAKE_INSTALL_PREFIX=$PROJECT_DIR/gtsam_install \
82+
-DGTSAM_GENERATE_DOC_XML=1 \
83+
-DGTWRAP_ADD_DOCSTRINGS=ON
84+
85+
# Generate Doxygen XML documentation
86+
doxygen build/doc/Doxyfile
87+
88+
# Install the Python wrapper module and generate Python stubs
89+
cd $PROJECT_DIR/build/python
90+
if [ "$(uname)" == "Linux" ]; then
91+
make -j $(nproc) install
92+
make -j $(nproc) python-stubs
93+
elif [ "$(uname)" == "Darwin" ]; then
94+
make -j $(sysctl -n hw.logicalcpu) install
95+
make -j $(sysctl -n hw.logicalcpu) python-stubs
96+
fi
97+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env bash
2+
3+
# This script deletes all but the most recent release from the gtsam-develop project on PyPI
4+
# and can be used if the project size exceeds the PyPI limit of 10 GB. The user must have
5+
# owner or maintainer privileges on the project.
6+
7+
set -euo pipefail
8+
9+
usage() {
10+
cat <<EOF
11+
Usage: $(basename "$0") <pypi_username>
12+
13+
Deletes all but the most recent release from the gtsam-develop project on PyPI.
14+
You must supply the PyPI user name that has owner or maintainer privileges on
15+
the project. THIS OPERATION IS PERMANENT.
16+
17+
Examples
18+
$ $(basename "$0") yambati3
19+
$ $(basename "$0") # will prompt for user name
20+
EOF
21+
}
22+
23+
if [[ $# -ge 1 ]]; then
24+
PYPI_USER="$1"
25+
else
26+
read -rp "Enter your PyPI user name: " PYPI_USER
27+
[[ -z "$PYPI_USER" ]] && { echo "No user name supplied."; usage; exit 1; }
28+
fi
29+
30+
echo "-----------------------------------------------------------------------"
31+
echo "WARNING: This WILL permanently delete all but the most recent release"
32+
echo " of 'gtsam-develop' on PyPI for user '$PYPI_USER'."
33+
echo " This cannot be undone."
34+
echo "-----------------------------------------------------------------------"
35+
read -rp "Proceed? [y/N]: " REPLY
36+
REPLY=${REPLY,,} # to lowercase
37+
[[ "$REPLY" != "y" && "$REPLY" != "yes" ]] && { echo "Aborted."; exit 0; }
38+
39+
echo "Running pypi_cleanup for user '$PYPI_USER'..."
40+
python3 -m pypi_cleanup.__init__ \
41+
-p gtsam-develop \
42+
--leave-most-recent-only \
43+
--do-it \
44+
-u "$PYPI_USER"
45+
46+
echo "Done."

0 commit comments

Comments
 (0)