Skip to content

resolves 6: add support for cmake cxx standard #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
959398f
Add support for execution matrix in CI workflow
prudhomm Apr 9, 2025
748d6b7
Merge remote-tracking branch 'origin/main' into 6-add-support-for-cma…
prudhomm Apr 9, 2025
fc1925b
Merge branch 'main' into 6-add-support-for-cmake_cxx_standard
prudhomm Apr 9, 2025
5e02036
Refactor test case configuration in CMakeLists.txt to streamline Kokk…
prudhomm Apr 9, 2025
2b81d31
Update CI workflow to use env_variant for execution matrix and add Sp…
prudhomm Apr 9, 2025
a727431
Add message output for custom CMAKE_CXX_STANDARD setting in CMakeList…
prudhomm Apr 9, 2025
294040e
Enhance CI workflow by adding build-cache job and integrating Spack f…
prudhomm Apr 9, 2025
002563f
change cache name
prudhomm Apr 9, 2025
9aed440
Refactor CI workflow to set up Spack earlier and streamline package i…
prudhomm Apr 9, 2025
49ad8fb
Update CI workflow to disable continue-on-error and reorder Spack set…
prudhomm Apr 9, 2025
12d3d03
change path to spack clone
prudhomm Apr 9, 2025
5d166f2
fix build cache
prudhomm Apr 9, 2025
dc399f3
remove spack-bash shell specification from CMake configuration step
prudhomm Apr 9, 2025
c9fae1e
use self-*
prudhomm Apr 9, 2025
6f7341a
use spack-bash
prudhomm Apr 9, 2025
9121664
set padded length for install tree in spack configuration
prudhomm Apr 9, 2025
cd5278f
update CI workflow to use standard Ubuntu runner and latest Spack set…
prudhomm Apr 9, 2025
3abfe6d
up setup-spack action
prudhomm Apr 9, 2025
db1129a
fix: update CMake shell configuration to include placeholder
prudhomm Apr 9, 2025
f58d1c5
feat: enhance CI workflow by adding buildcache and color options for …
prudhomm Apr 9, 2025
e26c03d
install spack package
prudhomm Apr 9, 2025
4f0063a
feat: add test for SEM_EXECUTABLE in CMake configuration
prudhomm Apr 9, 2025
affbcfb
tiny fix in CMakeLists to hide warnings
thomas-saigre Apr 16, 2025
a1dd410
use gcc12:
thomas-saigre Apr 16, 2025
3c874d4
feat: update CMake presets for ROCm support and improve build configu…
prudhomm Apr 16, 2025
48802ac
Merge branch '6-add-support-for-cmake_cxx_standard' of https://github…
prudhomm Apr 16, 2025
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
52 changes: 49 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,47 @@ on:
- main

jobs:
build-cache:
runs-on: ubuntu-24.04
permissions:
packages: write
continue-on-error: false
strategy:
matrix:
env_variant: [omp]
steps:

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Set up Spack
uses: spack/setup-spack@v2.1.1
with:
buildcache: true
color: true
path: _spack
- name: Install
run: |
ls -l
spack -e spack/proxy-geos-${{ matrix.env_variant }} install --no-check-signature

- name: Push packages and update index
run: |
spack -e spack/proxy-geos-${{ matrix.env_variant }} mirror set --push --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" numpex-buildcache
spack -e spack/proxy-geos-${{ matrix.env_variant }} buildcache push --base-image ubuntu:24.04 --unsigned --update-index numpex-buildcache
if: ${{ !cancelled() }}

build:
runs-on: self-spack
needs: build-cache
runs-on: ubuntu-24.04
permissions:
packages: write
continue-on-error: true
strategy:
matrix:
env_variant: [omp]
preset: [default, kokkos]

steps:
Expand All @@ -23,10 +59,20 @@ jobs:
with:
submodules: true

- name: Set up Spack
uses: spack/setup-spack@v2.1.1
with:
buildcache: true
color: true
path: _spack

- name: Spack Install
run: spack -e spack/proxy-geos-${{ matrix.env_variant }} install --no-check-signature

- name: Configure CMake
shell: spack-bash {0}
run: |
source /data/cemosis/spack/share/spack/setup-env.sh
spack env activate proxy-geos
spack env activate spack/proxy-geos-${{ matrix.env_variant }}
cmake --preset ${{ matrix.preset }}

