-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from borglab/develop
sync to borglab version
- Loading branch information
Showing
1,021 changed files
with
88,730 additions
and
26,913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/bin/bash | ||
|
||
########################################################## | ||
# Build and test the GTSAM Python wrapper. | ||
########################################################## | ||
|
||
set -x -e | ||
|
||
# install TBB with _debug.so files | ||
function install_tbb() | ||
{ | ||
TBB_BASEURL=https://github.com/oneapi-src/oneTBB/releases/download | ||
TBB_VERSION=4.4.5 | ||
TBB_DIR=tbb44_20160526oss | ||
TBB_SAVEPATH="/tmp/tbb.tgz" | ||
|
||
if [ "$(uname)" == "Linux" ]; then | ||
OS_SHORT="lin" | ||
TBB_LIB_DIR="intel64/gcc4.4" | ||
SUDO="sudo" | ||
|
||
elif [ "$(uname)" == "Darwin" ]; then | ||
OS_SHORT="osx" | ||
TBB_LIB_DIR="" | ||
SUDO="" | ||
|
||
fi | ||
|
||
wget "${TBB_BASEURL}/${TBB_VERSION}/${TBB_DIR}_${OS_SHORT}.tgz" -O $TBB_SAVEPATH | ||
tar -C /tmp -xf $TBB_SAVEPATH | ||
|
||
TBBROOT=/tmp/$TBB_DIR | ||
# Copy the needed files to the correct places. | ||
# This works correctly for CI builds, instead of setting path variables. | ||
# This is what Homebrew does to install TBB on Macs | ||
$SUDO cp -R $TBBROOT/lib/$TBB_LIB_DIR/* /usr/local/lib/ | ||
$SUDO cp -R $TBBROOT/include/ /usr/local/include/ | ||
|
||
} | ||
|
||
if [ -z ${PYTHON_VERSION+x} ]; then | ||
echo "Please provide the Python version to build against!" | ||
exit 127 | ||
fi | ||
|
||
PYTHON="python${PYTHON_VERSION}" | ||
|
||
if [[ $(uname) == "Darwin" ]]; then | ||
brew install wget | ||
else | ||
# Install a system package required by our library | ||
sudo apt-get install -y wget libicu-dev python3-pip python3-setuptools | ||
fi | ||
|
||
PATH=$PATH:$($PYTHON -c "import site; print(site.USER_BASE)")/bin | ||
|
||
[ "${GTSAM_WITH_TBB:-OFF}" = "ON" ] && install_tbb | ||
|
||
|
||
BUILD_PYBIND="ON" | ||
TYPEDEF_POINTS_TO_VECTORS="ON" | ||
|
||
sudo $PYTHON -m pip install -r $GITHUB_WORKSPACE/python/requirements.txt | ||
|
||
mkdir $GITHUB_WORKSPACE/build | ||
cd $GITHUB_WORKSPACE/build | ||
|
||
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release \ | ||
-DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_UNSTABLE=ON \ | ||
-DGTSAM_USE_QUATERNIONS=OFF \ | ||
-DGTSAM_WITH_TBB=${GTSAM_WITH_TBB:-OFF} \ | ||
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \ | ||
-DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \ | ||
-DGTSAM_BUILD_PYTHON=${BUILD_PYBIND} \ | ||
-DGTSAM_TYPEDEF_POINTS_TO_VECTORS=${TYPEDEF_POINTS_TO_VECTORS} \ | ||
-DGTSAM_PYTHON_VERSION=$PYTHON_VERSION \ | ||
-DPYTHON_EXECUTABLE:FILEPATH=$(which $PYTHON) \ | ||
-DGTSAM_ALLOW_DEPRECATED_SINCE_V41=OFF \ | ||
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/gtsam_install | ||
|
||
make -j$(nproc) install | ||
|
||
|
||
cd $GITHUB_WORKSPACE/build/python | ||
$PYTHON setup.py install --user --prefix= | ||
cd $GITHUB_WORKSPACE/python/gtsam/tests | ||
$PYTHON -m unittest discover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Linux CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.name }} ${{ matrix.build_type }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
CTEST_OUTPUT_ON_FAILURE: ON | ||
CTEST_PARALLEL_LEVEL: 2 | ||
CMAKE_BUILD_TYPE: ${{ matrix.build_type }} | ||
GTSAM_BUILD_UNSTABLE: ${{ matrix.build_unstable }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Github Actions requires a single row to be added to the build matrix. | ||
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions. | ||
name: [ | ||
ubuntu-18.04-gcc-5, | ||
ubuntu-18.04-gcc-9, | ||
ubuntu-18.04-clang-9, | ||
] | ||
|
||
build_type: [Debug, Release] | ||
build_unstable: [ON] | ||
include: | ||
- name: ubuntu-18.04-gcc-5 | ||
os: ubuntu-18.04 | ||
compiler: gcc | ||
version: "5" | ||
|
||
- name: ubuntu-18.04-gcc-9 | ||
os: ubuntu-18.04 | ||
compiler: gcc | ||
version: "9" | ||
|
||
- name: ubuntu-18.04-clang-9 | ||
os: ubuntu-18.04 | ||
compiler: clang | ||
version: "9" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Install (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
# LLVM (clang) 9 is not in Bionic's repositories so we add the official LLVM repository. | ||
if [ "${{ matrix.compiler }}" = "clang" ] && [ "${{ matrix.version }}" = "9" ]; then | ||
# (ipv4|ha).pool.sks-keyservers.net is the SKS GPG global keyserver pool | ||
# ipv4 avoids potential timeouts because of crappy IPv6 infrastructure | ||
# 15CF4D18AF4F7421 is the GPG key for the LLVM apt repository | ||
# This key is not in the keystore by default for Ubuntu so we need to add it. | ||
LLVM_KEY=15CF4D18AF4F7421 | ||
gpg --keyserver ipv4.pool.sks-keyservers.net --recv-key $LLVM_KEY || gpg --keyserver ha.pool.sks-keyservers.net --recv-key $LLVM_KEY | ||
gpg -a --export $LLVM_KEY | sudo apt-key add - | ||
sudo add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main" | ||
fi | ||
sudo apt-get -y update | ||
sudo apt install cmake build-essential pkg-config libpython-dev python-numpy | ||
echo "BOOST_ROOT=$(echo $BOOST_ROOT_1_72_0)" >> $GITHUB_ENV | ||
echo "LD_LIBRARY_PATH=$(echo $BOOST_ROOT_1_72_0/lib)" >> $GITHUB_ENV | ||
if [ "${{ matrix.compiler }}" = "gcc" ]; then | ||
sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib | ||
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV | ||
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV | ||
else | ||
sudo apt-get install -y clang-${{ matrix.version }} g++-multilib | ||
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV | ||
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV | ||
fi | ||
- name: Check Boost version | ||
if: runner.os == 'Linux' | ||
run: | | ||
echo "BOOST_ROOT = $BOOST_ROOT" | ||
- name: Build and Test (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
bash .github/scripts/unix.sh -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: macOS CI | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.name }} ${{ matrix.build_type }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
env: | ||
CTEST_OUTPUT_ON_FAILURE: ON | ||
CTEST_PARALLEL_LEVEL: 2 | ||
CMAKE_BUILD_TYPE: ${{ matrix.build_type }} | ||
GTSAM_BUILD_UNSTABLE: ${{ matrix.build_unstable }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Github Actions requires a single row to be added to the build matrix. | ||
# See https://help.github.com/en/articles/workflow-syntax-for-github-actions. | ||
name: [ | ||
macOS-10.15-xcode-11.3.1, | ||
] | ||
|
||
build_type: [Debug, Release] | ||
build_unstable: [ON] | ||
include: | ||
- name: macOS-10.15-xcode-11.3.1 | ||
os: macOS-10.15 | ||
compiler: xcode | ||
version: "11.3.1" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Install (macOS) | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew tap ProfFan/robotics | ||
brew install cmake ninja | ||
brew install ProfFan/robotics/boost | ||
if [ "${{ matrix.compiler }}" = "gcc" ]; then | ||
brew install gcc@${{ matrix.version }} | ||
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV | ||
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV | ||
else | ||
sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app | ||
echo "CC=clang" >> $GITHUB_ENV | ||
echo "CXX=clang++" >> $GITHUB_ENV | ||
fi | ||
- name: Build and Test (macOS) | ||
if: runner.os == 'macOS' | ||
run: | | ||
bash .github/scripts/unix.sh -t |
Oops, something went wrong.