Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .github/build-ci/data/standard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"gcc_compiler": "gcc@13.2.0",
"intel_compiler": "intel@2021.10.0",
"oneapi_compiler": "oneapi@2025.2.0",
"target": "x86_64"
}
10 changes: 10 additions & 0 deletions .github/build-ci/manifests/gcc-no-access3.spack.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
spack:
specs:
- access-ww3 @git.{{ ref }} ~access3
packages:
all:
require:
- '%{{ gcc_compiler }} target={{ target}}'
concretizer:
unify: false
view: false
10 changes: 10 additions & 0 deletions .github/build-ci/manifests/intel-access3.spack.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
spack:
specs:
- access-ww3 @git.{{ ref }} +access3
packages:
all:
require:
- '%{{ intel_compiler }} target={{ target }}'
concretizer:
unify: false
view: false
10 changes: 10 additions & 0 deletions .github/build-ci/manifests/intel-no-access3.spack.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
spack:
specs:
- access-ww3 @git.{{ ref }} ~access3
packages:
all:
require:
- '%{{ intel_compiler }} target={{ target }}'
concretizer:
unify: false
view: false
14 changes: 14 additions & 0 deletions .github/build-ci/manifests/oneapi-access3.spack.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
spack:
specs:
- access-ww3 @git.{{ ref }} +access3 build_type=Debug
- access-ww3 @git.{{ ref }} +access3
packages:
gcc-runtime:
require:
- '%gcc target={{ target }}'
all:
require:
- '%{{ oneapi_compiler }} target={{ target }}'
concretizer:
unify: false
view: false
14 changes: 14 additions & 0 deletions .github/build-ci/manifests/oneapi-no-access3.spack.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
spack:
specs:
- access-ww3 @git.{{ ref }} ~access3 +openmp
- access-ww3 @git.{{ ref }} ~access3
packages:
gcc-runtime:
require:
- '%gcc target={{ target }}'
all:
require:
- '%{{ oneapi_compiler }} target={{ target }}'
concretizer:
unify: false
view: false
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build
on:
pull_request:
push:
branches:
- main
- dev/*
jobs:
pre-ci:
name: Pre-CI
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4

- name: Set up matrix
id: set-matrix
# Find all relevant files under .github/build-ci/manifests
# then output them as a JSON array (minus the last comma)
run: |
files=$(find .github/build-ci/manifests/ -iname '*.j2' -printf '"%p",')
echo "matrix=[${files%,}]" >> $GITHUB_OUTPUT

ci:
name: CI
needs: pre-ci
strategy:
fail-fast: false
max-parallel: 5
matrix:
file: ${{ fromJson(needs.pre-ci.outputs.matrix) }}
uses: access-nri/build-ci/.github/workflows/ci.yml@v2
with:
spack-manifest-path: ${{ matrix.file }}
allow-ssh-into-spack-install: false # If true, PR author must ssh into instance to complete job
spack-manifest-data-path: .github/build-ci/data/standard.json
# spack-packages-ref: main
# spack-config-ref: main
# spack-ref: releases/v0.22
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ set(CMAKE_INSTALL_MODULEDIR ${CMAKE_INSTALL_INCLUDEDIR}
# External packages #
#]==============================================================================]

find_package(MPI REQUIRED)
find_package(MPI REQUIRED COMPONENTS Fortran)

if(WW3_ACCESS3)
find_package(Access3Share REQUIRED share)
Expand Down Expand Up @@ -126,6 +126,7 @@ set_property(SOURCE ${SRC}/w3initmd.F90
"__WW3_SWITCHES__=\'\'"
)
target_link_libraries(ww3lib PUBLIC NetCDF::NetCDF_Fortran)
target_link_libraries(ww3lib PUBLIC MPI::MPI_Fortran)

if(WW3_ACCESS3)
target_link_libraries(ww3lib PRIVATE Access3::share)
Expand Down
5 changes: 4 additions & 1 deletion cmake/Access3Ww3libConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
@PACKAGE_INIT@

if(@OPENMP@)
find_package(OpenMP REQUIRED)
find_dependency(OpenMP REQUIRED)
endif()

find_dependency(NetCDF 4.7.3 REQUIRED Fortran)
find_dependency(MPI REQUIRED COMPONENTS Fortran)

# Request components
set(_required_components ${Ww3lib_FIND_COMPONENTS})

Expand Down