Skip to content

Commit

Permalink
Restrict check to arch x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrack committed Dec 6, 2022
1 parent b753bb9 commit f751b4c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tools/toolchain/scripts/stage1/install_openmpi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ case "${with_openmpi}" in
[ -d openmpi-${openmpi_ver} ] && rm -rf openmpi-${openmpi_ver}
tar -xzf ${openmpi_pkg}
cd openmpi-${openmpi_ver}
# can have issue with older glibc libraries, in which case
# we need to add the -fgnu89-inline to CFLAGS. We can check
# the version of glibc using ldd --version, as ldd is part of
# glibc package
glibc_version=$(ldd --version | awk '/ldd/{print $NF}')
glibc_major_ver=${glibc_version%%.*}
glibc_minor_ver=${glibc_version##*.}
if [ $glibc_major_ver -lt 2 ] ||
[ $glibc_major_ver -eq 2 -a $glibc_minor_ver -lt 12 ]; then
CFLAGS="${CFLAGS} -fgnu89-inline"
if [ "${OPENBLAS_ARCH}" = "x86_64" ]; then
# can have issue with older glibc libraries, in which case
# we need to add the -fgnu89-inline to CFLAGS. We can check
# the version of glibc using ldd --version, as ldd is part of
# glibc package
glibc_version=$(ldd --version | awk '/ldd/{print $NF}')
glibc_major_ver=${glibc_version%%.*}
glibc_minor_ver=${glibc_version##*.}
if [ $glibc_major_ver -lt 2 ] ||
[ $glibc_major_ver -eq 2 -a $glibc_minor_ver -lt 12 ]; then
CFLAGS="${CFLAGS} -fgnu89-inline"
fi
fi
if [ $(command -v srun) ]; then
echo "Slurm installation found. OpenMPI will be configured with --with-pmi."
Expand Down

0 comments on commit f751b4c

Please sign in to comment.