diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6771bf2959bf04750b07a1d8a6e60ae24728bc60..78c6ecfd3e31791498a627415ff467bc8e4fa54e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -148,8 +148,20 @@ spack:install_compilers: --key EDC904DCE3D2E84E /buildcache ${hashes} - - | - echo 'definitions: [ compilers: ' $(jq -Mrc '.stack | .core_compiler as $core | .compilers | map("\(.spec)@\(.version) %\($core)")' config.json) ']' > compiler_definitions.yaml + - > + core_compiler=$(jq -Mrc '.stack | .core_compiler' config.json) + + compilers=$(jq -Mrc '.stack | .compilers | to_entries | map("\(.key)@\(.value.version)")' config.json) + + compilers_specs=$(jq -Mrc '.stack | .core_compiler as $core | .compilers | map("\(.spec)@\(.version) %\($core)")' config.json) + + cat > compiler_definitions.yaml << EOF + definitions: + - core_compiler: [ ${core_compiler} ] + - compilers: ${compilers} + - compilers_specs: ${compilers_specs} + EOF + cat compiler_definitions.yaml - | @@ -178,7 +190,7 @@ spack:concretize: - .spack_cache - .parallel_job script: - - spack/bin/spack -e . config blame definitions + - spack/bin/spack -e . config blame - spack/bin/spack -e . concretize needs: - job: spack:install_compilers diff --git a/config.json b/config.json index 402235a6191b17c59b8ad6943424f10f02f43327..0a3fe7783ccbb58a4519602aeae8a3b136ba81f3 100644 --- a/config.json +++ b/config.json @@ -16,7 +16,7 @@ "core_compiler": "gcc@11.4.1 arch=linux-rhel9-x86_64_v2", "compilers": { "gcc": { "spec": "gcc", "version": "12.2.0" }, - "intel": { "spec": "intel-oneapi-compilers", "version": "2023.2.1" } + "oneapi": { "spec": "intel-oneapi-compilers", "version": "2023.2.1" } } } } diff --git a/spack.yaml b/spack.yaml index d465981341e7bd6e968d65d9603445b1ab88097f..0390d2a51b7c6c2801006f616db17ab1e96545cd 100644 --- a/spack.yaml +++ b/spack.yaml @@ -34,7 +34,9 @@ spack: - $mpis specs: - - $compilers + - matrix: + - [$compilers_specs] + - [$%core_compiler] - matrix: - [$all_serial_codes] - [$%compilers]