Skip to content

Commit 85ead5d

Browse files
authored
Merge pull request #123 from casparvl/check_lscpu_flags
Add lscpu output to the build job
2 parents eba6086 + 5bf5d16 commit 85ead5d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

bot/build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,22 @@ else
171171
fi
172172
echo "bot/build.sh: EESSI_ACCELERATOR_TARGET_OVERRIDE='${EESSI_ACCELERATOR_TARGET_OVERRIDE}'"
173173

174+
# Log the full lscpu and os-release info:
175+
lscpu > _bot_job${SLURM_JOB_ID}.lscpu
176+
cat /etc/os-release > _bot_job${SLURM_JOB_ID}.os
177+
178+
# Also: fetch CPU flags into an array, so that we can implement a hard check against a reference
179+
lscpu_flags_line=$(lscpu | grep "Flags:")
180+
# strip leading "Flags:" and spaces, and put result in a bash array
181+
if [[ $lscpu_flags =~ Flags:\ (.*) ]]; then lscpu_flags=(${BASH_REMATCH[1]}); fi
182+
# for now, just print
183+
echo "bot/build.sh: CPU flags=${lscpu_flags[@]}"
184+
# TODO: an actual comparison with a reference bash array, e.g. through
185+
# diff_result=$(diff <(printf "%s\n" "${lscpu_flags[@]}" | sort) <(printf "%s\n" "${lscpu_flags_ref[@]}" | sort))
186+
# if [ ! -z "$diff_result" ]; then
187+
# echo "bot/build.sh: ERROR: difference between reported lscpu flags and reference for this ($EESSI_SOFTWARE_SUBDIR_OVERRIDE) CPU architecture. This could mean an incorrect build host was used to build for this target.
188+
# fi
189+
174190
# get EESSI_OS_TYPE from .architecture.os_type in ${JOB_CFG_FILE} (default: linux)
175191
EESSI_OS_TYPE=$(cfg_get_value "architecture" "os_type")
176192
export EESSI_OS_TYPE=${EESSI_OS_TYPE:-linux}

0 commit comments

Comments
 (0)