Skip to content
Snippets Groups Projects
Commit 442db643 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Move LD definition to before libtool configuration. Also add GCC and LLVM support.

Don't see much difference in my simple tests..., LLVM support is not checked
parent 5ec0c105
Branches
Tags
2 merge requests!136Master,!101Inter procedural optimization
...@@ -38,13 +38,43 @@ AM_PROG_CC_C_O ...@@ -38,13 +38,43 @@ AM_PROG_CC_C_O
# Enable POSIX and platform extension preprocessor macros. # Enable POSIX and platform extension preprocessor macros.
AC_USE_SYSTEM_EXTENSIONS AC_USE_SYSTEM_EXTENSIONS
# Add libtool support.
LT_INIT
# Check for compiler version and vendor. # Check for compiler version and vendor.
AX_COMPILER_VENDOR AX_COMPILER_VENDOR
AX_COMPILER_VERSION AX_COMPILER_VERSION
# Interprocedural optimization support. Needs special handling for linking and
# archiving as well as compilation with Intels, needs to be done before
# libtool is configured (to use correct LD).
AC_ARG_ENABLE([ipo],
[AS_HELP_STRING([--enable-ipo],
[Enable interprocedural optimization @<:@no/yes@:>@]
)],
[enable_ipo="$enableval"],
[enable_ipo="no"]
)
if test "$enable_ipo" = "yes"; then
if test "$ax_cv_c_compiler_vendor" = "intel"; then
CFLAGS="$CFLAGS -ip -ipo"
LDFLAGS="$LDFLAGS -ipo"
: ${AR="xiar"}
: ${LD="xild"}
AC_MSG_RESULT([added Intel interprocedural optimization support])
elif test "$ax_cv_c_compiler_vendor" = "gnu"; then
CFLAGS="$CFLAGS -flto"
LDFLAGS="$LDFLAGS -flto"
AC_MSG_RESULT([added GCC interprocedural optimization support])
elif test "$ax_cv_c_compiler_vendor" = "clang"; then
CFLAGS="$CFLAGS -emit-llvm"
AC_MSG_RESULT([added LLVM interprocedural optimization support])
else
AC_MSG_WARN([Compiler does not support interprocedural optimization])
fi
fi
# Add libtool support.
LT_INIT
# Check for MPI. Need to do this before characterising the compiler (C99 mode), # Check for MPI. Need to do this before characterising the compiler (C99 mode),
# as this changes the compiler. # as this changes the compiler.
# We should consider using AX_PROG_CC_MPI to replace AC_PROG_CC when compiling # We should consider using AX_PROG_CC_MPI to replace AC_PROG_CC when compiling
...@@ -176,32 +206,12 @@ if test "$enable_san" = "yes"; then ...@@ -176,32 +206,12 @@ if test "$enable_san" = "yes"; then
fi fi
if test "$enable_san" = "yes"; then if test "$enable_san" = "yes"; then
CFLAGS="$CFLAGS -fsanitize=address -fno-omit-frame-pointer" CFLAGS="$CFLAGS -fsanitize=address -fno-omit-frame-pointer"
AC_MSG_RESULT([added address sanitizer support])
else else
AC_MSG_WARN([Compiler does not support address sanitizer option]) AC_MSG_WARN([Compiler does not support address sanitizer option])
fi fi
fi fi
# Intel compiler interprocedural optimization support. Needs special
# handling for linking and archiving as well as compilation.
AC_ARG_ENABLE([ipo],
[AS_HELP_STRING([--enable-ipo],
[Enable Intel interprocedural optimization @<:@no/yes@:>@]
)],
[enable_ipo="$enableval"],
[enable_ipo="no"]
)
if test "$enable_ipo" = "yes"; then
if test "$ax_cv_c_compiler_vendor" = "intel"; then
CFLAGS="$CFLAGS -ip -ipo"
LDFLAGS="-ipo"
AR="xiar"
LD="xild"
else
AC_MSG_WARN([Compiler does not support interprocedural optimization])
fi
fi
# Autoconf stuff. # Autoconf stuff.
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment