Skip to content

Tighten limits/collision geometry by success_tolerance #169

Tighten limits/collision geometry by success_tolerance

Tighten limits/collision geometry by success_tolerance #169

name: CMake on multiple platforms
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
# -------------------------------------------------------------------------
# Build + test (developer tree)
# -------------------------------------------------------------------------
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
preset: ci-gcc
- os: ubuntu-latest
preset: ci-clang
- os: windows-latest
preset: ci
# Single-precision build (blast::real = float) with the in-house SQP.
- os: ubuntu-latest
preset: ci-float
steps:
- uses: actions/checkout@v4
- name: Configure CMake
run: cmake --preset ${{ matrix.preset }}
- name: Build
run: cmake --build --preset ${{ matrix.preset }}
- name: Test
run: ctest --preset ${{ matrix.preset }}
# -------------------------------------------------------------------------
# Install + consumer smoke test
# Verifies that find_package(Blast) works from an installed tree. The tiny
# consumer project is generated inline below (not checked into the repo) to
# keep the source tree clean. Only runs on Linux to keep CI fast; the logic
# is platform-agnostic.
# -------------------------------------------------------------------------
install-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Blast
run: >
cmake -B ${{ github.workspace }}/build
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
-S ${{ github.workspace }}
- name: Build Blast
run: cmake --build ${{ github.workspace }}/build --config Release
- name: Install Blast
run: cmake --install ${{ github.workspace }}/build --config Release
- name: Generate consumer smoke test
run: |
mkdir -p "$RUNNER_TEMP/consumer"
cat > "$RUNNER_TEMP/consumer/CMakeLists.txt" <<'EOF'
cmake_minimum_required(VERSION 3.21)
project(blast_consumer CXX)
find_package(Blast REQUIRED)
add_executable(test_consumer main.cpp)
target_link_libraries(test_consumer PRIVATE Blast::blast)
EOF
cat > "$RUNNER_TEMP/consumer/main.cpp" <<'EOF'
// Consumer smoke test — verifies that find_package(Blast) exposes the
// headers/nlopt AND that the AVX2+FMA contract holds: blast::dot uses
// _mm256_fmadd_pd, so this fails to compile unless the installed
// Blast::blast target propagates the required ISA flags (or the
// #error guard fires). No flags are set here on purpose — that is what
// the test checks.
#include <blast>
#include <iostream>
int main() {
blast::Array a({1.0, 2.0, 3.0, 4.0});
blast::Array b({4.0, 3.0, 2.0, 1.0});
blast::real d = blast::dot(a, b); // exercises the AVX2/FMA path
std::cout << "Blast::dot = " << d << "\n";
return (d == 20.0) ? 0 : 1; // 1*4 + 2*3 + 3*2 + 4*1 = 20
}
EOF
- name: Configure consumer
run: >
cmake -B "$RUNNER_TEMP/consumer/build"
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/install
-S "$RUNNER_TEMP/consumer"
- name: Build consumer
run: cmake --build "$RUNNER_TEMP/consumer/build" --config Release
- name: Run consumer
run: "$RUNNER_TEMP/consumer/build/test_consumer"