Make sure configure recognizes FLANG

repack-llvm
sfilippone 7 months ago
parent 0023b8ac78
commit 59e6df73a4

21
configure vendored

@ -3452,7 +3452,7 @@ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_fc_compiler_gnu ac_compiler_gnu=$ac_cv_fc_compiler_gnu
if test -n "$ac_tool_prefix"; then if test -n "$ac_tool_prefix"; then
for ac_prog in ftn xlf2003_r xlf2003 xlf95_r xlf95 xlf90 xlf pgf95 pgf90 ifort ifc nagfor gfortran for ac_prog in ftn xlf2003_r xlf2003 xlf95_r xlf95 xlf90 xlf pgf95 pgf90 flang-new ifort ifc nagfor gfortran
do do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
@ -3501,7 +3501,7 @@ fi
fi fi
if test -z "$FC"; then if test -z "$FC"; then
ac_ct_FC=$FC ac_ct_FC=$FC
for ac_prog in ftn xlf2003_r xlf2003 xlf95_r xlf95 xlf90 xlf pgf95 pgf90 ifort ifc nagfor gfortran for ac_prog in ftn xlf2003_r xlf2003 xlf95_r xlf95 xlf90 xlf pgf95 pgf90 flang-new ifort ifc nagfor gfortran
do do
# Extract the first word of "$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2 set dummy $ac_prog; ac_word=$2
@ -3928,7 +3928,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then if test -n "$ac_tool_prefix"; then
for ac_prog in xlc pgcc icc gcc cc for ac_prog in xlc pgcc clang icc gcc cc
do do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
@ -3977,7 +3977,7 @@ fi
fi fi
if test -z "$CC"; then if test -z "$CC"; then
ac_ct_CC=$CC ac_ct_CC=$CC
for ac_prog in xlc pgcc icc gcc cc for ac_prog in xlc pgcc clang icc gcc cc
do do
# Extract the first word of "$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2 set dummy $ac_prog; ac_word=$2
@ -4424,7 +4424,7 @@ if test -z "$CXX"; then
CXX=$CCC CXX=$CCC
else else
if test -n "$ac_tool_prefix"; then if test -n "$ac_tool_prefix"; then
for ac_prog in CC xlc++ icpc g++ for ac_prog in CC xlc++ clang++ icpc g++
do do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
@ -4473,7 +4473,7 @@ fi
fi fi
if test -z "$CXX"; then if test -z "$CXX"; then
ac_ct_CXX=$CXX ac_ct_CXX=$CXX
for ac_prog in CC xlc++ icpc g++ for ac_prog in CC xlc++ clang++ icpc g++
do do
# Extract the first word of "$ac_prog", so it can be a program name with args. # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2 set dummy $ac_prog; ac_word=$2
@ -6874,10 +6874,12 @@ if test x"$psblas_cv_fc" == "x" ; then
# Sun compiler detection # Sun compiler detection
psblas_cv_fc="sun" psblas_cv_fc="sun"
elif eval "$MPIFC -V 2>&1 | grep Portland 2>/dev/null" ; then elif eval "$MPIFC --version 2>&1 | grep flang-new 2>/dev/null" ; then
# Portland group compiler detection # Portland group compiler detection
psblas_cv_fc="pg" psblas_cv_fc="flang"
psblas_cv_define_prepend=""
FDEFINES="$psblas_cv_define_prepend-DFLANG $FDEFINES"
elif eval "$MPIFC -V 2>&1 | grep Intel.*Fortran.*Compiler 2>/dev/null" ; then elif eval "$MPIFC -V 2>&1 | grep Intel.*Fortran.*Compiler 2>/dev/null" ; then
# Intel compiler identification # Intel compiler identification
@ -7301,6 +7303,9 @@ if test "X$FCOPT" == "X" ; then
elif test "X$psblas_cv_fc" == X"pg" ; then elif test "X$psblas_cv_fc" == X"pg" ; then
# other compilers .. # other compilers ..
FCOPT="-fast $FCOPT" FCOPT="-fast $FCOPT"
elif test "X$psblas_cv_fc" == X"flang" ; then
# other compilers ..
FCOPT="-O3"
# NOTE : PG & Sun use -fast instead -O3 # NOTE : PG & Sun use -fast instead -O3
elif test "X$psblas_cv_fc" == X"sun" ; then elif test "X$psblas_cv_fc" == X"sun" ; then
# other compilers .. # other compilers ..

