Commit f2ad3cab authored by Ron Rahaman's avatar Ron Rahaman
Browse files

WIP: Setting Nek's PP symbols from args/tests

parent d037e411
AC_PREREQ([2.61])
AC_INIT([Nek5000], [1.0], [nek5000-users@lists.mcs.anl.gov])
AM_INIT_AUTOMAKE
#AM_INIT_AUTOMAKE
#LT_PREREQ([2.2])
#LT_INIT([dlopen])
AC_CONFIG_SRCDIR([Nek5000/core/drive1.f])
#AC_CONFIG_SRCDIR([Nek5000/core/drive1.f])
#AC_CONFIG_HEADERS([config.h])
###############################################################################
# BUILT-IN CHECKS
# COMMAND-LINE OPTS
###############################################################################
# C compiler checks
AC_PROG_CC
AC_PROG_CC_C_O
AC_CHECK_SIZEOF([int *]) # Get sizeof int*, set SIZEOF_INT_P. If SIZEOF_INT_P == 8, then Nek needs -DPTRSIZE8
AC_CHECK_SIZEOF([long int]) # Get sizeof long int, set SIZEOF_LONG_INT
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING([--disable-mpi], [compile without mpi @<:@default: enabled@:>@])],
[mpi=${enableval}], [mpi=yes])
# F77 compiler checks
AC_PROG_F77 # Validate F77 compiler
AC_PROG_F77_C_O # Necessary for automake
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
FC_temp="$F77"; FC="$F77"
AC_FC_PP_SRCEXT([f])
AC_FC_PP_DEFINE
FC="$FC_temp"
###############################################################################
# USER-DEFINED CHECKS
###############################################################################
# See if underscore is in mangling scheme
if echo "foobar"| tr -d @<:@:blank:@:>@ | grep '\<underscore\>' > /dev/null ; then
# TODO: Add UNDERSCORE to Nek's PPLIST
echo "GOT IT";
fi
AC_ARG_ENABLE([cmt],
[AS_HELP_STRING([--enable-cmt], [compile with compressible multiphase turbulence support @<:@default: disabled@:>@])],
[cmt=${enableval}], [cmt=no])
AC_ARG_ENABLE([timer],
[AS_HELP_STRING([--disable-timer], [disable runtime statistics @<:@default: enabled@:>@])],
......@@ -82,5 +63,64 @@ AC_ARG_ENABLE([extbar],
[AS_HELP_STRING([--enable-extbar], [adds underscore to exit call(for BGQ) @<:@default: disabled@:>@])],
[extbar=${enableval}], [extbar=no])
###############################################################################
# BUILT-IN CHECKS
###############################################################################
# C compiler checks
AC_PROG_CC
AC_PROG_CC_C_O
AC_CHECK_SIZEOF([int *]) # Get sizeof int*, set SIZEOF_INT_P. If SIZEOF_INT_P == 8, then Nek needs -DPTRSIZE8
AC_CHECK_SIZEOF([long int]) # Get sizeof long int, set SIZEOF_LONG_INT
# F77 compiler checks
AC_PROG_F77 # Validate F77 compiler
AC_PROG_F77_C_O # Necessary for automake
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
FC_temp="$F77"; FC="$F77"
AC_FC_PP_SRCEXT([f])
AC_FC_PP_DEFINE
FC="$FC_temp"
###############################################################################
# SET NEK's PREPROCESSOR MACROS
###############################################################################
# Check if pointer size == 8
if test "$ac_cv_sizeof_int_p" -eq 8; then
AC_DEFINE([PTRSIZE8], 1, [If sizeof *int is 8])
fi
# See if MPI is enabled
if test "$mpi" = "yes"; then
AC_DEFINE([MPI], 1, [If MPI is enabled])
fi
# See if CMT is enabled
if test "$cmt" = "yes"; then
AC_DEFINE([CMT], 1, [If CMT is enabled])
fi
# Check if pointer size == 8
if test "$ac_cv_sizeof_long_int" -eq 8; then
AC_DEFINE([LONGINT8], 1, [If sizeof long int is 8])
fi
# See if 'underscore' is in mangling scheme.
if echo "foobar"| tr -d @<:@:blank:@:>@ | grep '\<underscore\>' > /dev/null ; then
AC_DEFINE([UNDERSCORE], 1, [If Fortran name-mangling scheme adds an underscore])
fi
# See if timer is enabled
if test "$timer" = "no"; 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])
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