Skip to content

Fix Build

Fix Build #103

Workflow file for this run

name: Linux 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 }}
strategy:
fail-fast: true
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-24.04-gcc-14, ubuntu-24.04-clang-16]
build_type: [Debug, Release]
include:
- name: ubuntu-24.04-gcc-14
os: ubuntu-24.04
compiler: gcc
version: "14"
- name: ubuntu-24.04-clang-16
os: ubuntu-24.04
compiler: clang
version: "16"
steps:
- name: Setup Compiler
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 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/bionic/ llvm-toolchain-bionic-9 main"
fi
sudo apt-get -y update
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: Install Dependencies
run: |
sudo apt-get -y install cmake build-essential pkg-config libicu-dev
sudo apt-get -y install libtbb-dev libboost-all-dev
# Install CppUnitLite.
git clone https://github.com/borglab/CppUnitLite.git
cd CppUnitLite && mkdir build && cd $_
cmake .. && sudo make -j4 install
cd ../../
- name: Install GTSAM
run: |
set -e
git clone https://github.com/borglab/gtsam.git /tmp/gtsam_source
cd /tmp/gtsam_source
mkdir build && cd $_
cmake -DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \
-DGTSAM_WITH_TBB=OFF \
-DGTSAM_BUILD_UNSTABLE=OFF \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF ..
sudo make -j4 install
sudo ldconfig
cd ${{ github.workspace }}
rm -rf /tmp/gtsam_source
- name: Checkout
uses: actions/checkout@v4
- name: Build Directory
run: mkdir build
- name: Configure
run: |
cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ..
working-directory: ./build
- name: Build
run: make -j$(nproc)
working-directory: ./build
- name: Test
run: make -j$(nproc) check
working-directory: ./build