diff --git a/.github/build-ci/data/standard_definitions.json b/.github/build-ci/data/standard_definitions.json index f3c2a46e..63f4054b 100644 --- a/.github/build-ci/data/standard_definitions.json +++ b/.github/build-ci/data/standard_definitions.json @@ -1,5 +1,6 @@ { "target": "x86_64", - "intel_compiler": "intel@2021.10.0", - "gcc_compiler": "gcc@13.2.0" + "intel_compiler_ver": "@2021.10.0", + "oneapi_compiler_ver": "@2025.2.0", + "gcc_compiler_ver": "@13.2.0" } diff --git a/.github/build-ci/manifests/access-om3/gcc.spack.yaml.j2 b/.github/build-ci/manifests/access-om3/gcc.spack.yaml.j2 deleted file mode 100644 index 1fd50dc7..00000000 --- a/.github/build-ci/manifests/access-om3/gcc.spack.yaml.j2 +++ /dev/null @@ -1,15 +0,0 @@ -spack: - specs: - # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the gcc_compilers are defined in the standard_definitions.json data file - - '{{ package }}' - packages: - access3: - require: - - 'configurations=MOM6-CICE6' - all: - require: - - '%{{ gcc_compiler }} target={{ target }}' - concretizer: - unify: false - view: false diff --git a/.github/build-ci/manifests/access-om3/intel.spack.yaml.j2 b/.github/build-ci/manifests/access-om3/intel.spack.yaml.j2 deleted file mode 100644 index 27bd9850..00000000 --- a/.github/build-ci/manifests/access-om3/intel.spack.yaml.j2 +++ /dev/null @@ -1,15 +0,0 @@ -spack: - specs: - # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the intel_compilers are defined in the standard_definitions.json data file - - '{{ package }}' - packages: - access3: - require: - - 'configurations=MOM6-CICE6' - all: - require: - - '%{{ intel_compiler }} target={{ target }}' - concretizer: - unify: false - view: false diff --git a/.github/build-ci/manifests/access3/gcc.spack.yaml.j2 b/.github/build-ci/manifests/access3/gcc.spack.yaml.j2 index 1aaf02e2..255d8311 100644 --- a/.github/build-ci/manifests/access3/gcc.spack.yaml.j2 +++ b/.github/build-ci/manifests/access3/gcc.spack.yaml.j2 @@ -1,12 +1,16 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the gcc_compilers are defined in the standard_definitions.json data file - - '{{ package }} configurations=MOM6,CICE6,WW3,MOM6-WW3,MOM6-CICE6,CICE6-WW3,MOM6-CICE6-WW3 %{{ gcc_compiler }}' + # gcc_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }} configurations=MOM6,CICE6,WW3,MOM6-WW3,MOM6-CICE6,CICE6-WW3,MOM6-CICE6-WW3' packages: + gcc: + require: + - '{{ gcc_compiler_ver }}' all: require: - - '%{{ gcc_compiler }} target={{ target }}' + - '%access_gcc' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/access3/intel.spack.yaml.j2 b/.github/build-ci/manifests/access3/intel.spack.yaml.j2 index cd87745c..f67f9229 100644 --- a/.github/build-ci/manifests/access3/intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/access3/intel.spack.yaml.j2 @@ -1,12 +1,19 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the intel_compilers are defined in the standard_definitions.json data file - - '{{ package }} configurations=MOM6,CICE6,WW3,MOM6-WW3,MOM6-CICE6,CICE6-WW3,MOM6-CICE6-WW3 %{{ intel_compiler }}' + # intel_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }} configurations=MOM6,CICE6,WW3,MOM6-WW3,MOM6-CICE6,CICE6-WW3,MOM6-CICE6-WW3' packages: + python: + require: + - '@3.11.14' + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' all: require: - - '%{{ intel_compiler }} target={{ target }}' + - '%access_intel' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/cable/gcc.spack.yaml.j2 b/.github/build-ci/manifests/cable/gcc.spack.yaml.j2 index b8cea58d..f40d36d0 100644 --- a/.github/build-ci/manifests/cable/gcc.spack.yaml.j2 +++ b/.github/build-ci/manifests/cable/gcc.spack.yaml.j2 @@ -1,13 +1,17 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the gcc_compilers are defined in the standard_definitions.json data file - - '{{ package }} +mpi %{{ gcc_compiler }}' - - '{{ package }} ~mpi %{{ gcc_compiler }}' + # gcc_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }} +mpi' + - '{{ package }} ~mpi' packages: + gcc: + require: + - '{{ gcc_compiler_ver }}' all: require: - - '%{{ gcc_compiler }} target={{ target }}' + - '%access_gcc' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/cable/intel.spack.yaml.j2 b/.github/build-ci/manifests/cable/intel.spack.yaml.j2 index f26177e1..5dc9acfd 100644 --- a/.github/build-ci/manifests/cable/intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/cable/intel.spack.yaml.j2 @@ -1,13 +1,20 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the intel_compilers are defined in the standard_definitions.json data file - - '{{ package }} +mpi %{{ intel_compiler }}' - - '{{ package }} ~mpi %{{ intel_compiler }}' + # intel_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }} +mpi' + - '{{ package }} ~mpi' packages: + python: + require: + - '@3.11.14' + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' all: require: - - '%{{ intel_compiler }} target={{ target }}' + - '%access_intel' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/cable/library-gcc.spack.yaml.j2 b/.github/build-ci/manifests/cable/library-gcc.spack.yaml.j2 index 5962e66d..8d97d67f 100644 --- a/.github/build-ci/manifests/cable/library-gcc.spack.yaml.j2 +++ b/.github/build-ci/manifests/cable/library-gcc.spack.yaml.j2 @@ -1,13 +1,17 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the gcc_compilers are defined in the standard_definitions.json data file - - '{{ package }} +mpi library=access-esm1.6 %{{ gcc_compiler }}' - - '{{ package }} ~mpi library=access-esm1.6 %{{ gcc_compiler }}' + # gcc_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }} +mpi library=access-esm1.6' + - '{{ package }} ~mpi library=access-esm1.6' packages: + gcc: + require: + - '{{ gcc_compiler_ver }}' all: require: - - '%{{ gcc_compiler }} target={{ target }}' + - '%access_gcc' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/cable/library-intel.spack.yaml.j2 b/.github/build-ci/manifests/cable/library-intel.spack.yaml.j2 index 6908f9b3..0436c7d4 100644 --- a/.github/build-ci/manifests/cable/library-intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/cable/library-intel.spack.yaml.j2 @@ -1,13 +1,17 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the intel_compilers are defined in the standard_definitions.json data file - - '{{ package }} +mpi library=access-esm1.6 %{{ intel_compiler }}' - - '{{ package }} ~mpi library=access-esm1.6 %{{ intel_compiler }}' + # intel_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }} +mpi library=access-esm1.6' + - '{{ package }} ~mpi library=access-esm1.6' packages: + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' all: require: - - '%{{ intel_compiler }} target={{ target }}' + - '%access_intel' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/cice4/intel.spack.yaml.j2 b/.github/build-ci/manifests/cice4/intel.spack.yaml.j2 index 83f289d7..9dceff2f 100644 --- a/.github/build-ci/manifests/cice4/intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/cice4/intel.spack.yaml.j2 @@ -1,12 +1,19 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the intel_compilers are defined in the standard_definitions.json data file - - '{{ package }} %{{ intel_compiler }}' + # intel_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }}' packages: + python: + require: + - '@3.11.14' + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' all: require: - - '%{{ intel_compiler }}' + - '%access_intel' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/cice5/access-esm1.6-intel.spack.yaml.j2 b/.github/build-ci/manifests/cice5/access-esm1.6-intel.spack.yaml.j2 index f577a997..7ee948b8 100644 --- a/.github/build-ci/manifests/cice5/access-esm1.6-intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/cice5/access-esm1.6-intel.spack.yaml.j2 @@ -1,13 +1,20 @@ spack: specs: - - 'access-esm1p6 %{{ intel_compiler }}' + - 'access-esm1p6' packages: cice5: require: - '@git.access-esm1.6=stable' + - '@git.access-esm1.6=stable' + python: + require: + - '@3.11.14' + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' all: require: - - '%{{ intel_compiler }}' + - '%access_intel' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/cice5/access-om2+deterministic-intel.spack.yaml.j2 b/.github/build-ci/manifests/cice5/access-om2+deterministic-intel.spack.yaml.j2 index d15b9ac7..1bbd51e9 100644 --- a/.github/build-ci/manifests/cice5/access-om2+deterministic-intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/cice5/access-om2+deterministic-intel.spack.yaml.j2 @@ -1,11 +1,18 @@ spack: specs: - - 'access-om2 +deterministic %{{ intel_compiler }} ^cice5 build_system=cmake nxglob=360 nyglob=300 blckx=15 blcky=300 mxblcks=1' - - 'access-om2 +deterministic %{{ intel_compiler }} ^cice5 build_system=makefile' + - 'access-om2 +deterministic ^cice5 build_system=cmake nxglob=360 nyglob=300 blckx=15 blcky=300 mxblcks=1' + - 'access-om2 +deterministic ^cice5 build_system=makefile' packages: + python: + require: + - '@3.11.14' + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' all: require: - - '%{{ intel_compiler }}' + - '%access_intel' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/cice5/access-om2~deterministic-intel.spack.yaml.j2 b/.github/build-ci/manifests/cice5/access-om2~deterministic-intel.spack.yaml.j2 index 78ceea38..d6ca11d3 100644 --- a/.github/build-ci/manifests/cice5/access-om2~deterministic-intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/cice5/access-om2~deterministic-intel.spack.yaml.j2 @@ -1,11 +1,18 @@ spack: specs: - - 'access-om2 ~deterministic %{{ intel_compiler }} ^cice5 build_system=cmake nxglob=360 nyglob=300 blckx=15 blcky=300 mxblcks=1' - - 'access-om2 ~deterministic %{{ intel_compiler }} ^cice5 build_system=makefile' + - 'access-om2 ~deterministic ^cice5 build_system=cmake nxglob=360 nyglob=300 blckx=15 blcky=300 mxblcks=1' + - 'access-om2 ~deterministic ^cice5 build_system=makefile' packages: + python: + require: + - '@3.11.14' + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' all: require: - - '%{{ intel_compiler }}' + - '%access_intel' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/gcc.spack.yaml.j2 b/.github/build-ci/manifests/gcc.spack.yaml.j2 index 61f7db58..79ebcabc 100644 --- a/.github/build-ci/manifests/gcc.spack.yaml.j2 +++ b/.github/build-ci/manifests/gcc.spack.yaml.j2 @@ -2,12 +2,16 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the gcc_compilers are defined in the standard_definitions.json data file - - '{{ package }} %{{ gcc_compiler }}' + # gcc_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }}' packages: + gcc: + require: + - '{{ gcc_compiler_ver }}' all: require: - - '%{{ gcc_compiler }}' + - '%access_gcc' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/intel.spack.yaml.j2 b/.github/build-ci/manifests/intel.spack.yaml.j2 index d8c67cfa..f87415e8 100644 --- a/.github/build-ci/manifests/intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/intel.spack.yaml.j2 @@ -2,12 +2,19 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the intel_compilers are defined in the standard_definitions.json data file - - '{{ package }} %{{ intel_compiler }}' + # intel_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }}' packages: + python: + require: + - '@3.11.14' + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' all: require: - - '%{{ intel_compiler }}' + - '%access_intel' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/issm/spack.yaml.j2 b/.github/build-ci/manifests/issm/spack.yaml.j2 index 47663d35..d8458420 100644 --- a/.github/build-ci/manifests/issm/spack.yaml.j2 +++ b/.github/build-ci/manifests/issm/spack.yaml.j2 @@ -5,7 +5,14 @@ spack: - ['issm'] - ['+ad', '~ad'] - ['+wrappers'] - - ['%{{ gcc_compiler }}'] + packages: + gcc: + require: + - '{{ gcc_compiler_ver }}' + all: + require: + - '%access_gcc' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/oneapi.spack.yaml.j2 b/.github/build-ci/manifests/oneapi.spack.yaml.j2 new file mode 100644 index 00000000..e469c870 --- /dev/null +++ b/.github/build-ci/manifests/oneapi.spack.yaml.j2 @@ -0,0 +1,17 @@ +# This manifest is used by default for packages without a specific manifest under .github/build-ci/manifests/PACKAGE/*.j2 +spack: + specs: + # package is defined in the workflows inputs.spack-manifest-data-pairs + # oneapi_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }}' + packages: + intel-oneapi-compilers: + require: + - '{{ oneapi_compiler_ver }}' + all: + require: + - '%access_oneapi' + - 'target={{ target }}' + concretizer: + unify: false + view: false diff --git a/.github/build-ci/manifests/um7/intel.spack.yaml.j2 b/.github/build-ci/manifests/um7/intel.spack.yaml.j2 index d8c67cfa..e5b1e09a 100644 --- a/.github/build-ci/manifests/um7/intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/um7/intel.spack.yaml.j2 @@ -2,12 +2,19 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs - # And the intel_compilers are defined in the standard_definitions.json data file - - '{{ package }} %{{ intel_compiler }}' + # And the intel_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }}' packages: + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' + python: + require: + - '@3.11.14' all: require: - - '%{{ intel_compiler }}' + - '%access_intel' + - 'target={{ target }}' concretizer: unify: false view: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0af707c..2920fee0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: pull_request: paths: - - packages/** + - spack_repo/access/nri/packages/** workflow_dispatch: inputs: packages-to-test: @@ -10,8 +10,12 @@ on: required: true type: string default: 'ALL' - spack-packages-ref: - description: 'spack-packages ref to use' + builtin-spack-packages-ref: + description: 'spack/spack-packages ref to use' + required: true + type: string + access-spack-packages-ref: + description: 'access-nri/access-spack-packages ref to use' required: true type: string spack-config-ref: @@ -27,15 +31,15 @@ jobs: name: Setup CI runs-on: ubuntu-latest env: - # These defaults can be overridden by the inputs (if the trigger is a workflow_dispatch) - DEFAULT_SPACK_REF: 'releases/v0.22' - DEFAULT_SPACK_CONFIG_REF: 'main' - DEFAULT_SPACK_PACKAGES_REF: ${{ github.event.pull_request.head.sha }} + # Note, this needs to be updated in line with refs in the ci job below + BUILD_CI_WORKFLOW_VERSION: v3 + PACKAGES_ROOT_DIR: spack_repo/access/nri/packages outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} - spack-packages-ref: ${{ steps.set-refs.outputs.spack-packages-ref }} - spack-config-ref: ${{ steps.set-refs.outputs.spack-config-ref }} - spack-ref: ${{ steps.set-refs.outputs.spack-ref }} + builtin-spack-packages-ref: ${{ inputs.builtin-spack-packages-ref }} + access-spack-packages-ref: ${{ inputs.access-spack-packages-ref || github.event.pull_request.head.sha }} + spack-config-ref: ${{ inputs.spack-config-ref || steps.defaults.outputs.spack-config-ref }} + spack-ref: ${{ inputs.spack-ref || steps.defaults.outputs.spack-ref }} steps: - name: Checkout spack-packages uses: actions/checkout@v4 @@ -45,10 +49,10 @@ jobs: if: github.event_name == 'pull_request' uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 with: - # We only care about the directory names under packages/ - since they are also the package names + # We only care about the directory names under the env.PACKAGES_ROOT_DIR - since they are also the package names # and we want to find changes to the package.py files in those directories dir_names: true - path: ./packages + path: ./${{ env.PACKAGES_ROOT_DIR }} files: '*/package.py' - name: Dispatch - Get packages @@ -57,7 +61,7 @@ jobs: # Either get all packages defined (all subfolders under packages/) or use the input run: | if [[ "${{ inputs.packages-to-test }}" == "ALL" ]]; then - pkgs=$(find packages/ -mindepth 1 -maxdepth 1 -type d -printf '%P ') + pkgs=$(find ${{ env.PACKAGES_ROOT_DIR }}/ -mindepth 1 -maxdepth 1 -type d -printf '%P ') else pkgs="${{ inputs.packages-to-test }}" fi @@ -66,7 +70,7 @@ jobs: # Validate that all packages exist error=false for pkg in $pkgs; do - if [ ! -f "packages/$pkg/package.py" ]; then + if [ ! -f "${{ env.PACKAGES_ROOT_DIR }}/$pkg/package.py" ]; then echo "::error::packages/$pkg/package.py does not exist. Check spelling or if the package is defined." error=true fi @@ -84,9 +88,9 @@ jobs: # Get file paths to manifests for each package, and a template, then finally # Convert into a JSON array for the matrix, one of the form: # [ - # {"filepath": ".github/build-ci/manifests/mom5/intel.spack.yaml.j2", "template_value": "mom5"}, - # {"filepath": ".github/build-ci/manifests/mom5/amd.spack.yaml.j2", "template_value": "mom5"}, - # {"filepath": ".github/build-ci/manifests/cice5/spack.yaml.j2", "template_value": "cice5"}, + # {"template_value": "mom5", "filepath": ".github/build-ci/manifests/mom5/intel.spack.yaml.j2"}, + # {"template_value": "mom5", "filepath": ".github/build-ci/manifests/mom5/amd.spack.yaml.j2"}, + # {"template_value": "cice5", "filepath": ".github/build-ci/manifests/cice5/spack.yaml.j2"}, # ... # ] run: | @@ -94,7 +98,8 @@ jobs: for pkg in $pkgs; do # We want each manifest to have an associated injection of {{ package }} to $pkg - template_value="$pkg" + # Replace underscores with hyphens for the template value, as spack converts directory underscores to package name hyphens + template_value="${pkg//_/-}" if [ -d ".github/build-ci/manifests/$pkg" ]; then # Look for specific manifests for the package # We space-separate the paths as we later use them in a for loop @@ -107,7 +112,7 @@ jobs: fi for manifest_path in $manifest_paths; do - json_entry=$(printf '{"filepath": "%s", "template_value": "%s"}' "$manifest_path" "$template_value") + json_entry=$(printf '{"template_value": "%s", "filepath": "%s"}' "$template_value" "$manifest_path") json_entries+="${json_entry}," done unset manifest_paths @@ -118,12 +123,26 @@ jobs: # Remove the trailing comma and wrap in square brackets echo "matrix=[${json_entries%,}]" >> $GITHUB_OUTPUT - - name: Set refs - id: set-refs + - name: Checkout build-ci + uses: actions/checkout@v4 + with: + repository: access-nri/build-ci + ref: ${{ env.BUILD_CI_WORKFLOW_VERSION }} + + - name: Get default refs from build-ci workflow + id: defaults + # GitHub does not treat empty-string inputs as eligible for substitution with a default + # Since we are supporting both workflow_dispatch and pull_request triggers, the entrypoint inputs need to be filled in + # So we are getting the default values from the workflow file itself, and passing them back into the workflow + # builtin-spack-packages-ref does not need this as the input handles the empty string default. run: | - echo "spack-packages-ref=${{ inputs.spack-packages-ref || env.DEFAULT_SPACK_PACKAGES_REF }}" >> $GITHUB_OUTPUT - echo "spack-config-ref=${{ inputs.spack-config-ref || env.DEFAULT_SPACK_CONFIG_REF }}" >> $GITHUB_OUTPUT - echo "spack-ref=${{ inputs.spack-ref || env.DEFAULT_SPACK_REF }}" >> $GITHUB_OUTPUT + default_spack_ref=$(yq '.on.workflow_call.inputs."spack-ref".default' .github/workflows/ci.yml) + default_spack_config_ref=$(yq '.on.workflow_call.inputs."spack-config-ref".default' .github/workflows/ci.yml) + + echo "Default refs from ${{ env.BUILD_CI_WORKFLOW_VERSION }}: spack-ref=$default_spack_ref, spack-config=$default_spack_config_ref" + + echo "spack-ref=$default_spack_ref" >> $GITHUB_OUTPUT + echo "spack-config-ref=$default_spack_config_ref" >> $GITHUB_OUTPUT ci: name: CI @@ -131,17 +150,33 @@ jobs: - setup-ci strategy: fail-fast: false - max-parallel: 3 + max-parallel: 7 matrix: package: ${{ fromJson(needs.setup-ci.outputs.matrix) }} - uses: access-nri/build-ci/.github/workflows/ci.yml@v2 + exclude: + - package: {template_value: "access-om2"} + - package: {template_value: "access-om2-bgc"} + - package: {template_value: "access-om3"} + - package: {template_value: "access-esm1p5"} + - package: {template_value: "access-esm1p6"} + - package: {template_value: "access-am3"} + - package: {template_value: "access-ram3"} + - package: {template_value: "access-issm"} + - package: {template_value: "access-test"} + - package: {template_value: "coastri-roms"} + - package: {template_value: "gcom"} + - package: {template_value: "gcom4"} + - package: {template_value: "um"} + uses: access-nri/build-ci/.github/workflows/ci.yml@v3 with: spack-manifest-path: ${{ matrix.package.filepath }} spack-manifest-data-path: .github/build-ci/data/standard_definitions.json spack-manifest-data-pairs: |- package ${{ matrix.package.template_value }} - spack-packages-ref: ${{ needs.setup-ci.outputs.spack-packages-ref }} + builtin-spack-packages-ref: ${{ needs.setup-ci.outputs.builtin-spack-packages-ref }} + access-spack-packages-ref: ${{ needs.setup-ci.outputs.access-spack-packages-ref }} spack-config-ref: ${{ needs.setup-ci.outputs.spack-config-ref }} spack-ref: ${{ needs.setup-ci.outputs.spack-ref }} + # container-image-version: :rocky secrets: spack-install-command-pat: ${{ secrets.SPACK_INSTALL_COMMAND_PAT }} diff --git a/spack-repo-index.yaml b/spack-repo-index.yaml new file mode 100644 index 00000000..a48531b3 --- /dev/null +++ b/spack-repo-index.yaml @@ -0,0 +1,3 @@ +repo_index: + paths: + - spack_repo/access/nri diff --git a/spack_repo/access/nri/__init__.py b/spack_repo/access/nri/__init__.py new file mode 100644 index 00000000..c4ecc87f --- /dev/null +++ b/spack_repo/access/nri/__init__.py @@ -0,0 +1,3 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/spack_repo/access/nri/packages/__init__.py b/spack_repo/access/nri/packages/__init__.py new file mode 100644 index 00000000..c4ecc87f --- /dev/null +++ b/spack_repo/access/nri/packages/__init__.py @@ -0,0 +1,3 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) diff --git a/packages/access3/package.py b/spack_repo/access/nri/packages/access3/package.py old mode 100755 new mode 100644 similarity index 95% rename from packages/access3/package.py rename to spack_repo/access/nri/packages/access3/package.py index 31bd72e9..af732cc4 --- a/packages/access3/package.py +++ b/spack_repo/access/nri/packages/access3/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * # supported model configurations @@ -61,6 +62,9 @@ class Access3(CMakePackage): msg=f"A configurations variant must be set, can be one or many of {KNOWN_CONF}" ) + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("cmake@3.18:", type="build") depends_on("mpi") depends_on("access3-share") diff --git a/packages/access3-share/package.py b/spack_repo/access/nri/packages/access3_share/package.py old mode 100755 new mode 100644 similarity index 91% rename from packages/access3-share/package.py rename to spack_repo/access/nri/packages/access3_share/package.py index a5dfc528..d403bdf0 --- a/packages/access3-share/package.py +++ b/spack_repo/access/nri/packages/access3_share/package.py @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * -from spack.pkg.access.nri.access3 import ACCESS3_VERSIONS +from spack_repo.access.nri.packages.access3.package import ACCESS3_VERSIONS class Access3Share(CMakePackage): """Shared coupler/mediator libraries used by the ACCESS version 3 climate @@ -25,6 +26,9 @@ class Access3Share(CMakePackage): variant("openmp", default=False, description="Enable OpenMP") + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("cmake@3.18:", type="build") depends_on("mpi") depends_on("netcdf-fortran@4.6.0:") diff --git a/packages/access-am3/package.py b/spack_repo/access/nri/packages/access_am3/package.py similarity index 87% rename from packages/access-am3/package.py rename to spack_repo/access/nri/packages/access_am3/package.py index be6e27d0..72b255a3 100644 --- a/packages/access-am3/package.py +++ b/spack_repo/access/nri/packages/access_am3/package.py @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * diff --git a/packages/access-cice/package.py b/spack_repo/access/nri/packages/access_cice/package.py old mode 100755 new mode 100644 similarity index 94% rename from packages/access-cice/package.py rename to spack_repo/access/nri/packages/access_cice/package.py index 8f2dcf9b..653e1cd4 --- a/packages/access-cice/package.py +++ b/spack_repo/access/nri/packages/access_cice/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * @@ -42,6 +43,9 @@ class AccessCice(CMakePackage): description="CICE driver path" ) + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("access3-share", when="+access3") depends_on("cmake@3.18:", type="build") depends_on("mpi") diff --git a/packages/access-esm1p5/package.py b/spack_repo/access/nri/packages/access_esm1p5/package.py similarity index 94% rename from packages/access-esm1p5/package.py rename to spack_repo/access/nri/packages/access_esm1p5/package.py index a282cbaf..5cef716e 100644 --- a/packages/access-esm1p5/package.py +++ b/spack_repo/access/nri/packages/access_esm1p5/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * class AccessEsm1p5(BundlePackage): diff --git a/packages/access-esm1p6/package.py b/spack_repo/access/nri/packages/access_esm1p6/package.py similarity index 96% rename from packages/access-esm1p6/package.py rename to spack_repo/access/nri/packages/access_esm1p6/package.py index eeac6a5a..d8f1c876 100644 --- a/packages/access-esm1p6/package.py +++ b/spack_repo/access/nri/packages/access_esm1p6/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * class AccessEsm1p6(BundlePackage): diff --git a/packages/access-fms/package.py b/spack_repo/access/nri/packages/access_fms/package.py similarity index 93% rename from packages/access-fms/package.py rename to spack_repo/access/nri/packages/access_fms/package.py index 5c888e65..8967b294 100644 --- a/packages/access-fms/package.py +++ b/spack_repo/access/nri/packages/access_fms/package.py @@ -5,6 +5,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * @@ -37,6 +38,10 @@ class AccessFms(CMakePackage): # To build a shared/dynamic library, both `pic` and `shared` are required: requires("+pic", when="+shared", msg="The +shared variant requires +pic") + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") + depends_on("netcdf-c") depends_on("netcdf-fortran") depends_on("mpi") diff --git a/packages/access-generic-tracers/package.py b/spack_repo/access/nri/packages/access_generic_tracers/package.py similarity index 96% rename from packages/access-generic-tracers/package.py rename to spack_repo/access/nri/packages/access_generic_tracers/package.py index 812b086c..472534cc 100644 --- a/packages/access-generic-tracers/package.py +++ b/spack_repo/access/nri/packages/access_generic_tracers/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * @@ -42,6 +43,8 @@ class AccessGenericTracers(CMakePackage): description="If True, depend on access-fms, otherwise depend on fms" ) + depends_on("fortran", type="build") + depends_on("mpi") depends_on("access-mocsy@2025.07.001:") # >= 2025.07.001 for CMake BS with "mocsy" target name # TODO: Make conditional once Spack v0.23 or newer is used. The newer diff --git a/packages/access-issm/package.py b/spack_repo/access/nri/packages/access_issm/package.py similarity index 90% rename from packages/access-issm/package.py rename to spack_repo/access/nri/packages/access_issm/package.py index 4a9a9a30..543863d1 100644 --- a/packages/access-issm/package.py +++ b/spack_repo/access/nri/packages/access_issm/package.py @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * diff --git a/packages/access-mocsy/package.py b/spack_repo/access/nri/packages/access_mocsy/package.py similarity index 94% rename from packages/access-mocsy/package.py rename to spack_repo/access/nri/packages/access_mocsy/package.py index cfc93f11..eaa50b40 100644 --- a/packages/access-mocsy/package.py +++ b/spack_repo/access/nri/packages/access_mocsy/package.py @@ -5,7 +5,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack.build_systems import cmake, makefile +from spack_repo.builtin.build_systems import cmake, makefile +from spack_repo.builtin.build_systems.cmake import CMakePackage +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * @@ -51,6 +53,9 @@ class AccessMocsy(CMakePackage, MakefilePackage): values=("1", "2"), ) + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("mpi") diff --git a/packages/access-mom6/package.py b/spack_repo/access/nri/packages/access_mom6/package.py old mode 100755 new mode 100644 similarity index 95% rename from packages/access-mom6/package.py rename to spack_repo/access/nri/packages/access_mom6/package.py index acdaffff..8fce5c5b --- a/packages/access-mom6/package.py +++ b/spack_repo/access/nri/packages/access_mom6/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * @@ -44,6 +45,9 @@ class AccessMom6(CMakePackage): when="@2025.07.001:" ) + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("access3-share", when="+access3") depends_on("cmake@3.18:", type="build") depends_on("mpi") diff --git a/packages/access-om2/package.py b/spack_repo/access/nri/packages/access_om2/package.py similarity index 94% rename from packages/access-om2/package.py rename to spack_repo/access/nri/packages/access_om2/package.py index 2e31aad9..0948b120 100644 --- a/packages/access-om2/package.py +++ b/spack_repo/access/nri/packages/access_om2/package.py @@ -5,6 +5,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * class AccessOm2(BundlePackage): diff --git a/packages/access-om2-bgc/package.py b/spack_repo/access/nri/packages/access_om2_bgc/package.py similarity index 94% rename from packages/access-om2-bgc/package.py rename to spack_repo/access/nri/packages/access_om2_bgc/package.py index 6fb2a586..71e25f69 100644 --- a/packages/access-om2-bgc/package.py +++ b/spack_repo/access/nri/packages/access_om2_bgc/package.py @@ -5,6 +5,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * class AccessOm2Bgc(BundlePackage): diff --git a/packages/access-om3/package.py b/spack_repo/access/nri/packages/access_om3/package.py similarity index 90% rename from packages/access-om3/package.py rename to spack_repo/access/nri/packages/access_om3/package.py index f1189c33..998b87d1 100644 --- a/packages/access-om3/package.py +++ b/spack_repo/access/nri/packages/access_om3/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * diff --git a/packages/access-ram3/package.py b/spack_repo/access/nri/packages/access_ram3/package.py similarity index 91% rename from packages/access-ram3/package.py rename to spack_repo/access/nri/packages/access_ram3/package.py index ffb25637..077b50f9 100644 --- a/packages/access-ram3/package.py +++ b/spack_repo/access/nri/packages/access_ram3/package.py @@ -5,6 +5,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * diff --git a/packages/access-test/package.py b/spack_repo/access/nri/packages/access_test/package.py similarity index 92% rename from packages/access-test/package.py rename to spack_repo/access/nri/packages/access_test/package.py index 2e93f8c8..feed166d 100644 --- a/packages/access-test/package.py +++ b/spack_repo/access/nri/packages/access_test/package.py @@ -5,6 +5,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * class AccessTest(BundlePackage): diff --git a/packages/access-test-component/package.py b/spack_repo/access/nri/packages/access_test_component/package.py similarity index 89% rename from packages/access-test-component/package.py rename to spack_repo/access/nri/packages/access_test_component/package.py index bc6222ec..c0c5985e 100644 --- a/packages/access-test-component/package.py +++ b/spack_repo/access/nri/packages/access_test_component/package.py @@ -4,6 +4,7 @@ # Based on spack/var/spack/repos/builtin/packages/fiat/package.py +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * @@ -24,6 +25,8 @@ class AccessTestComponent(CMakePackage): variant("mpi", default=True, description="Use MPI") + depends_on("fortran", type="build") + depends_on("mpi", when="+mpi") root_cmakelists_dir = "stub" diff --git a/packages/access-triangle/package.py b/spack_repo/access/nri/packages/access_triangle/package.py similarity index 96% rename from packages/access-triangle/package.py rename to spack_repo/access/nri/packages/access_triangle/package.py index 2348f675..0748d12e 100644 --- a/packages/access-triangle/package.py +++ b/spack_repo/access/nri/packages/access_triangle/package.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * # import os @@ -25,6 +26,8 @@ class AccessTriangle(MakefilePackage): variant("showme", default=False, description="Build the showme utility (requires libX11).") + depends_on("c", type="build") + # Make libX11 conditional on +showme depends_on("libx11", when="+showme", type="link") diff --git a/packages/access-ww3/package.py b/spack_repo/access/nri/packages/access_ww3/package.py old mode 100755 new mode 100644 similarity index 91% rename from packages/access-ww3/package.py rename to spack_repo/access/nri/packages/access_ww3/package.py index db307986..e8da6b32 --- a/packages/access-ww3/package.py +++ b/spack_repo/access/nri/packages/access_ww3/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class AccessWw3(CMakePackage): @@ -26,6 +27,9 @@ class AccessWw3(CMakePackage): description="Install WW3 as library for Access3 models" ) + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("access3-share", when="+access3") depends_on("cmake@3.18:", type="build") depends_on("mpi") diff --git a/packages/ancoms-roms/package.py b/spack_repo/access/nri/packages/ancoms_roms/package.py similarity index 97% rename from packages/ancoms-roms/package.py rename to spack_repo/access/nri/packages/ancoms_roms/package.py index 50cad41b..e5456e85 100644 --- a/packages/ancoms-roms/package.py +++ b/spack_repo/access/nri/packages/ancoms_roms/package.py @@ -5,6 +5,7 @@ import os import sys +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * @@ -53,6 +54,9 @@ class AncomsRoms(MakefilePackage): depends_on("curl") depends_on("amdlibm", when="%aocc") + depends_on("c", type="build") + depends_on("fortran", type="build") + # Note: you cannot set USE_OpenMP and USE_MPI at the same time conflicts("+mpi+openmp") diff --git a/packages/cable/package.py b/spack_repo/access/nri/packages/cable/package.py similarity index 91% rename from packages/cable/package.py rename to spack_repo/access/nri/packages/cable/package.py index e2a2e548..8d125b75 100644 --- a/packages/cable/package.py +++ b/spack_repo/access/nri/packages/cable/package.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * # See https://spack.readthedocs.io/en/latest/packaging_guide.html for a guide @@ -44,6 +45,9 @@ class Cable(CMakePackage): values=("Debug", "Release"), ) + depends_on("cxx", type="build") + depends_on("fortran", type="build") + depends_on("netcdf-fortran@4.5.2:") depends_on("mpi", when="+mpi") diff --git a/packages/cice4/package.py b/spack_repo/access/nri/packages/cice4/package.py similarity index 95% rename from packages/cice4/package.py rename to spack_repo/access/nri/packages/cice4/package.py index e98d37f2..6cc70c4d 100644 --- a/packages/cice4/package.py +++ b/spack_repo/access/nri/packages/cice4/package.py @@ -4,6 +4,7 @@ # Based on packages/cice5/package.py and other sources noted below. +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * @@ -30,6 +31,9 @@ class Cice4(MakefilePackage): description="Directly inject LDFLAGS into the Makefile", ) + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("netcdf-fortran@4.5.1:") depends_on("openmpi") depends_on("oasis3-mct") @@ -115,6 +119,9 @@ def edit(self, spec, prefix): # Add support for the ifx compiler config["oneapi"] = config["intel"] + # Add support for Spack v1.0 + config["intel-oneapi-compilers"] = config["intel"] + config["intel-oneapi-compilers-classic"] = config["intel"] # Based on https://github.com/ACCESS-NRI/cice4/blob/access-esm1.5/bld/Macros.nci config["post"] = """ diff --git a/packages/cice4/spack-build.sh b/spack_repo/access/nri/packages/cice4/spack-build.sh similarity index 100% rename from packages/cice4/spack-build.sh rename to spack_repo/access/nri/packages/cice4/spack-build.sh diff --git a/packages/cice5/package.py b/spack_repo/access/nri/packages/cice5/package.py old mode 100755 new mode 100644 similarity index 96% rename from packages/cice5/package.py rename to spack_repo/access/nri/packages/cice5/package.py index 41302d8e..40986d16 --- a/packages/cice5/package.py +++ b/spack_repo/access/nri/packages/cice5/package.py @@ -2,7 +2,9 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack.build_systems import cmake, makefile +from spack_repo.builtin.build_systems import cmake, makefile +from spack_repo.builtin.build_systems.cmake import CMakePackage +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * def _int_validator(s): @@ -79,6 +81,9 @@ class Cice5(CMakePackage, MakefilePackage): variant("blcky", default="none", values=_int_validator, description="Size of computational blocks in y") variant("mxblcks", default="none", values=_int_validator, description="Max number of blocks per task") + depends_on("c", type="build") + depends_on("fortran", type="build") + # Depend on virtual package "mpi". depends_on("mpi") depends_on("netcdf-fortran@4.5.2:") @@ -260,6 +265,9 @@ def edit(self, pkg, spec, prefix): # Add support for the ifx compiler config["oneapi"] = config["intel"] + # Add support for Spack v1.0 + config["intel-oneapi-compilers"] = config["intel"] + config["intel-oneapi-compilers-classic"] = config["intel"] # Copied from bld/Macros.nci config["post"] = f""" diff --git a/packages/cice5/spack-build.sh b/spack_repo/access/nri/packages/cice5/spack-build.sh similarity index 100% rename from packages/cice5/spack-build.sh rename to spack_repo/access/nri/packages/cice5/spack-build.sh diff --git a/packages/coastri-roms/package.py b/spack_repo/access/nri/packages/coastri_roms/package.py similarity index 91% rename from packages/coastri-roms/package.py rename to spack_repo/access/nri/packages/coastri_roms/package.py index 038aab4a..e3a4df08 100644 --- a/packages/coastri-roms/package.py +++ b/spack_repo/access/nri/packages/coastri_roms/package.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.bundle import BundlePackage from spack.package import * diff --git a/packages/datetime-fortran/0001-Enable-deterministic-builds-using-D-flag-for-ar.patch b/spack_repo/access/nri/packages/datetime_fortran/0001-Enable-deterministic-builds-using-D-flag-for-ar.patch similarity index 100% rename from packages/datetime-fortran/0001-Enable-deterministic-builds-using-D-flag-for-ar.patch rename to spack_repo/access/nri/packages/datetime_fortran/0001-Enable-deterministic-builds-using-D-flag-for-ar.patch diff --git a/packages/datetime-fortran/package.py b/spack_repo/access/nri/packages/datetime_fortran/package.py similarity index 95% rename from packages/datetime-fortran/package.py rename to spack_repo/access/nri/packages/datetime_fortran/package.py index 95aa0428..1175c903 100644 --- a/packages/datetime-fortran/package.py +++ b/spack_repo/access/nri/packages/datetime_fortran/package.py @@ -20,6 +20,7 @@ # See the Spack documentation for more information on packaging. # ---------------------------------------------------------------------------- +from spack_repo.builtin.build_systems.autotools import AutotoolsPackage from spack.package import * @@ -39,6 +40,8 @@ class DatetimeFortran(AutotoolsPackage): version('1.4.2', sha256='5b70c6e5d38032951e879b437e9ac7c5d483860ce8a9f6bbe6f1d6cd777e737f') version('1.4.1', sha256='4a178b63301f0016b7634625062278742a44026f4c37cafcb9e8ba9649db85e0') + depends_on("fortran", type="build") + patch("0001-Enable-deterministic-builds-using-D-flag-for-ar.patch", when="@1.7.0") def url_for_version(self, version): diff --git a/packages/dummygrib/package.py b/spack_repo/access/nri/packages/dummygrib/package.py similarity index 88% rename from packages/dummygrib/package.py rename to spack_repo/access/nri/packages/dummygrib/package.py index 21058aaa..103a5c73 100644 --- a/packages/dummygrib/package.py +++ b/spack_repo/access/nri/packages/dummygrib/package.py @@ -6,6 +6,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * @@ -21,6 +22,7 @@ class Dummygrib(MakefilePackage): version("1.0", branch="master") + depends_on("fortran", type="build") def install(self, spec, prefix): diff --git a/packages/fcm/etc/nci-gadi/keyword.cfg b/spack_repo/access/nri/packages/fcm/etc/nci-gadi/keyword.cfg similarity index 100% rename from packages/fcm/etc/nci-gadi/keyword.cfg rename to spack_repo/access/nri/packages/fcm/etc/nci-gadi/keyword.cfg diff --git a/packages/fcm/package.py b/spack_repo/access/nri/packages/fcm/package.py similarity index 87% rename from packages/fcm/package.py rename to spack_repo/access/nri/packages/fcm/package.py index 404b415c..4fc66f64 100644 --- a/packages/fcm/package.py +++ b/spack_repo/access/nri/packages/fcm/package.py @@ -1,3 +1,4 @@ +from spack_repo.builtin.build_systems.generic import Package from spack.package import * @@ -18,6 +19,9 @@ class Fcm(Package): variant("site", default="none", description="Site to use for keyword configuration", values=("none", "nci-gadi"), multi=False) + depends_on("c", type="build") + depends_on("fortran", type="build") + def url_for_version(self, version): return "https://github.com/metomi/fcm/archive/refs/tags/{0}.tar.gz".format(version) diff --git a/packages/fiat/intel_warnings_v110.patch b/spack_repo/access/nri/packages/fiat/intel_warnings_v110.patch similarity index 100% rename from packages/fiat/intel_warnings_v110.patch rename to spack_repo/access/nri/packages/fiat/intel_warnings_v110.patch diff --git a/packages/fiat/intel_warnings_v120.patch b/spack_repo/access/nri/packages/fiat/intel_warnings_v120.patch similarity index 100% rename from packages/fiat/intel_warnings_v120.patch rename to spack_repo/access/nri/packages/fiat/intel_warnings_v120.patch diff --git a/packages/fiat/package.py b/spack_repo/access/nri/packages/fiat/package.py similarity index 92% rename from packages/fiat/package.py rename to spack_repo/access/nri/packages/fiat/package.py index 11dfc1f6..b7cfa9dc 100644 --- a/packages/fiat/package.py +++ b/spack_repo/access/nri/packages/fiat/package.py @@ -5,6 +5,7 @@ # Based on spack/var/spack/repos/builtin/packages/fiat/package.py +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * @@ -37,6 +38,10 @@ class Fiat(CMakePackage): variant("openmp", default=True, description="Use OpenMP") variant("fckit", default=True, description="Use fckit") + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("fortran", type="build") + depends_on("ecbuild", type=("build")) depends_on("mpi", when="+mpi") depends_on("eckit", when="+fckit") diff --git a/packages/fortranxml/package.py b/spack_repo/access/nri/packages/fortranxml/package.py similarity index 92% rename from packages/fortranxml/package.py rename to spack_repo/access/nri/packages/fortranxml/package.py index 110d0caa..abbff132 100644 --- a/packages/fortranxml/package.py +++ b/spack_repo/access/nri/packages/fortranxml/package.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.autotools import AutotoolsPackage from spack.package import * @@ -19,6 +20,8 @@ class Fortranxml(AutotoolsPackage): version("4.1.2", sha256="1938725be45b8be5387a51fa0b25ee78ffee87ca8a497b82545ab870f33f8b88") + depends_on("fortran", type="build") + def url_for_version(self, version): return "https://github.com/andreww/fox/tarball/{0}".format(version) diff --git a/packages/fre-nctools/package.py b/spack_repo/access/nri/packages/fre_nctools/package.py similarity index 94% rename from packages/fre-nctools/package.py rename to spack_repo/access/nri/packages/fre_nctools/package.py index 2979d488..689c438b 100644 --- a/packages/fre-nctools/package.py +++ b/spack_repo/access/nri/packages/fre_nctools/package.py @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.autotools import AutotoolsPackage from spack.package import * @@ -39,6 +40,9 @@ class FreNctools(AutotoolsPackage): variant("mpi", default=False, description="Builds with MPI support") + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("autoconf", type="build") depends_on("automake", type="build") depends_on("libtool", type="build") diff --git a/packages/gcom/package.py b/spack_repo/access/nri/packages/gcom/package.py similarity index 93% rename from packages/gcom/package.py rename to spack_repo/access/nri/packages/gcom/package.py index e320715e..c97b2b51 100644 --- a/packages/gcom/package.py +++ b/spack_repo/access/nri/packages/gcom/package.py @@ -1,3 +1,4 @@ +from spack_repo.builtin.build_systems.generic import Package from spack.package import * @@ -22,6 +23,9 @@ class Gcom(Package): variant("mpi", default=True, description="Build with MPI") + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("fcm", type="build") depends_on("mpi", when="+mpi", type=("build", "link", "run")) # For the default MPI version for NCI, see (e.g.) diff --git a/packages/gcom4/package.py b/spack_repo/access/nri/packages/gcom4/package.py similarity index 95% rename from packages/gcom4/package.py rename to spack_repo/access/nri/packages/gcom4/package.py index 5a92e5bc..d34e3693 100644 --- a/packages/gcom4/package.py +++ b/spack_repo/access/nri/packages/gcom4/package.py @@ -7,6 +7,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.generic import Package from spack.package import * @@ -24,6 +25,10 @@ class Gcom4(Package): version("access-esm1.5", branch="access-esm1.5") variant("mpi", default=True, description="Build with MPI") + + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("fcm", type="build") depends_on("mpi", when="+mpi") diff --git a/packages/issm/package.py b/spack_repo/access/nri/packages/issm/package.py similarity index 99% rename from packages/issm/package.py rename to spack_repo/access/nri/packages/issm/package.py index dab35d57..523ee268 100644 --- a/packages/issm/package.py +++ b/spack_repo/access/nri/packages/issm/package.py @@ -5,6 +5,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.autotools import AutotoolsPackage from spack.package import * import zipfile import os @@ -70,6 +71,7 @@ class Issm(AutotoolsPackage): # Dependencies # -------------------------------------------------------------------- # Build-time tools + depends_on("cxx", type="build") depends_on("autoconf", type="build") depends_on("automake", type="build") depends_on("libtool", type="build") diff --git a/packages/libaccessom2/package.py b/spack_repo/access/nri/packages/libaccessom2/package.py similarity index 95% rename from packages/libaccessom2/package.py rename to spack_repo/access/nri/packages/libaccessom2/package.py index b2da4f9f..33e40d74 100644 --- a/packages/libaccessom2/package.py +++ b/spack_repo/access/nri/packages/libaccessom2/package.py @@ -5,6 +5,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * class Libaccessom2(CMakePackage): @@ -25,6 +26,8 @@ class Libaccessom2(CMakePackage): values=('Debug', 'Release') ) + depends_on("fortran", type="build") + depends_on("cmake@3.20:", type="build") depends_on("pkgconfig", type="build") # Depend on virtual package "mpi". diff --git a/packages/m1qn3/m1qn3.patch b/spack_repo/access/nri/packages/m1qn3/m1qn3.patch similarity index 100% rename from packages/m1qn3/m1qn3.patch rename to spack_repo/access/nri/packages/m1qn3/m1qn3.patch diff --git a/packages/m1qn3/package.py b/spack_repo/access/nri/packages/m1qn3/package.py similarity index 92% rename from packages/m1qn3/package.py rename to spack_repo/access/nri/packages/m1qn3/package.py index 308b2599..a2be7671 100644 --- a/packages/m1qn3/package.py +++ b/spack_repo/access/nri/packages/m1qn3/package.py @@ -6,6 +6,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * @@ -16,6 +17,8 @@ class M1qn3(MakefilePackage): version("3.3", sha256="27c6a8f56a4080420c25ffb0743e3dece7c57cc1740776936f220b4ed28b89d9") + depends_on("fortran", type="build") + patch("m1qn3.patch") def url_for_version(self, version): diff --git a/packages/mom5/package.py b/spack_repo/access/nri/packages/mom5/package.py similarity index 97% rename from packages/mom5/package.py rename to spack_repo/access/nri/packages/mom5/package.py index 085c2baf..cf3d4905 100644 --- a/packages/mom5/package.py +++ b/spack_repo/access/nri/packages/mom5/package.py @@ -4,8 +4,10 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack.build_systems import cmake, makefile +from spack_repo.builtin.build_systems import cmake, makefile from spack.version.version_types import GitVersion, StandardVersion +from spack_repo.builtin.build_systems.cmake import CMakePackage +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * @@ -27,6 +29,9 @@ class Mom5(CMakePackage, MakefilePackage): version("access-esm1.5", branch="access-esm1.5") version("access-esm1.6", branch="master") + depends_on("c", type="build") + depends_on("fortran", type="build") + # NOTE: @mom matches both mom_solo and mom_sis build_system( conditional("makefile", when="@access-om2,legacy-access-om2-bgc,access-esm1.5"), @@ -421,6 +426,9 @@ def edit(self, pkg, spec, prefix): # icx: error: unsupported argument 'source' to option '-ffp-model=' # The `.replace()` apparently doesn't modify the object. config["oneapi"] = config["intel"].replace("CFLAGS_REPRO := -fp-model precise -fp-model source", "CFLAGS_REPRO := -fp-model precise") + # Add support for Spack v1.0 + config["intel-oneapi-compilers"] = config["oneapi"] + config["intel-oneapi-compilers-classic"] = config["oneapi"] if self.__version == "access-esm1.5": config["post"] = """ diff --git a/packages/mppnccombine-fast/package.py b/spack_repo/access/nri/packages/mppnccombine_fast/package.py similarity index 85% rename from packages/mppnccombine-fast/package.py rename to spack_repo/access/nri/packages/mppnccombine_fast/package.py index dba89d33..dc6b3a78 100644 --- a/packages/mppnccombine-fast/package.py +++ b/spack_repo/access/nri/packages/mppnccombine_fast/package.py @@ -4,6 +4,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.cmake import CMakePackage from spack.package import * @@ -22,7 +23,10 @@ class MppnccombineFast(CMakePackage): version("2025.07.000", sha256="d74ef9b47aa6a6aac2d2f802f146b59d585104a780b65571fe7fda78e69af553") + depends_on("c", type="build") + depends_on("cxx", type="build") + depends_on("cmake@3.10:", type="build") depends_on("mpi") depends_on("hdf5") - depends_on("netcdf-c") \ No newline at end of file + depends_on("netcdf-c") diff --git a/packages/nci-intel-oneapi-mkl/package.py b/spack_repo/access/nri/packages/nci_intel_oneapi_mkl/package.py similarity index 85% rename from packages/nci-intel-oneapi-mkl/package.py rename to spack_repo/access/nri/packages/nci_intel_oneapi_mkl/package.py index 0e44a1c1..ef42d015 100644 --- a/packages/nci-intel-oneapi-mkl/package.py +++ b/spack_repo/access/nri/packages/nci_intel_oneapi_mkl/package.py @@ -5,7 +5,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack.pkg.builtin.intel_oneapi_mkl import IntelOneapiMkl +from spack_repo.builtin.packages.intel_oneapi_mkl.package import IntelOneapiMkl class NciIntelOneapiMkl(IntelOneapiMkl): @property diff --git a/packages/oasis3-mct/package.py b/spack_repo/access/nri/packages/oasis3_mct/package.py similarity index 96% rename from packages/oasis3-mct/package.py rename to spack_repo/access/nri/packages/oasis3_mct/package.py index 84f4f885..920c82a3 100644 --- a/packages/oasis3-mct/package.py +++ b/spack_repo/access/nri/packages/oasis3_mct/package.py @@ -5,6 +5,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.makefile import MakefilePackage from spack.package import * @@ -35,6 +36,9 @@ class Oasis3Mct(MakefilePackage): variant("deterministic", default=False, description="Deterministic build.") variant("optimisation_report", default=False, description="Generate optimisation reports.") + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("netcdf-fortran@4.5.2:") # Depend on virtual package "mpi". depends_on("mpi") @@ -188,6 +192,9 @@ def edit(self, spec, prefix): # Add support for the ifx compiler config["oneapi"] = config["intel"] + # Add support for Spack v1.0 + config["intel-oneapi-compilers"] = config["intel"] + config["intel-oneapi-compilers-classic"] = config["intel"] config["post"] = """ f90FLAGS_1 = $(F90FLAGS_1) diff --git a/packages/um/fcm-make.cfg b/spack_repo/access/nri/packages/um/fcm-make.cfg similarity index 100% rename from packages/um/fcm-make.cfg rename to spack_repo/access/nri/packages/um/fcm-make.cfg diff --git a/packages/um/model/vn13/rose-app.conf b/spack_repo/access/nri/packages/um/model/vn13/rose-app.conf similarity index 100% rename from packages/um/model/vn13/rose-app.conf rename to spack_repo/access/nri/packages/um/model/vn13/rose-app.conf diff --git a/packages/um/model/vn13p0-rns/rose-app.conf b/spack_repo/access/nri/packages/um/model/vn13p0-rns/rose-app.conf similarity index 100% rename from packages/um/model/vn13p0-rns/rose-app.conf rename to spack_repo/access/nri/packages/um/model/vn13p0-rns/rose-app.conf diff --git a/packages/um/model/vn13p1-am/rose-app.conf b/spack_repo/access/nri/packages/um/model/vn13p1-am/rose-app.conf similarity index 100% rename from packages/um/model/vn13p1-am/rose-app.conf rename to spack_repo/access/nri/packages/um/model/vn13p1-am/rose-app.conf diff --git a/packages/um/model/vn13p5-rns/rose-app.conf b/spack_repo/access/nri/packages/um/model/vn13p5-rns/rose-app.conf similarity index 100% rename from packages/um/model/vn13p5-rns/rose-app.conf rename to spack_repo/access/nri/packages/um/model/vn13p5-rns/rose-app.conf diff --git a/packages/um/package.py b/spack_repo/access/nri/packages/um/package.py similarity index 99% rename from packages/um/package.py rename to spack_repo/access/nri/packages/um/package.py index 3080d714..b43dea72 100644 --- a/packages/um/package.py +++ b/spack_repo/access/nri/packages/um/package.py @@ -7,8 +7,9 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) import configparser +from spack_repo.builtin.build_systems.generic import Package from spack.package import * -import llnl.util.tty as tty +import spack.llnl.util.tty as tty import spack.util.git class Um(Package): @@ -119,6 +120,9 @@ class Um(Package): for var in _str_variants: variant(var, default="none", description=var, values="*", multi=False) + depends_on("c", type="build") + depends_on("fortran", type="build") + # The 'site=nci-gadi' variant of fcm defines the keywords # used by the FCM configuration of UM. depends_on("fcm site=nci-gadi", type="build") diff --git a/packages/um7/package.py b/spack_repo/access/nri/packages/um7/package.py similarity index 98% rename from packages/um7/package.py rename to spack_repo/access/nri/packages/um7/package.py index 7bce75e2..ecdb0c08 100644 --- a/packages/um7/package.py +++ b/spack_repo/access/nri/packages/um7/package.py @@ -8,6 +8,7 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems.generic import Package from spack.package import * class Um7(Package): @@ -25,6 +26,9 @@ class Um7(Package): maintainers("penguian", "Whyborn") + depends_on("c", type="build") + depends_on("fortran", type="build") + depends_on("fcm", type="build") depends_on("dummygrib", type=("build", "link")) depends_on("gcom4+mpi", type=("build", "link")) diff --git a/repo.yaml b/spack_repo/access/nri/repo.yaml similarity index 72% rename from repo.yaml rename to spack_repo/access/nri/repo.yaml index 65b8eb6e..485bed4f 100644 --- a/repo.yaml +++ b/spack_repo/access/nri/repo.yaml @@ -1,2 +1,3 @@ repo: namespace: 'access.nri' + api: v2.0