Skip to content

Commit 34bf3c4

Browse files
authored
Merge pull request #372 from esmf-org/hotfix/spack
Fix for spack CI/CD testing
2 parents f783868 + 0a97008 commit 34bf3c4

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.github/workflows/scripts/spack_concretize.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ fi
9595
# find compilers
9696
. spack/share/spack/setup-env.sh
9797
spack compiler find
98-
cat ~/.spack/linux/compilers.yaml
98+
cat ~/.spack/packages.yaml
9999
echo "::endgroup::"
100100

101-
# find external tools
101+
# find external tools, excluding cmake since runner uses 4.0 which is not compatible with some libraries
102102
echo "::group::Find Externals"
103-
spack external find
103+
spack external find --exclude cmake
104104
echo "::endgroup::"
105105

106106
# create config file (to fix FetchError issue)
@@ -137,15 +137,14 @@ fi
137137
# check given gcc compiler is found or not? If not, use newer version
138138
if [[ "$comp" == *"gcc"* ]]; then
139139
echo "::group::Check gcc compiler"
140-
comp_str=${comp/@/@=}
141-
str=`echo $comp_str | awk -F\@ '{print $1}'`
142-
comp_ver=`grep -ir "${str}@=" ~/.spack/linux/compilers.yaml | tr -d "spec: ${str}@=" | sort -n | tail -n 1`
140+
str=`echo $comp | awk -F\@ '{print $1}'`
141+
comp_ver=`spack compiler list | grep "${str}@" | tr -d "${str}@" | sort -n | tail -n 1`
143142

144143
use_latest=0
145144
if [[ "$comp" == *"gcc@latest"* ]]; then
146145
echo "The gcc@latest is set. Trying to find latest available gcc compiler ..."
147146
use_latest=1
148-
elif [ -z "$(cat ~/.spack/linux/compilers.yaml | grep $comp_str)" ]; then
147+
elif [ -z "$(cat ~/.spack/packages.yaml | grep $comp)" ]; then
149148
echo "Given compiler ($comp) is not found! Exiting ..."
150149
exit 1
151150
fi
@@ -168,12 +167,11 @@ echo " specs:" >> spack.yaml
168167
IFS=', ' read -r -a array <<< "$deps"
169168
for d in "${array[@]}"
170169
do
171-
echo " - $d %$comp target=$arch" >> spack.yaml
170+
echo " - $d target=$arch %$comp" >> spack.yaml
172171
done
173172
echo " packages:" >> spack.yaml
174173
echo " all:" >> spack.yaml
175174
echo " target: ['$arch']" >> spack.yaml
176-
echo " compiler: [$comp]" >> spack.yaml
177175
echo " providers:" >> spack.yaml
178176
if [[ "$comp" == *"oneapi"* ]]; then
179177
echo " mpi: [intel-${mpi}]" >> spack.yaml

.github/workflows/test-build-spack.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
sudo apt-get -qq install build-essential binutils-dev gfortran gdb
8585
sudo apt-get -qq install gfortran-12 gfortran-13
8686
sudo apt-get -qq install python3-dev
87+
sudo apt-get -qq install curl libcurl4-openssl-dev
8788
8889
# restore Intel oneAPI compiler installation from cache
8990
- name: Restore Intel oneAPI Compiler Installation

0 commit comments

Comments
 (0)