@ -100,17 +100,17 @@ dnl We set our own FC flags, ignore those from AC_PROG_FC but not those from the
dnl environment variable. Same for C dnl environment variable. Same for C
dnl dnl
save_FCFLAGS="$FCFLAGS"; save_FCFLAGS="$FCFLAGS";
AC_PROG_FC([ftn xlf2003_r xlf2003 xlf95_r xlf95 xlf90 xlf pgf95 pgf90 ifort ifc nagfor gfortran]) AC_PROG_FC([ftn xlf2003_r xlf2003 xlf95_r xlf95 xlf90 xlf pgf95 pgf90 flang-new ifort ifc nagfor gfortran])
FCFLAGS="$save_FCFLAGS"; FCFLAGS="$save_FCFLAGS";
save_CFLAGS="$CFLAGS"; save_CFLAGS="$CFLAGS";
AC_PROG_CC([xlc pgcc icc gcc cc ]) AC_PROG_CC([xlc pgcc clang icc gcc cc ])
if test "x$ac_cv_prog_cc_stdc" == "xno" ; then if test "x$ac_cv_prog_cc_stdc" == "xno" ; then
AC_MSG_ERROR([Problem : Need a C99 compiler ! ]) AC_MSG_ERROR([Problem : Need a C99 compiler ! ])
else else
C99OPT="$ac_cv_prog_cc_stdc"; C99OPT="$ac_cv_prog_cc_stdc";
fi fi
CFLAGS="$save_CFLAGS"; CFLAGS="$save_CFLAGS";
AC_PROG_CXX([CC xlc++ icpc g++]) AC_PROG_CXX([CC xlc++ clang++ icpc g++])
dnl AC_PROG_F90 doesn't exist, at the time of writing this ! dnl AC_PROG_F90 doesn't exist, at the time of writing this !
dnl AC_PROG_F90 dnl AC_PROG_F90
@ -248,10 +248,12 @@ if test x"$psblas_cv_fc" == "x" ; then
# Sun compiler detection # Sun compiler detection
psblas_cv_fc="sun" psblas_cv_fc="sun"
elif eval "$MPIFC -V 2>&1 | grep Portland 2>/dev/null" ; then elif eval "$MPIFC --version 2>&1 | grep flang-new 2>/dev/null" ; then
# Portland group compiler detection # Portland group compiler detection
psblas_cv_fc="pg" psblas_cv_fc="flang"
psblas_cv_define_prepend=""
FDEFINES="$psblas_cv_define_prepend-DFLANG $FDEFINES"
elif eval "$MPIFC -V 2>&1 | grep Intel.*Fortran.*Compiler 2>/dev/null" ; then elif eval "$MPIFC -V 2>&1 | grep Intel.*Fortran.*Compiler 2>/dev/null" ; then
# Intel compiler identification # Intel compiler identification
@ -427,6 +429,9 @@ if test "X$FCOPT" == "X" ; then
elif test "X$psblas_cv_fc" == X"pg" ; then elif test "X$psblas_cv_fc" == X"pg" ; then
# other compilers .. # other compilers ..
FCOPT="-fast $FCOPT" FCOPT="-fast $FCOPT"
elif test "X$psblas_cv_fc" == X"flang" ; then
# other compilers ..
FCOPT="-O3"
# NOTE : PG & Sun use -fast instead -O3 # NOTE : PG & Sun use -fast instead -O3
elif test "X$psblas_cv_fc" == X"sun" ; then elif test "X$psblas_cv_fc" == X"sun" ; then
# other compilers .. # other compilers ..

Loading…
Cancel
Save