Commit 62e7bac2 authored by Ron Rahaman's avatar Ron Rahaman
Browse files

WIP: Setting mxm flags

parent 36590268
......@@ -35,10 +35,6 @@ AC_ARG_ENABLE([bgq],
[AS_HELP_STRING([--enable-bgq], [enable Blue Gene optimizations (BG/Q) @<:@default: disabled@:>@])],
[bgq=${enableval}], [bgq=no])
AC_ARG_ENABLE([xsmm],
[AS_HELP_STRING([--enable-xsmm], [use libxsmm for mxm @<:@default: disabled@:>@])],
[xsmm=${enableval}], [xsmm=no])
AC_ARG_ENABLE([cvode],
[AS_HELP_STRING([--enable-cvode], [use ODE solver from Sundials to solve for IFIELD>1 @<:@default: disabled@:>@])],
[cvode=${enableval}], [cvode=no])
......@@ -51,18 +47,24 @@ AC_ARG_ENABLE([neknek],
[AS_HELP_STRING([--enable-neknek], [enable multidomain support @<:@default: disabled@:>@])],
[neknek=${enableval}], [neknek=no])
AC_ARG_ENABLE([lapack],
[AS_HELP_STRING([--disable-lapack], [disable Nek-supplied LAPACK routines @<:@default: enabled@:>@])],
[lapack=${enableval}], [lapack=yes])
AC_ARG_ENABLE([nek-lapack],
[AS_HELP_STRING([--disable-nek-lapack], [disable Nek-supplied LAPACK routines @<:@default: enabled@:>@])],
[nek_lapack=${enableval}], [nek_lapack=yes])
AC_ARG_ENABLE([nek-blas],
[AS_HELP_STRING([--disable-nek-blas], [disable Nek-supplied BLAS routines @<:@default: enabled@:>@])],
[nek_blas=${enableval}], [nek_blas=yes])
AC_ARG_ENABLE([blas-mxm],
[AS_HELP_STRING([--disable-blas-mxm], [disable Nek-supplied BLAS routines @<:@default: enabled@:>@])],
[blas_mxm=${enableval}], [blas_mxm=yes])
AC_ARG_ENABLE([xsmm],
[AS_HELP_STRING([--enable-xsmm], [use libxsmm for mxm @<:@default: disabled@:>@])],
[xsmm=${enableval}], [xsmm=no])
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
###############################################################################
# BUILT-IN CHECKS
###############################################################################
......@@ -80,15 +82,16 @@ AC_F77_LIBRARY_LDFLAGS # Determine -l and -L flags, append to $FLIBS
AC_F77_WRAPPERS # Discover how to call F77 funcs from C, set F77_FUNC macro. If underscore, then Nek needs -DUNDERSCORE
# Discover flags for Fortran preprocessing
OLD_FC="$F77"; FC="$F77"
old_fc="$F77"; FC="$F77"
AC_FC_PP_SRCEXT([f]) # Discover what flags are needed to preprocess .f files
AC_FC_PP_DEFINE # Discover the flag (eg, -D, -Df) is used to define PP symbols
FC="$OLD_FC"
FC="$old_fc"
###############################################################################
# FIND F77 FLAG FOR DEFAULT 8-BYTE FLOATS
###############################################################################
real8_fflags=""
AC_LANG_PUSH([Fortran 77])
for flag in dnl
"-r8 -fpconstant" dnl Intel
......@@ -97,17 +100,23 @@ for flag in dnl
"-qrealsize=8 -qdpc=e" dnl IBM
"-s default64"; dnl Cray
do
OLD_FFLAGS="$FFLAGS"
old_fflags="$FFLAGS"
FFLAGS="$flag"
AC_MSG_CHECKING([if Fortran 77 compiler accepts $flag])
AC_COMPILE_IFELSE(
AC_LANG_PROGRAM(, [[ real foo]],),
AC_MSG_RESULT([yes]) && break,
AC_MSG_RESULT([yes]) && real8_fflags="$flag" && break,
AC_MSG_RESULT([no])
)
done
AC_LANG_POP([Fortran 77])
FFLAGS="$OLD_FFLAGS"
FFLAGS="$old_fflags"
if test "x$real8_fflags" = "x"; then
AC_MSG_FAILURE([could not determine Fortran flag for 8-byte floats])
else
FFLAGS="$FFLAGS $real8_fflags"
fi
###############################################################################
# SET NEK's PREPROCESSOR MACROS
......@@ -124,27 +133,55 @@ if echo "foobar"| tr -d @<:@:blank:@:>@ | grep '\<underscore\>' > /dev/null ; th
fi
# See if MPI is enabled
if test "$mpi" = "yes"; then
if test "x$mpi" = "xyes"; then
AC_DEFINE([MPI], 1, [If MPI is enabled])
fi
# See if CMT is enabled
if test "$cmt" = "yes"; then
if test "x$cmt" = "xyes"; then
AC_DEFINE([CMT], 1, [If CMT is enabled])
fi
# Check if pointer size == 8
# Check if sizeof long int == 8
if test "$ac_cv_sizeof_long_int" -eq 8; then
AC_DEFINE([LONGINT8], 1, [If sizeof long int is 8])
fi
# See if timer is enabled
if test "$timer" = "no"; then
if test "x$timer" = "xno"; then
AC_DEFINE([NOTIMER], 1, [If timer is disabled])
fi
# Always set GLOBAL_LONG_LONG
AC_DEFINE([GLOBAL_LONG_LONG], 1, [Use global long long])
# TODO: Set defs for MOAB
# See if neknek is enabled
if test "x$neknek" = "xyes"; then
AC_DEFINE([NEKNEK], 1, [if neknek is enabled])
fi
# TODO: Set defs for CVODE
# TODO: Set defs for AMG_DUMP
# TODO: Set defs for BLAS_MXM
# MXM handling
mxm_obj="mxm_std.o blas.o"
if test "x$bgq" = "xyes"; then mxm_obj="mxm_std.o mxm_bgq.o"; fi # TODO: Set -O3 flag
if test "x$xsmm" = "xyes"; then mxm_obj="mxm_std.o blas.o"; fi
if test "x$nek_blas" = "xno"; then mxm_obj="mxm_std.o"; fi
AC_SUBST([mxm_obj])
# See if using Nek5000's LAPACK routines
# If using automake: AM_CONDITIONAL([NO_LAPACK], [test "x$nek_lapack" = "xno"])
if test "x$nek_lapack" = "xno"; then
AC_DEFINE([NO_LAPACK], 1, [if not using Nek5000 LAPACK routines])
AC_SUBST([nek_lapack_obj], [""])
else
AC_SUBST([nek_lapack_obj], ["dsygv.o ssygv.o"])
fi
AC_OUTPUT
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