Skip to content

Commit

Permalink
cross compilation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
edoapra committed Aug 4, 2023
1 parent 16085dc commit 81c962a
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/libext/openblas/build_openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,21 @@ if [[ "${NWCHEM_TARGET}" == "LINUX" ]]; then
else
binary=64
fi
if [[ -n "${USE_DYNAMIC_ARCH}" ]] || [[ "${USE_HWOPT}" == "n" ]]; then
if [[ "$arch" == "x86_64" ]]; then
FORCETARGET+="DYNAMIC_ARCH=1 DYNAMIC_OLDER=1"
if [[ -z "${CC}" ]]; then
CC=cc
fi
${CC} -dM -E - < /dev/null 2> /dev/null|grep __x86_64__
let cross_comp=$?
echo "cross_code $cross_comp"
if [[ "$cross_comp" == 1 ]]; then
echo "cross compiling "
HOSTCC=gcc
else
if [[ -n "${USE_DYNAMIC_ARCH}" ]] || [[ "${USE_HWOPT}" == "n" ]]; then
if [[ "$arch" == "x86_64" ]]; then
echo "not cross compiling, therefore using DYNAMIC_ARCH "
FORCETARGET+="DYNAMIC_ARCH=1 DYNAMIC_OLDER=1"
fi
fi
fi
#cray ftn wrapper
Expand Down Expand Up @@ -173,9 +185,6 @@ fi
if [[ -z "${FC}" ]]; then
FC=gfortran
fi
if [[ -z "${CC}" ]]; then
CC=cc
fi
if [[ `${CC} -dM -E - < /dev/null 2> /dev/null | grep -c GNU` > 0 ]] ; then
let GCCVERSIONGT5=$(expr `${CC} -dumpversion | cut -f1 -d.` \> 5)
fi
Expand Down

0 comments on commit 81c962a

Please sign in to comment.