Skip to content

Spack build

Spack build #476

Workflow file for this run

name: Spack build
on:
# Uncomment the below 'push' to trigger on push
# push:
# branches:
# - "**"
schedule:
# '*' is a special character in YAML, so string must be quoted
- cron: "0 2 * * THU"
workflow_dispatch:
inputs:
spack_repo:
description: "Spack repository to test"
default: "spack/spack"
type: string
spack_ref:
description: "Spack repository branch/tag to test"
default: "develop"
type: string
dolfinx_version:
description: "DOLFINx release branch/tag to test"
default: "0.8.0"
type: string
jobs:
build:
runs-on: ubuntu-latest
container: ubuntu:24.04
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe # Newer OpenMPI
OMPI_MCA_rmaps_base_oversubscribe: true # Older OpenMPI
DOLFINX_RELEASE_VERSION: "${{ github.event_name != 'workflow_dispatch' && '0.8.0' || github.event.inputs.dolfinx_version }}"
steps:
- name: Get Spack
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: ./spack
repository: spack/spack
- name: Get Spack
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: ./spack
repository: ${{ github.event.inputs.spack_repo }}
ref: ${{ github.event.inputs.spack_ref }}
- name: Install Spack requirements
run: |
apt-get -y update
apt-get install -y bzip2 curl file git gzip make patch python3-minimal tar unzip xz-utils
apt-get install -y g++ gfortran # compilers
- name: Build DOLFINx (C++) development version via Spack
run: |
. ./spack/share/spack/setup-env.sh
spack env create cpp-main
spack env activate cpp-main
spack add fenics-dolfinx@main+adios2
spack install
- name: Get DOLFINx code (to access test files)
uses: actions/checkout@v4
with:
path: ./dolfinx-main
- name: Run a C++ test (development version)
run: |
. ./spack/share/spack/setup-env.sh
spack env create cpp-main-test
spack env activate cpp-main-test
spack add fenics-dolfinx@main+adios2 cmake py-fenics-ffcx@main
spack install
cd dolfinx-main/cpp/
cd demo/poisson
cmake .
export VERBOSE=1
make -j 4
mpirun -np 2 ./demo_poisson
- name: Build DOLFINx (C++) release version via Spack
run: |
. ./spack/share/spack/setup-env.sh
spack env create cpp-release
spack env activate cpp-release
spack add fenics-dolfinx@${DOLFINX_RELEASE_VERSION}+adios2
spack install
- name: Get DOLFINx release code (to access test files)
uses: actions/checkout@v4
with:
ref: v${{ env.DOLFINX_RELEASE_VERSION }}
path: ./dolfinx-release
- name: Run a C++ test (release version)
run: |
. ./spack/share/spack/setup-env.sh
spack env create cpp-release-test
spack env activate cpp-release-test
spack add fenics-dolfinx@${DOLFINX_RELEASE_VERSION}+adios2 cmake py-fenics-ffcx
spack install
cd dolfinx-release/cpp/
cd demo/poisson
cmake .
export VERBOSE=1
make -j 4
mpirun -np 2 ./demo_poisson
- name: Build DOLFINx (Python, development)
run: |
. ./spack/share/spack/setup-env.sh
spack env create py-main
spack env activate py-main
spack add py-fenics-dolfinx@main
spack install
- name: Run DOLFINx (Python, development) test
run: |
. ./spack/share/spack/setup-env.sh
spack env activate py-main
mpirun -np 2 python3 ./dolfinx-main/python/demo/demo_elasticity.py
- name: Build DOLFINx (Python, release version)
run: |
. ./spack/share/spack/setup-env.sh
spack env create py-release
spack env activate py-release
spack add py-fenics-dolfinx@${DOLFINX_RELEASE_VERSION}
spack install -j 4
- name: Run DOLFINx (Python, release) test
run: |
. ./spack/share/spack/setup-env.sh
spack env activate py-release
mpirun -np 2 python3 ./dolfinx-release/python/demo/demo_elasticity.py