Skip to content
Draft

CMake #2157

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ca800e8
cmake: transition: phase 1
brendan-nasa Jul 2, 2026
1a2de52
git-ignore object files in project root; cleanup and dedupe gitignore
brendan-nasa Jul 2, 2026
d03aa43
cmake: transition: phase 2
brendan-nasa Jul 6, 2026
c152866
cmake: transition: phase 1: fix configuration mismatches from CI
brendan-nasa Jul 6, 2026
f0ad2c5
cmake: transition: phase 3
brendan-nasa Jul 6, 2026
5432b72
cmake: transition: phase 2: Fixes to globs and GSL flags
brendan-nasa Jul 6, 2026
781a7e7
cmake: transition: phase 4
brendan-nasa Jul 7, 2026
449a336
cmake: transition: fix CommandLineArguments test that assumed an
brendan-nasa Jul 7, 2026
c92c896
cmake: transition: all sim tests
brendan-nasa Jul 7, 2026
0e6023b
cmake: transition: more ci logging
brendan-nasa Jul 7, 2026
5bc5c72
cmake: transition: ruff format
brendan-nasa Jul 7, 2026
9c9146d
cmake: transition: fix errors found in ci
brendan-nasa Jul 7, 2026
b829142
cmake: transition: fix civetweb/GSL/-m32 gating
brendan-nasa Jul 8, 2026
e5a09b0
cmake: transition: fix HDF5 flag pass through
brendan-nasa Jul 8, 2026
3805216
cmake: transition: use modern cmake features
brendan-nasa Jul 8, 2026
0e78e7a
cmake: transition: move cmake file under cmake/
brendan-nasa Jul 8, 2026
08dcab1
cmake: transition: remove dead code
brendan-nasa Jul 14, 2026
52a6270
cmake: transition: Simplify udunits2 import
brendan-nasa Jul 14, 2026
704bc10
cmake: transition: Simplify hdf5 import
brendan-nasa Jul 14, 2026
625cc8a
cmake: transition: Consolidate ICG flags into TrickClangLibs.cmake
brendan-nasa Jul 14, 2026
abe3ef4
cmake: transition: fail configure if standard library mismatch
brendan-nasa Jul 16, 2026
9dba3a7
fix trickops python warnings and modernize to python v3.10 style
brendan-nasa Aug 29, 2026
f8ed10d
Ruff format
brendan-nasa Jul 16, 2026
f285aa5
Ruff lint fixes
brendan-nasa Jul 16, 2026
acc1a24
Support python version installed on RHEL 8 (3.6)
brendan-nasa Jul 17, 2026
8a1106f
Revert python script changes to only ones needed for cmake compatibility
brendan-nasa Jul 17, 2026
d8d3d37
ruff: lint
brendan-nasa Jul 17, 2026
86bb385
ruff format
brendan-nasa Jul 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 186 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,192 @@ jobs:
needs: [style]
uses: ./.github/workflows/_test-macos.yml

cmake-configure:
name: CMake Configure (${{ matrix.cfg.os }} ${{ matrix.cfg.tag }})
needs: [style]
# TODO: Remove always() once style enforcement is stable — ideally builds only run on clean style.
if: always()
runs-on: ubuntu-latest
container: docker://${{ matrix.cfg.image }}:${{ matrix.cfg.tag }}
strategy:
fail-fast: false
matrix:
cfg:
- { os: ubuntu, tag: 24.04, arch: debian, image: ubuntu }
- { os: ubuntu, tag: 26.04, arch: debian, image: ubuntu }
- { os: rockylinux, tag: 9, arch: rhel, image: rockylinux/rockylinux }
include:
- cfg: {}
deps: >-
bison
clang
flex
git
llvm
make
maven
cmake
swig
zip
gdb
conf_pkg: echo package manager already configured
enable_repo: ""
install_cmd: install -y

#-------- Debian-based Dependencies ----------------
- cfg: { arch: debian }
pkg_mgr: apt-get
conf_pkg: apt-get update
arch_deps: >-
curl
g++
libx11-dev
libxml2-dev
libxt-dev
libmotif-common
libmotif-dev
zlib1g-dev
llvm-dev
libclang-dev
libudunits2-dev
libgtest-dev
libgmock-dev
libgsl-dev
libhdf5-dev
default-jdk
python3-dev
python3-pip
python3-venv
python3-yaml
python3-psutil

#-------- RHEL-based Dependencies (all versions) ----------------
- cfg: { arch: rhel }
pkg_mgr: dnf
conf_pkg: |
dnf -y install epel-release
dnf -y update
dnf install -y 'dnf-command(config-manager)'
arch_deps: >-
clang-devel
diffutils
gcc
gcc-c++
gtest-devel
gmock-devel
gsl-devel
hdf5-devel
java-21-openjdk-devel
libxml2-devel
llvm-devel
llvm-static
ncurses-devel
openmotif
openmotif-devel
perl
perl-Digest-MD5
udunits2
udunits2-devel
which
zlib-devel
python3-devel
python3-pyyaml
python3-psutil

