Commit 04600ab4 authored by Ron Rahaman's avatar Ron Rahaman
Browse files

configure.ac gets compilers & flags from libmesh-config

parent 9f180a3b
......@@ -81,7 +81,52 @@ AC_ARG_ENABLE([extbar],
[AS_HELP_STRING([--enable-extbar], [adds underscore to exit call(for BGQ) @<:@default: disabled@:>@])],
[extbar=${enableval}], [extbar=no])
# TODO: Create debug and optimization options
AC_ARG_ENABLE([libmesh],
[AS_HELP_STRING([--enable-libmesh], [configure with compilers and flags from an existing libmesh installation @<:@default: enabled@:>@])],
[libmesh=${enableval}], [libmesh=yes])
AC_ARG_VAR([MOOSE_DIR], [directory of moose installation @<:@default: moon/moose/@:>@])
AC_ARG_VAR([LIBMESH_DIR], [directory of libmesh installation @<:@default: \$MOOSE_DIR/libmesh/installed/@:>@])
###############################################################################
# GET COMPILERS AND FLAGS FROM LIBMESH
###############################################################################
# Default values for $MOOSE_DIR and $LIBMESH_DIR
: "${MOOSE_DIR=$srcdir/moose}"
: "${LIBMESH_DIR=$MOOSE_DIR/libmesh/installed}"
# If libmesh is enabled, get compilers and flags from libmesh-config
# Adapted from moose/framework/build.mk
if test "x$libmesh" = "xyes"; then
# First, see if installed libmesh-config exists
libmesh_config="$LIBMESH_DIR/bin/libmesh-config"
AC_MSG_CHECKING([if $libmesh_config exists])
if test -x $libmesh_config; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
# If not, see if uninstalled libmesh-config exists
libmesh_config="$LIBMESH_DIR/contrib/bin/libmesh-config"
AC_MSG_CHECKING([if $libmesh_config exists])
if test -x $libmesh_config; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
AC_MSG_ERROR([could not find libmesh-config script. Ensure that LIBMESH_DIR and/or MOOSE_DIR are correctly set.])
fi
fi
AC_MSG_NOTICE([getting compilers and flags from $libmesh_config])
CC="$($libmesh_config --cc)"
CFLAGS="$($libmesh_config --cflags) $CFLAGS"
CPPFLAGS="$($libmesh_config --cppflags) $CPPFLAGS"
LDFLAGS="$($libmesh_config --ldflags) $LDFLAGS"
LIBS="$($libmesh_config --libs) $LIBS"
F77="$($libmesh_config --fc)"
FFLAGS="$($libmesh_config --fflags) $FFLAGS"
fi
###############################################################################
# BUILT-IN CHECKS
......
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