Skip to content

Relicence to dual-licenced AGPL-3.0-only + commercial with CLA #15

Relicence to dual-licenced AGPL-3.0-only + commercial with CLA

Relicence to dual-licenced AGPL-3.0-only + commercial with CLA #15

Workflow file for this run

# Configure CMake for a number of CMake versions, but do not compile.
name: CMake
on:
# Branch pushes that do not only modify other workflow files
push:
branches:
- '**'
paths:
- "**"
- "!.github/**"
- ".github/scripts/install_cuda_ubuntu.sh"
- ".github/workflows/CMake.yml"
# Allow manual invocation.
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
configure:
runs-on: ${{ matrix.cudacxx.os }}
strategy:
fail-fast: false
# Multiplicative build matrix
matrix:
cudacxx:
# CUDA 13.x on linux and windows
- cuda: "13.0"
cuda_arch: "75"
hostcxx: gcc-13
os: ubuntu-24.04
- cuda: "13.0.0"
cuda_arch: "75"
hostcxx: "Visual Studio 17 2022"
os: windows-2025
config:
- name: "Release"
config: "Release"
# 'default' or '' will not install cmake, otherwise provide a full semver version.
cmake:
# Default in the runner
- "default"
# 4.x
- "4.0.0"
# Most recent 3.x release
- "3.31.8"
# Oldest supported CMake (for c++20 CUDA)
- "3.25.2"
# Name the job based on matrix/env options
name: "build (${{ matrix.cmake }}, ${{ matrix.cudacxx.cuda }}, ${{ matrix.config.name }}, ${{ matrix.cudacxx.os }})"
# Define job-wide env constants, and promote matrix elements to env constants for portable steps.
env:
# Define constants
BUILD_DIR: "build"
# Port matrix options to environment, for more portability.
CUDA: ${{ matrix.cudacxx.cuda }}
CUDA_ARCH: ${{ matrix.cudacxx.cuda_arch }}
HOSTCXX: ${{ matrix.cudacxx.hostcxx }}
OS: ${{ matrix.cudacxx.os }}
CONFIG: ${{ matrix.config.config }}
# Kept for portable steps between this and the main repository.
VISUALISATION: "ON"
# Include the cmake version in the environment
CMAKE: ${{ matrix.cmake }}
steps:
- uses: actions/checkout@v4
- name: Install cmake from GitHub Releases (Linux)
if: ${{ startswith(env.OS, 'ubuntu') && env.CMAKE != '' && env.CMAKE != 'default' }}
working-directory: ${{ runner.temp }}
run: |
wget -q https://github.com/Kitware/CMake/releases/download/v${{ env.CMAKE }}/cmake-${{ env.CMAKE }}-linux-x86_64.tar.gz
tar -zxvf cmake-${{ env.CMAKE }}-linux-x86_64.tar.gz
# Inner directory case changes in some releases, use find to get the right path
echo "$(dirname $(find $(pwd) -wholename "*/bin/cmake" -exec echo {} \; -quit))" >> $GITHUB_PATH
- name: Install cmake from GitHub Releases (Windows)
if: ${{ runner.os == 'Windows' && env.CMAKE != '' && env.CMAKE != 'default' }}
working-directory: ${{ runner.temp }}
run: |
curl -s -L -O https://github.com/Kitware/CMake/releases/download/v${{ env.CMAKE }}/cmake-${{ env.CMAKE }}-windows-x86_64.zip
ls
7z.exe x "cmake-${{ env.CMAKE }}-windows-x86_64.zip" -o"cmake-${{ env.CMAKE }}-windows-x86_64"
echo "$(dirname $(find $(pwd) -wholename "*/bin/cmake.exe" -exec echo {} \; -quit))" >> $GITHUB_PATH
- name: Install CUDA (Ubuntu)
if: ${{ startswith(env.OS, 'ubuntu') && env.CUDA != '' }}
env:
cuda: ${{ env.CUDA }}
run: .github/scripts/install_cuda_ubuntu.sh
- name: Install CUDA (Windows)
if: ${{ runner.os == 'Windows' && env.CUDA != '' }}
shell: powershell
timeout-minutes: 35
env:
cuda: ${{ env.CUDA }}
visual_studio: ${{ env.HOSTCXX }}
run: |
if ([version]$env:cuda -ge [version]"12.0") {
.github\scripts\install_cuda_windows_redist.ps1
} else {
.github\scripts\install_cuda_windows.ps1
}
- name: Install/Select gcc and g++
if: ${{ startsWith(env.HOSTCXX, 'gcc-') }}
run: |
gcc_version=${HOSTCXX//gcc-/}
sudo apt-get install -y gcc-${gcc_version} g++-${gcc_version}
echo "CC=/usr/bin/gcc-${gcc_version}" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-${gcc_version}" >> $GITHUB_ENV
echo "CUDAHOSTCXX=/usr/bin/g++-${gcc_version}" >> $GITHUB_ENV
- name: Install Visualisation Dependencies
if: ${{ startswith(env.OS, 'ubuntu') && env.VISUALISATION == 'ON' }}
run: |
# Install ubuntu-24.04 packages
if [ "$OS" == 'ubuntu-24.04' ]; then
sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev
fi
# Install ubuntu-22.04 packages
if [ "$OS" == 'ubuntu-22.04' ]; then
sudo apt-get install -y libglew-dev libfontconfig1-dev libsdl2-dev libdevil-dev libfreetype-dev
fi
- name: Add custom problem matchers for annotations
run: echo "::add-matcher::.github/problem-matchers.json"
- name: Configure cmake
run: >
cmake . -B "${{ env.BUILD_DIR }}"
-DCMAKE_BUILD_TYPE="${{ env.CONFIG }}"
-Werror=dev
-DCMAKE_WARN_DEPRECATED="ON"
-DFLAMEGPU_WARNINGS_AS_ERRORS="ON"
-DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCH }}"
- name: Build
working-directory: ${{ env.BUILD_DIR }}
run: cmake --build . --verbose -j `nproc`