#-------- RHEL 9: gtest lives in crb ----------------
- cfg: { arch: rhel, tag: 9 }
enable_repo: dnf config-manager --enable crb

steps:
- name: Set noninteractive mode
run: echo "DEBIAN_FRONTEND=noninteractive" >> "$GITHUB_ENV"
if: matrix.cfg.arch == 'debian'
- name: Update Package Manager
run: |
${{ matrix.conf_pkg }}
${{ matrix.enable_repo }}
- name: Install Dependencies
run: >
${{ matrix.pkg_mgr }}
${{ matrix.install_cmd }}
${{ matrix.deps }}
${{ matrix.arch_deps }}
- name: Checkout repository
uses: actions/checkout@v6
# A dedicated step: GITHUB_ENV writes only take effect in *subsequent*
# steps, so setting JAVA_HOME inline in the same run block as a script
# would leave that script itself without it.
- name: Set JAVA_HOME
run: echo "JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))" >> "$GITHUB_ENV"
- name: Compare autoconf vs cmake config_user.mk (Phase 1)
run: test/build_config/compare_config_user.sh
- name: CMake build + archive parity vs make (Phase 2)
run: test/build_config/compare_archives.sh
- name: CMake install + CTest (Phase 3)
run: |
NPROC="$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 4)"
# Three-step io_src bootstrap: a nonexistent-at-first-configure
# generated list does not wire itself into CMAKE_CONFIGURE_DEPENDS
# (see cmake/TrickICG.cmake) — the first `trick_io_src_gen` build
# writes it, then a reconfigure picks it up before the real build.
cmake -S . -B build
cmake --build build --target trick-ICG trick_io_src_gen -j"$NPROC"
cmake -S . -B build
cmake --build build -j"$NPROC"
# Stage a runnable TRICK_HOME (build/stage) — the stage_install
# fixture in cmake/TrickTest.cmake also does this, but doing it
# explicitly here surfaces install errors directly.
cmake --build build --target stage -j"$NPROC"
ctest --test-dir build --output-on-failure -L '^(unit|sims)$'

cmake-configure-macos:
name: CMake Configure (macOS)
needs: [style]
# TODO: Remove always() once style enforcement is stable — ideally builds only run on clean style.
if: always()
runs-on: macos-26
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install dependencies
run: |
brew update || true
brew upgrade || true
brew install --cask xquartz
brew install udunits openmotif maven googletest gsl hdf5
brew install swig llvm
# sims (LABEL sims, exercised by the Phase 3 step below) drives
# trickops.py, which needs PyYAML/psutil — it's the only sims test now
# (replaced the two-sim smoke subset), so installing these is no longer
# optional for this job. Installed into the same Python3 `cmake` resolves
# at configure time (find_package(Python3 ...) in TrickTest.cmake) and
# bakes as an absolute path into the generated ctest command — a venv's
# activate script in a later step would not reach that baked-in path, so
# this installs directly rather than isolating in a venv like the
# autotools test-macos job above does.
- name: Install trickops Python dependencies
run: pip3 install --break-system-packages -r share/trick/trickops/requirements.txt
- name: Compare autoconf vs cmake config_user.mk (Phase 1)
run: test/build_config/compare_config_user.sh
- name: CMake build + archive parity vs make (Phase 2)
run: test/build_config/compare_archives.sh
- name: CMake install + CTest (Phase 3)
run: |
NPROC="$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 4)"
# Three-step io_src bootstrap: a nonexistent-at-first-configure
# generated list does not wire itself into CMAKE_CONFIGURE_DEPENDS
# (see cmake/TrickICG.cmake) — the first `trick_io_src_gen` build
# writes it, then a reconfigure picks it up before the real build.
cmake -S . -B build
cmake --build build --target trick-ICG trick_io_src_gen -j"$NPROC"
cmake -S . -B build
cmake --build build -j"$NPROC"
# Stage a runnable TRICK_HOME (build/stage) — the stage_install
# fixture in cmake/TrickTest.cmake also does this, but doing it
# explicitly here surfaces install errors directly.
cmake --build build --target stage -j"$NPROC"
ctest --test-dir build --output-on-failure -L '^(unit|sims)$'

trickops:
needs: [style]
uses: ./.github/workflows/_trickops.yml
Expand Down
20 changes: 18 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Build artifacts
*.o
object_*
io_src
swig
Expand All @@ -19,8 +20,24 @@ lib_Darwin_*
*.gcno
coverage.info
gmon.out
compile_commands.json
Makefile_jsc_dirs
.extracted
__.SYMDEF

# CMake
build*/
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
CMakeUserPresets.json

# Autoconf / configure
config.status*
Expand Down Expand Up @@ -56,7 +73,6 @@ share/trick/makefiles/config_user.mk
# Editor / OS
*~
*.swp
*.dox
.DS_Store
.vscode/
.cache/
Expand Down
Loading
Loading