Commit 76610cd8 authored by Ron Rahaman's avatar Ron Rahaman
Browse files

Separated nek's preprocessor macros from autoconf's

parent 8e6dca73
......@@ -197,6 +197,8 @@ AC_SUBST([nek_real8_flags])
# SET NEK's PREPROCESSOR MACROS
###############################################################################
nek_DEFS=""
# Enable debug flags
if test "x$debug" = "xyes"; then
nek_debug_flags="-g"
......@@ -213,17 +215,17 @@ AC_SUBST([nek_opt_flags])
# Check if pointer size == 8
if test "$ac_cv_sizeof_int_p" -eq 8; then
AC_DEFINE([PTRSIZE8], 1, [If sizeof *int is 8])
nek_DEFS="-DPTRSIZE8 $nek_DEFS"
fi
# See if 'underscore' is in mangling scheme.
if echo "$ac_cv_f77_mangling"| tr -d @<:@:blank:@:>@ | grep '\<underscore\>' > /dev/null ; then
AC_DEFINE([UNDERSCORE], 1, [If Fortran name-mangling scheme adds an underscore])
nek_DEFS="-DUNDERSCORE $nek_DEFS"
fi
# See if MPI is enabled
if test "x$mpi" = "xyes"; then
AC_DEFINE([MPI], 1, [If MPI is enabled])
nek_DEFS="-DMPI $nek_DEFS"
nek_mpi_obj="byte_mpi comm_mpi"
else
nek_mpi_obj="byte_mpi comm_mpi mpi_dummy"
......@@ -233,7 +235,7 @@ AC_SUBST([nek_mpi_obj])
# Always define jl_prefix
AC_SUBST([jl_prefix], [jl_])
AC_DEFINE([PREFIX], [jl_], [prefix for JL subroutines])
nek_DEFS="-DPREFIX=jl_ $nek_DEFS"
# See if AMG is enabled
if test "x$amg" = "xyes"; then
......@@ -245,12 +247,12 @@ AC_SUBST([jl_cgs_obj])
# See if AMG_DUMP is enabled
if test "x$amg_dump" = "xyes"; then
AC_DEFINE([AMG_DUMP], 1, [if AMG dump is enabled])
nek_DEFS="-DAMG_DUMP $nek_DEFS"
fi
# See if CMT is enabled
if test "x$cmt" = "xyes"; then
AC_DEFINE([CMT], 1, [If CMT is enabled])
nek_DEFS="-DCMT $nek_DEFS"
nek_cmt_obj="drive1_cmt drive2_cmt driver3_cmt face ausm MixtPerf intpdiff diffusive_cmt eqnsolver_cmt surface_fluxes bc inflow_bc outflow_bc wall_bc step filters_cmt diagnostics"
else
nek_cmt_obj="cmt_dummy"
......@@ -259,22 +261,22 @@ AC_SUBST([nek_cmt_obj])
# 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])
nek_DEFS="-DLONGINT8 $nek_DEFS"
fi
# See if timer is enabled
if test "x$timer" = "xno"; then
AC_DEFINE([NOTIMER], 1, [If timer is disabled])
nek_DEFS="-DNOTIMER $nek_DEFS"
fi
# Always set GLOBAL_LONG_LONG
AC_DEFINE([GLOBAL_LONG_LONG], 1, [Use global long long])
nek_DEFS="-DGLOBAL_LONG_LONG $nek_DEFS"
# TODO: Set defs for MOAB
# See if neknek is enabled
if test "x$neknek" = "xyes"; then
AC_DEFINE([NEKNEK], 1, [if neknek is enabled])
nek_DEFS="-DNEKNEK $nek_DEFS"
nek_neknek_obj="multimesh"
else
nek_neknek_obj="singlmesh"
......@@ -293,12 +295,12 @@ AC_SUBST([nek_neknek_obj])
# * Consistency check between options
# * If automake, AM_CONDITIONAL([BGQ], [test "x$bgq" = "xyes"]), etc.
if test "x$bgq" = "xyes"; then
AC_DEFINE([BGQ], 1, [if using IBM BG/Q optimizations])
nek_DEFS="-DBGQ $nek_DEFS"
nek_blas_obj=""
nek_mxm_obj="mxm_std mxm_bgq"
else
if test "x$xsmm" = "xyes"; then
AC_DEFINE([XSMM], 1, [if using libxsmm for mxm])
nek_DEFS="-DXSMM $nek_DEFS"
nek_blas_obj="blas"
nek_mxm_obj="mxm_std"
else
......@@ -306,7 +308,7 @@ else
nek_blas_obj="blas"
nek_mxm_obj="mxm_std"
else
AC_DEFINE([BLAS_MXM], 1, [if not using Nek5000 BLAS mxm routines])
nek_DEFS="-DBLAS_MXM $nek_DEFS"
nek_blas_obj=""
nek_mxm_obj="mxm_std"
fi
......@@ -321,11 +323,13 @@ AC_SUBST([nek_mxm_obj])
if test "x$nek_lapack" = "xyes"; then
nek_lapack_obj="dsygv ssygv"
else
AC_DEFINE([NO_LAPACK], 1, [if not using Nek5000 LAPACK routines])
nek_DEFS="-DNO_LAPACK $nek_DEFS"
nek_lapack_obj=""
fi
AC_SUBST([nek_lapack_obj])
AC_SUBST([nek_DEFS])
###############################################################################
# SIZE FILE HANDLING
###############################################################################
......
......@@ -8,11 +8,11 @@ nek_includedir := @builddir@/include
# == Discovered by autoconf script
nek_CFLAGS := @CFLAGS@
nek_INCLUDES := -I$(builddir) -I$(nek_includedir) -I$(srcdir)/Nek5000/core -I$(srcdir)/Nek5000/core/cmt -I$(srcdir)/Nek5000/core/3rd_party -I$(srcdir)/Nek5000/jl
nek_CPPFLAGS := @CPPFLAGS@ @DEFS@ $(nek_INCLUDES)
nek_CPPFLAGS := @CPPFLAGS@ @DEFS@ @nek_DEFS@ $(nek_INCLUDES)
nek_LDFLAGS := @LDFLAGS@
nek_LIBS := @LIBS@
nek_FFLAGS := @FFLAGS@ @FCFLAGS_f@ $(subst -D, @FC_DEFINE@, @DEFS@) $(nek_INCLUDES)
nek_FFLAGS := @FFLAGS@ @FCFLAGS_f@ $(subst -D, @FC_DEFINE@, @DEFS@ @nek_DEFS@) $(nek_INCLUDES)
nek_FLIBS := @FLIBS@
nek_debug_flags := @nek_debug_flags@
......@@ -60,8 +60,7 @@ nek_clib_obj := $(nek_core_c_obj) $(jl_core_obj) $(jl_interp_obj) $(jl_cgs_obj
# Recursive definition (= rather than :=) is probably the right usage, since they're probably
# defined here after they're referenced by MOOSE makefile
ADDITIONAL_CPPFLAGS = @CPPFLAGS@ # Used by pattern rules in moose/framework/build.mk
# Can't use Nek's DEFS here because the interfere with MOOSE
ADDITIONAL_CPPFLAGS = @CPPFLAGS@ @DEFS@ # Used by pattern rules in moose/framework/build.mk
ADDITIONAL_INCLUDES = $(nek_INCLUDES) # Used by pattern rules in moose/framework/build.mk (through app_INCLUDES)
ADDITIONAL_LIBS = $(nek_LIBS) $(nek_FLIBS) # Used during linking in moose/framework/app.mk
ADDITIONAL_APP_OBJECTS = $(nek_flib_obj) $(nek_clib_obj) # Added to dependencies in moose/framework/app.mk
......@@ -70,27 +69,27 @@ ADDITIONAL_APP_OBJECTS = $(nek_flib_obj) $(nek_clib_obj) # Added to dependencies
nek5000: $(nek_drive_obj) $(nek_flib_obj) $(nek_clib_obj)
@echo "Linking Executable "$@"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=link --quiet \
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=link \
$(libmesh_F77) $(libmesh_FFLAGS) -o $@ $^ $(libmesh_LIBS) $(libmesh_LDFLAGS) $(nek_LIBS) $(nek_LDFLAGS) $(nek_FLIBS)
$(nek_drive_obj) $(nek_core_f_obj) $(nek_cmt_obj) $(nek_math_obj) $(nek_mxm_obj): $(nek_objdir)/%.$(obj-suffix): %.f SIZE | $(nek_objdir)
@echo "Nek5000 Compiling Fortran (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile --quiet \
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile \
$(libmesh_F77) $(nek_FFLAGS) $(nek_real8_flags) -c $< -o $@
$(nek_mpi_obj) $(nek_neknek_obj): $(nek_objdir)/%.$(obj-suffix): %.f SIZE mpiheader | $(nek_objdir)
@echo "Nek5000 Compiling Fortran (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile --quiet \
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile \
$(libmesh_F77) $(nek_FFLAGS) $(nek_real8_flags) -c $< -o $@
$(nek_core_c_obj): $(nek_objdir)/%.$(obj-suffix): %.c | $(nek_objdir)
@echo "Nek5000 Compiling C (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile --quiet \
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile \
$(libmesh_CC) $(nek_CPPFLAGS) $(nek_CFLAGS) -MMD -MP -MF $@.d -MT $@ -c $< -o $@
$(jl_core_obj) $(jl_interp_obj) $(jl_cgs_obj): $(nek_objdir)/$(jl_prefix)%.$(obj-suffix): %.c | $(nek_objdir)
@echo "Nek5000 Compiling C (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile --quiet \
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile \
$(libmesh_CC) $(nek_CPPFLAGS) $(nek_CFLAGS) -MMD -MP -MF $@.d -MT $@ -c $< -o $@
mpiheader: | $(nek_includedir)
......
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