fix xcode 15 link problems for OpenMPI

This commit is contained in:
edoapra 2023-09-22 12:27:41 -07:00
parent 23e4b23dab
commit 293dfd6b74
No known key found for this signature in database
GPG key ID: 48E12DA1EDE9E1B0
2 changed files with 21 additions and 1 deletions

14
src/config/fix_xcode15.sh Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
if [[ $(uname -s) == "Darwin" ]]; then
xcode_v=$(/usr/bin/xcodebuild -version |head -n1 |cut -d ' ' -f 2|cut -d '.' -f 1)
# echo $xcode_v
if [[ $( [ $xcode_v -ge 15 ] && echo 1) ]] ; then
echo got xcode15
export GOT_XCODE15=1
export OMPI_FCFLAGS=" -Wl,-ld_classic "
export OMPI_CLAGS=" -Wl,-ld_classic -Wno-unused-command-line-argument "
# export MPICH_FC="mpif90 -Wl,-ld_classic "
# export MPICH_CC="mpicc -Wl,-ld_classic "
# env|egrep MPICH_
fi
fi

View file

@ -16,7 +16,9 @@ else
exit 1
else
MPIF90="mpif90"
MPICC=mpicc
if [[ -z "${MPICC}" ]]; then
MPICC=mpicc
fi
fi
fi
fi
@ -28,6 +30,9 @@ if [[ -z "${NWCHEM_TOP}" ]]; then
dir2=$(dirname "$dir3")
NWCHEM_TOP=$(dirname "$dir2")
fi
# take care of xcode 15 quirks
source ${NWCHEM_TOP}/src/config/fix_xcode15.sh
if [[ ! -z "${BUILD_MPICH}" ]]; then
export PATH=${NWCHEM_TOP}/src/libext/bin:$PATH
if [ -x "$(command -v pkg-config1)" ]; then
@ -200,6 +205,7 @@ if [[ -z "$MPICH_CC" ]] ; then
export MPICH_CC="$CC"
fi
echo MPICH_CC is "$MPICH_CC"
echo $(mpicc -show)
#Intel MPI
if [[ -z "$I_MPI_F90" ]] ; then
export I_MPI_F90="$FC"