- name: Build
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ readme_folder
env_old.sh
./install/
./build/
*.spack-env*
spack.lock
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 20)
endif()

message(STATUS "CMAKE_CXX_STANDARD is set to ${CMAKE_CXX_STANDARD}")

#-----------------------------------------------------
# Setup Flags for whether considering an external libs
Expand Down
42 changes: 35 additions & 7 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"displayName": "Default Config",
"description": "Default config",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build/default",
"binaryDir": "${sourceDir}/build/${presetName}",
"inherits": "cpp20",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++",
Expand All @@ -34,12 +34,13 @@
"name": "kokkos",
"displayName": "kokkos Config",
"description": "kokkos config",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build/kokkos",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"inherits": "cpp20",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_C_COMPILER": "gcc",
"CMAKE_INSTALL_PREFIX" : "${sourceDir}/build/kokkos/install/",
"CMAKE_INSTALL_PREFIX" : "${sourceDir}/build/${presetName}/install/",
"CMAKE_BUILD_TYPE": "Release",
"USE_OMP": "OFF",
"USE_RAJA": "OFF",
Expand All @@ -57,11 +58,12 @@
"displayName": "raja Config",
"description": "raja config",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build/raja",
"binaryDir": "${sourceDir}/build/${presetName}",
"inherits": "cpp20",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++",
"CMAKE_C_COMPILER": "gcc",
"CMAKE_INSTALL_PREFIX" : "${sourceDir}/build/raja/install/",
"CMAKE_INSTALL_PREFIX" : "${sourceDir}/build/${presetName}/install/",
"CMAKE_BUILD_TYPE": "Release",
"USE_OMP": "OFF",
"USE_RAJA": "ON",
Expand Down Expand Up @@ -97,6 +99,23 @@
"cacheVariables": {
"CMAKE_CXX_STANDARD": "17"
}
},
{
"name": "rocm",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_COMPILER": "amdclang++",
"CMAKE_C_COMPILER": "amdclang",
"DEVICE": "rocm"
}
},
{
"name": "kokkos+rocm",
"inherits": ["rocm", "kokkos"],
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {

}
}
],
"buildPresets": [
Expand All @@ -114,6 +133,10 @@
"name": "raja",
"configurePreset": "raja",
"jobs": 10
},
{
"name": "kokkos+rocm",
"configurePreset": "kokkos+rocm"
}
],
"testPresets": [
Expand Down Expand Up @@ -141,7 +164,12 @@
"name": "raja",
"inherits": "default",
"configurePreset": "raja"
}
},
{
"name": "kokkos+rocm",
"inherits": ["kokkos"],
"configurePreset": "kokkos+rocm"
}
],
"vendor": {
"example.com/ExampleIDE/1.0": {
Expand Down
27 changes: 27 additions & 0 deletions spack/proxy-geos-omp/spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
config:
install_tree:
padded_length: 128
packages:
all:
compiler: [gcc@14:, clang@14:18]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still this warning The packages:all:compiler preference has been deprecated in Spack v1.0, and is currently ignored. It will be removed from config in Spack v1.2.
Oddly, I did not find any fix about this on the doc of spack

require: ['target=x86_64_v3']
mpi:
require: ['openmpi@:4 fabrics=auto']
definitions:
- compilers: [gcc@12:]
- packages: [caliper,chai+openmp,raja+openmp,umpire+openmp,kokkos+openmp]
specs:
- $compilers
- matrix:
- [$packages]
- [$%compilers]
view: true
concretizer:
unify: when_possible
mirrors:
numpex-buildcache: oci://ghcr.io/numpex/spack-buildcache
25 changes: 25 additions & 0 deletions spack/proxy-geos-rocm/spack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
config:
install_tree:
padded_length: 128
packages:
all:
compiler: [gcc@14:, clang@14:18]
require: ['target=x86_64_v3']
definitions:
- compilers: [gcc@14:]
- packages: ['caliper +rocm amdgpu_target=gfx90a','chai +rocm amdgpu_target=gfx90a','raja +rocm amdgpu_target=gfx90a','umpire +rocm amdgpu_target=gfx90a','kokkos@4.6: +rocm amdgpu_target=gfx90a']
specs:
- $compilers
- matrix:
- [$packages]
- [$%compilers]
view: true
concretizer:
unify: when_possible
mirrors:
numpex-buildcache: oci://ghcr.io/numpex/spack-buildcache
Loading