Skip to content

Use doublecross instead of cross(Cross(a, b)) in NavState #4191

Use doublecross instead of cross(Cross(a, b)) in NavState

Use doublecross instead of cross(Cross(a, b)) in NavState #4191

Workflow file for this run

name: Special Cases CI
on:
pull_request:
paths-ignore:
- '**.md'
- '**.ipynb'
- 'myst.yml'
# Cancels any in-progress workflow runs for the same PR when a new push is made,
# allowing the runner to become available more quickly for the latest changes.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
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: ON
GTSAM_SINGLE_TEST_EXE: ON
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-clang-deprecated,
ubuntu-clang-quaternions,
ubuntu-clang-tbb,
ubuntu-clang-cayleymap,
ubuntu-clang-system-libs,
ubuntu-no-unstable,
ubuntu-build-examples,
]
build_type: [Release]
include:
- name: ubuntu-clang-deprecated
os: ubuntu-22.04
compiler: clang
version: "14"
flag: deprecated
- name: ubuntu-clang-quaternions
os: ubuntu-22.04
compiler: clang
version: "14"
flag: quaternions
- name: ubuntu-clang-tbb
os: ubuntu-22.04
compiler: clang
version: "14"
flag: tbb
- name: ubuntu-clang-cayleymap
os: ubuntu-22.04
compiler: clang
version: "14"
flag: cayley
- name: ubuntu-clang-system-libs
os: ubuntu-22.04
compiler: clang
version: "14"
flag: system
- name: ubuntu-no-unstable
os: ubuntu-22.04
compiler: clang
version: "14"
flag: no_unstable
- name: ubuntu-build-examples
os: ubuntu-22.04
compiler: clang
version: "14"
flag: build_examples
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get -y update
sudo apt-get -y install software-properties-common
# LLVM (clang) 9/14 is not in 22.04 (jammy)'s repositories so we add the official LLVM repository.
if [ "${{ matrix.compiler }}" = "clang" ]; 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 keyserver.ubuntu.com --recv-key $LLVM_KEY || gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-key $LLVM_KEY
gpg -a --export $LLVM_KEY | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
fi
sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libicu-dev ninja-build
sudo apt-get install -y clang-${{ matrix.version }} g++-multilib mold
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV
- name: Set Allow Deprecated Flag
if: matrix.flag == 'deprecated'
run: |
echo "GTSAM_ALLOW_DEPRECATED_SINCE_V43=ON" >> $GITHUB_ENV
echo "Allow deprecated since version 4.3"
- name: Set Use Quaternions Flag
if: matrix.flag == 'quaternions'
run: |
echo "GTSAM_USE_QUATERNIONS=ON" >> $GITHUB_ENV
echo "Use Quaternions for rotations"
- name: Set GTSAM_WITH_TBB Flag
if: matrix.flag == 'tbb'
run: |
echo "GTSAM_WITH_TBB=ON" >> $GITHUB_ENV
echo "GTSAM Uses TBB"
- name: Use Cayley Transform for Rot3
if: matrix.flag == 'cayley'
run: |
echo "GTSAM_POSE3_EXPMAP=OFF" >> $GITHUB_ENV
echo "GTSAM_ROT3_EXPMAP=OFF" >> $GITHUB_ENV
echo "GTSAM Uses Cayley map for Rot3"
- name: Build Examples
if: matrix.flag == 'build_examples'
run: |
echo "GTSAM_BUILD_EXAMPLES_ALWAYS=ON" >> $GITHUB_ENV
- name: Use system versions of 3rd party libraries
if: matrix.flag == 'system'
run: |
sudo apt-get install libeigen3-dev
echo "GTSAM_USE_SYSTEM_EIGEN=ON" >> $GITHUB_ENV
sudo apt-get install libmetis-dev
echo "GTSAM_USE_SYSTEM_METIS=ON" >> $GITHUB_ENV
- name: Turn off unstable
if: matrix.flag == 'no_unstable'
run: |
echo "GTSAM_BUILD_UNSTABLE=OFF" >> $GITHUB_ENV
echo "GTSAM 'unstable' will not be built."
- name: Create swap (Linux only)
if: runner.os == 'Linux'
shell: bash
run: |
# Attempts to create and enable a swap file at /mnt/swapfile.
# It tries different sizes (8G, 4G, 2G, 1G) until successful.
set -euo pipefail
SWAP=/mnt/swapfile
sudo swapoff $SWAP 2>/dev/null || true
sudo rm -f $SWAP
for SIZE in 8 4 2 1; do
if sudo fallocate -l ${SIZE}G $SWAP; then
sudo chmod 600 $SWAP
sudo mkswap $SWAP
sudo swapon $SWAP && break
fi
sudo rm -f $SWAP
done
# Displays active swap spaces at the end.
swapon --show
- name: Build & Test
env:
LDFLAGS: "-fuse-ld=mold"
run: |
export CMAKE_EXE_LINKER_FLAGS="$LDFLAGS"
export CMAKE_SHARED_LINKER_FLAGS="$LDFLAGS"
bash .github/scripts/unix.sh -t