Skip to content

Commit

Permalink
Merge pull request #534 from gassmoeller/fix_configure
Browse files Browse the repository at this point in the history
Simplify link flags in configure
  • Loading branch information
feathern authored Jun 20, 2024
2 parents 903e429 + f3c2918 commit 7a3b31f
Showing 1 changed file with 18 additions and 34 deletions.
52 changes: 18 additions & 34 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -849,31 +849,31 @@ if [[ $USE_MKL == "TRUE" ]]
then
if [[ $FVERSION == "INTEL" ]]
then
MKL_LIB="-mkl"
fi
if [[ $FVERSION == "GNU" || $FVERSION == "AOCC" ]]
LIB_FLAGS="-mkl"
elif [[ $FVERSION == "GNU" || $FVERSION == "AOCC" ]]
then
# Start by specifying the directory, unless installed by apt on debian
# in which case it is in default path
if [[ $DEBIANMKL == "FALSE" ]]
then
LIB_FLAGS="-L${RAMKLROOT}/lib"
fi

if [[ $CONDAMKL == "TRUE" ]]
then
if [[ $OSTYPE == *"darwin"* ]]
then
MKL_LIB="-L${RAMKLROOT}/lib -Wl,-rpath,${MKLROOT}/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
FULL_LIB="-L${RAMKLROOT}/lib -Wl,-rpath,${MKLROOT}/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl ${STD_FLAGS}"
OS_SPECIFIC_LIB="-Wl,-rpath,${RAMKLROOT}/lib -lmkl_intel_lp64"
else
MKL_LIB="-L${RAMKLROOT}/lib -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
FULL_LIB="-L${RAMKLROOT}/lib -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl ${STD_FLAGS}"
OS_SPECIFIC_LIB="-Wl,--no-as-needed -lmkl_gf_lp64"
fi
elif [[ $DEBIANMKL == "TRUE" ]]
then
MKL_LIB="-Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
FULL_LIB="-Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl ${STD_FLAGS}"
else
MKL_LIB="-L${RAMKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
FULL_LIB="-L${RAMKLROOT}/lib/intel64 -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl ${STD_FLAGS}"
OS_SPECIFIC_LIB="-Wl,--no-as-needed -lmkl_gf_lp64"
fi
fi

LIB_FLAGS="\$(MKL_LIB) ${STD_FLAGS}"
# Add OS independent options
LIB_FLAGS="${LIB_FLAGS} ${OS_SPECIFIC_LIB} -lmkl_sequential -lmkl_core -lpthread -lm -ldl"
fi
else

#WE NEED TO RUN CHECKS HERE
Expand Down Expand Up @@ -912,17 +912,16 @@ else
FFTWLINK="-L$FFTWROOT/lib -lfftw3"
fi

LIB_FLAGS="\$(LAPACKLINK) \$(FFTWLINK) \$(BLASLINK) \$(STD_FLAGS)"
FULL_LIB="$LAPACKLINK $FFTWLINK $BLASLINK $STD_FLAGS"
# Combine the flags
LIB_FLAGS="${LAPACKLINK} ${FFTWLINK} ${BLASLINK}"
fi

if [ "$CUSTOMLIB" == "TRUE" ]
then
LIB_FLAGS=$RALIB
FULL_LIB=$RALIB
fi

echo " Library flags : "$FULL_LIB
echo " Library flags : "$LIB_FLAGS
echo ""
###############################################################################################
# Create a machine file
Expand Down Expand Up @@ -973,21 +972,6 @@ echo $BORDER >> $OFILE
# V. Optimization and Library flags
echo "# V. Optimization and Library Flags" >> $OFILE
echo "" >> $OFILE
if [[ $USE_MKL != "TRUE" ]]
then
echo "" >> $OFILE
echo "BLASLINK = "$BLASLINK >> $OFILE
echo "LAPACKLINK = "$LAPACKLINK >> $OFILE
echo "FFTWLINK = "$FFTWLINK >> $OFILE
echo "" >> $OFILE
else
if [[ $FVERSION == "GNU" || $FVERSION == "AOCC" ]]
then
echo "" >> $OFILE
echo "MKL_LIB = "$MKL_LIB >> $OFILE
echo "" >> $OFILE
fi
fi
COUNTER=0
while [ $COUNTER -lt $nvers ]; do
VSTR="FFLAGS_\$("${RVTAGS[$COUNTER]}")"
Expand Down

0 comments on commit 7a3b31f

Please sign in to comment.