Commit 62f2d720 authored by Fathom's avatar Fathom
Browse files

Fix pgf90 linkage with C++ correctly.

parent a4adbb28
......@@ -191,7 +191,7 @@ AC_ARG_ENABLE( optimize, AS_HELP_STRING([--enable-optimize],[Compile optimized (
[enable_optimize=""; enable_cxx_optimize="no"; enable_cc_optimize="no"; enable_fc_optimize="no"; ]
)
EXTRA_PGI_FCFLAGS="-Mfree"
EXTRA_PGI_ONLY_FCFLAGS="-Mfree"
if (test "x$enable_debug" != "xno"); then # debug flags
# GNU
EXTRA_GNU_CXXFLAGS="-Wall -Wno-long-long -pipe -pedantic -Wshadow -Wunused-parameter -Wpointer-arith -Wformat -Wformat-security -Wextra -Wno-variadic-macros -Wno-unknown-pragmas"
......@@ -201,7 +201,7 @@ EXTRA_INTEL_CXXFLAGS="-pipe -C"
EXTRA_INTEL_FCFLAGS="-C"
# PGI
EXTRA_PGI_CXXFLAGS="-traceback --diag_suppress 236 --diag_suppress=unrecognized_gcc_pragma -C"
EXTRA_PGI_FCFLAGS="$EXTRA_PGI_FCFLAGS -traceback -Mbounds -Ktrap=inv,divz,ovf"
EXTRA_PGI_FCFLAGS="-traceback -Mbounds -Ktrap=inv,divz,ovf"
# XLC
EXTRA_BG_CXXFLAGS="-qarch=qp -qpic=large -qdebug=except"
EXTRA_BG_FCFLAGS="-qarch=qp -qpic=large -qdebug=except"
......@@ -391,6 +391,16 @@ if (test "x$ENABLE_FORTRAN" != "xno" && test "x$CHECK_FC" != "xno"); then
[AC_MSG_RESULT([no])]
)
LDFLAGS="$my_save_ldflags"
elif (test "$cc_compiler" == "PortlandGroup"); then
my_save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS -pgcpplibs -lstd -lC"
AC_MSG_CHECKING([whether $FC supports -lstd -lC])
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[fcxxlinkage=yes; FLIBS="$FLIBS -pgcpplibs -lstd -lC"; FCLIBS="$FCLIBS -pgcpplibs -lstd -lC"],
[AC_MSG_RESULT([no])]
)
LDFLAGS="$my_save_ldflags"
else
if (test "$fcxxlinkage" != "yes"); then
......@@ -831,34 +841,40 @@ case "$cc_compiler:$host_cpu" in
FATHOM_CC_64BIT=-m64
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
GNU:powerpc*)
FATHOM_CC_32BIT=-m32
FATHOM_CC_64BIT=-m64
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
GNU:i?86|GNU:x86_64)
FATHOM_CC_32BIT=-m32
FATHOM_CC_64BIT=-m64
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
GNU:mips*)
FATHOM_CC_32BIT="-mips32 -mabi=32"
FATHOM_CC_64BIT="-mips64 -mabi=64"
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
GNU:*)
FATHOM_CC_SPECIAL="$EXTRA_GNU_ONLY_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
Intel:*)
FATHOM_CC_32BIT=-m32
FATHOM_CC_64BIT=-m64
FATHOM_CC_SPECIAL="$EXTRA_INTEL_CXXFLAGS -wd981 -wd279 -wd1418 -wd383 -wd1572"
FATHOM_FC_SPECIAL="$EXTRA_INTEL_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
VisualAge:*)
case "$target_vendor" in
......@@ -873,6 +889,7 @@ case "$cc_compiler:$host_cpu" in
FATHOM_CC_64BIT=-q64
FATHOM_CC_SPECIAL="$EXTRA_BG_CXXFLAGS -qmaxmem=-1 -qminimaltoc"
FATHOM_FC_SPECIAL="$EXTRA_BG_FCFLAGS -qnoescape -WF,-C! -qddim -qalias=intptr"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
AR="ar"
NM="nm -B"
;;
......@@ -881,6 +898,7 @@ case "$cc_compiler:$host_cpu" in
FATHOM_CC_64BIT=-q64
FATHOM_CC_SPECIAL="$EXTRA_BG_CXXFLAGS -qmaxmem=-1 -qminimaltoc"
FATHOM_FC_SPECIAL="$EXTRA_BG_FCFLAGS -qnoescape -WF,-C! -qddim -qalias=intptr"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
AR="ar"
NM="nm -B -X 32_64"
;;
......@@ -891,18 +909,22 @@ case "$cc_compiler:$host_cpu" in
FATHOM_CC_64BIT=-64
FATHOM_CC_SPECIAL=-LANG:std
FATHOM_FC_SPECIAL=-LANG:std
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
MIPSpro:*)
FATHOM_CC_SPECIAL=-LANG:std
FATHOM_FC_SPECIAL=-LANG:std
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
;;
PortlandGroup:*)
FATHOM_CC_SPECIAL="-traceback -C"
FATHOM_FC_SPECIAL="$EXTRA_PGI_FCFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_PGI_FCFLAGS $EXTRA_PGI_ONLY_FCFLAGS"
FATHOM_F77_SPECIAL="$EXTRA_PGI_FCFLAGS"
;;
Clang:*)
FATHOM_CC_SPECIAL="$EXTRA_GNU_CXXFLAGS"
FATHOM_FC_SPECIAL="$EXTRA_GNU_FCFLAGS"
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
FATHOM_CC_32BIT=-m32
FATHOM_CC_64BIT=-m64
;;
......@@ -919,7 +941,6 @@ case "$cc_compiler:$host_cpu" in
esac
AC_MSG_RESULT([$cc_compiler:$host_cpu])
FATHOM_F77_SPECIAL="$FATHOM_FC_SPECIAL"
]) # end FATHOM_CC_FLAGS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment