Commit 62da7fa2 authored by Ron Rahaman's avatar Ron Rahaman

Cleanup prior to PR

parent a36b12c8
CASENAME = @CASENAME@
CC = @CC@
CPPFLAGS = @CPPFLAGS@ @DEFS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
F77 = @F77@
FFLAGS = @FFLAGS@ @FCFLAGS_f@ $(subst -D, @FC_DEFINE@, @DEFS@)
FLIBS = @FLIBS@
# @configure_input@
# =============================================================================
# SUBSTITUTION VARIABLES
# =============================================================================
F77=@F77@ # Fortran 77 compiler (set by AC_PROG_F77)
FFLAGS=@FFLAGS@ # Debugging and optimization options for F77
CC=@CC@ # C compiler
CFLAGS=@CFLAGS@ # Debugging and optimization options for CC
CPPFLAGS=@CPPFLAGS@ # Preprocessor options (-D, -U, etc.)
DEFS=@DEFS@ # -D options for compiler
INCLUDES=@INCLUDES@ # -I options for compiler
LDFLAGS=@LDFLAGS@ # Options for linker (-L, -s, but NOT -l)
LIBS=@LIBS@ # Library names (-l)
OBJEXT=@OBJEXT@ # Extension for object files
srcdir=@srcdir@ # top-level source directory
VPATH=@srcdir@ # virtual search path for out-of-source builds
LIBTOOL=@LIBTOOL@ # libtool executable
LIBTOOLFLAGS=@LIBTOOLFLAGS@ # flags for running libtool
# =============================================================================
# OBJECTS
# =============================================================================
CORE_F77_OBJECTS = drive.o drive1.o drive2.o \
plan4.o bdry.o coef.o conduct.o connect1.o connect2.o \
dssum.o edgec.o eigsolv.o gauss.o genxyz.o navier1.o makeq.o \
navier0.o navier2.o navier3.o navier4.o prepost.o speclib.o \
map2.o turb.o mvmesh.o ic.o ssolv.o planx.o math.o mxm_wrapper.o \
hmholtz.o gfdm_par.o gfdm_op.o gfdm_solve.o subs1.o subs2.o \
genbox.o gmres.o hsmg.o convect.o induct.o perturb.o \
navier5.o navier6.o navier7.o navier8.o fast3d.o fasts.o calcz.o \
byte_mpi.o postpro.o \
cvode_driver.o \
vprops.o qthermal.o cvode_aux.o makeq_aux.o \
papi.o nek_in_situ.o \
readat_new.o finiparser.o iniparser.o dictionary.o
CORE_CC_OBJECTS = nek_comm.o byte.o chelpers.o
MXM_OBJECTS = mxm_std.o
LPACK_OBJECTS = dsygv.o ssygv.o
JL_CORE_OBJECTS = jl_gs.o jl_sort.o jl_sarray_transfer.o jl_sarray_sort.o \
jl_gs_local.o jl_crystal.o jl_comm.o jl_tensor.o jl_fail.o \
jl_fcrystal.o
JL_INTP_OBJECTS = jl_findpts.o jl_findpts_local.o \
jl_obbox.o jl_poly.o jl_lob_bnd.o \
jl_findpts_el_3.o jl_findpts_el_2.o
ifeq ($(IFAMG),true)
JL_CGS_OBJECTS = jl_amg.o jl_fcrs.o
else
JL_CGS_OBJECTS = jl_sparse_cholesky.o jl_xxt.o jl_fcrs.o
endif
ifeq ($(IFNEKNEK),true)
NEKNEK_OBJECTS = multimesh.o
else
NEKNEK_OBJECTS = singlmesh.o
endif
ifeq ($(IFMPI),false)
COMM_MPI_OBJECTS = comm_mpi.o mpi_dummy.o
else
COMM_MPI_OBJECTS = comm_mpi.o
endif
CMT_OBJECTS = drive1_cmt.o drive2_cmt.o driver3_cmt.o \
face.o ausm.o MixtPerf.o intpdiff.o diffusive_cmt.o eqnsolver_cmt.o surface_fluxes.o \
bc.o inflow_bc.o outflow_bc.o wall_bc.o step.o \
filters_cmt.o diagnostics.o
ifeq ($(IFVISIT),true)
VISIT_OBJECTS = visit.o
endif
ifeq ($(IFMOAB),true)
MOAB_OBJECTS = moab.o imeshutil.o imeshcutil.o
endif
# =============================================================================
# LIBTOOL COMMANDS
# =============================================================================
# These follow automake's naming conventions
# C compiler: need to add $LIBS to linker?
LTCOMPILE = $(LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile --quiet $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=link $(CC) $(CFLAGS) $(LDFLAGS)
# Need to add $DEFS (and $LIBS to linker)?
LTF77COMPILE = $(LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile --quiet $(F77) $(INCLUDES) $(FFLAGS)
F77LINK = $(LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=link $(F77) $(FFLAGS) $(LDFLAGS)
# =============================================================================
# RULES
# =============================================================================
# Extra pre-processor symbols for JL_OBJECTS
ifeq ($(IFAMG_DUMP),true)
$(JL_CORE_OBJECTS) $(JL_INTP_OBJECTS) $(JL_CGS_OBJECTS) : DEFS += "-DPREFIX=_jl -DAMG_DUMP"
else
$(JL_CORE_OBJECTS) $(JL_INTP_OBJECTS) $(JL_CGS_OBJECTS) : DEFS += "-DPREFIX=_jl"
endif
$(F77_OBJECTS) : %.o : %.f
@$(F77COMPILE) -c $< -o $@
$(CORE_CC_OBJECTS) $(JL_OBJECTS): %.o : %.c
@$(F77COMPILE) -c $< -o $@
# =============================================================================
# ADDITIONAL SUBSTITION VARIABLES
# =============================================================================
# These would be unnecessary if this makefile were generated with automake
# =============================================================================
# RULES
# =============================================================================
# == Source and destination directories ============================================================
VPATH := @srcdir@/Nek5000/core:@srcdir@/Nek5000/core/cmt:@srcdir@/Nek5000/core/3rd_party:@srcdir@/Nek5000/jl
srcdir := @srcdir@
builddir := @builddir@
objdir := @builddir@/obj
includedir := @builddir@/include
# == Standard GNU Compilers and flags ==============================================================
CC := @CC@
CFLAGS := @CFLAGS@
CPPFLAGS := @CPPFLAGS@ @DEFS@ \
-I$(builddir) -I$(includedir) -I$(srcdir)/Nek5000/core -I$(srcdir)/Nek5000/core/cmt \
-I$(srcdir)/Nek5000/core/3rd_party -I$(srcdir)/Nek5000/jl
LDFLAGS := @LDFLAGS@
LIBS := @LIBS@
F77 := @F77@
FFLAGS := @FFLAGS@ @FCFLAGS_f@ $(subst -D, @FC_DEFINE@, @DEFS@) \
-I$(builddir) -I$(includedir) -I$(srcdir)/Nek5000/core -I$(srcdir)/Nek5000/core/cmt \
-I$(srcdir)/Nek5000/core/3rd_party -I$(srcdir)/Nek5000/jl
FLIBS := @FLIBS@
# == Nek-only compilers and flags ==================================================================
nek_debug_flags := @nek_debug_flags@
nek_opt_flags := @nek_opt_flags@
nek_real8_flags := @nek_real8_flags@
jl_prefix := @jl_prefix@
# == FORTRAN objects ===============================================================================
nek_drive_obj := $(addprefix $(objdir)/, drive.o)
nek_core_f_obj := $(addprefix $(objdir)/, \
drive1.o drive2.o plan4.o bdry.o coef.o conduct.o connect1.o connect2.o \
dssum.o edgec.o eigsolv.o gauss.o genxyz.o navier1.o makeq.o navier0.o \
navier2.o navier3.o navier4.o prepost.o speclib.o map2.o turb.o mvmesh.o ic.o \
ssolv.o planx.o mxm_wrapper.o hmholtz.o gfdm_par.o gfdm_op.o gfdm_solve.o \
subs1.o subs2.o genbox.o gmres.o hsmg.o convect.o induct.o perturb.o navier5.o \
navier6.o navier7.o navier8.o fast3d.o fasts.o calcz.o byte_mpi.o postpro.o \
cvode_driver.o vprops.o qthermal.o cvode_aux.o makeq_aux.o papi.o nek_in_situ.o \
readat_new.o @CASENAME@.o)
nek_math_obj := $(addprefix $(objdir)/, math.o)
nek_blas_obj := $(addprefix $(objdir)/, @nek_blas_obj@) # blas.o | null
nek_cmt_obj := $(addprefix $(objdir)/, @nek_cmt_obj@) # drive1_cmt.o ... | cmt_dummy.o
nek_lapack_obj := $(addprefix $(objdir)/, @nek_lapack_obj@) # dsygv.o ssygv.o | null
nek_mpi_obj := $(addprefix $(objdir)/, @nek_mpi_obj@) # byte_mpi.o comm_mpi.o | byte_mpi.o comm_mpi.o mpi_dummy.o
nek_mxm_obj := $(addprefix $(objdir)/, @nek_mxm_obj@) # mxm_std.o | mxm_std.o mxm_bgq.o
nek_neknek_obj := $(addprefix $(objdir)/, @nek_neknek_obj@) # singlmesh.o | multimesh.o
nek_flib_obj := $(nek_core_f_obj) $(nek_math_obj) $(nek_blas_obj) $(nek_cmt_obj) \
$(nek_lapack_obj) $(nek_mpi_obj) $(nek_mxm_obj) $(nek_neknek_obj)
# == C objects =====================================================================================
nek_core_c_obj := $(addprefix $(objdir)/, \
byte.o chelpers.o nek_comm.o finiparser.o iniparser.o dictionary.o)
jl_core_obj := $(addprefix $(objdir)/$(jl_prefix), \
gs.o sort.o sarray_transfer.o sarray_sort.o gs_local.o crystal.o comm.o tensor.o \
fail.o fcrystal.o)
jl_interp_obj := $(addprefix $(objdir)/$(jl_prefix), \
findpts.o findpts_local.o obbox.o poly.o lob_bnd.o findpts_el_3.o findpts_el_2.o)
jl_cgs_obj := $(addprefix $(objdir)/$(jl_prefix), @jl_cgs_obj@)
nek_clib_obj := $(nek_core_c_obj) $(jl_core_obj) $(jl_interp_obj) $(jl_cgs_obj)
# == Rules =========================================================================================
nek5000: $(nek_drive_obj) $(nek_flib_obj) $(nek_clib_obj)
$(F77) -o $@ $(nek_drive_obj) $(nek_flib_obj) $(nek_clib_obj) $(LDFLAGS) $(LIBS) $(FLIBS)
@size nek5000
$(nek_drive_obj) $(nek_core_f_obj) $(nek_cmt_obj): $(objdir)/%.o: %.f SIZE | $(objdir)
$(F77) -c $(FFLAGS) $(nek_opt_flags) $(nek_debug_flags) $(nek_real8_flags) $< -o $@
$(nek_mpi_obj) $(nek_neknek_obj): $(objdir)/%.o: %.f SIZE mpiheader | $(objdir)
$(F77) -c $(FFLAGS) $(nek_opt_flags) $(nek_debug_flags) $(nek_real8_flags) $< -o $@
$(nek_math_obj) $(nek_mxm_obj): $(objdir)/%.o : %.f SIZE | $(objdir)
$(F77) -c $(FFLAGS) -O3 $(nek_debug_flags) $(nek_real8_flags) $< -o $@
$(nek_blas_obj) $(nek_lapack_obj): $(objdir)/%.o: %.f SIZE | $(objdir)
$(F77) -c $(FFLAGS) -O0 $(nek_debug_flags) $< -o $@
$(nek_core_c_obj): $(objdir)/%.o: %.c | $(objdir)
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(nek_opt_flags) $(nek_debug_flags) $< -o $@
$(jl_core_obj) $(jl_interp_obj) $(jl_cgs_obj): $(objdir)/$(jl_prefix)%.o: %.c | $(objdir)
$(CC) -c $(CPPFLAGS) $(CFLAGS) $(nek_opt_flags) $(nek_debug_flags) $< -o $@
mpiheader: | $(includedir)
ifneq ($(findstring mpi_dummy.o, $(nek_mpi_obj)),)
cp $(srcdir)/Nek5000/core/mpi_dummy.h $(includedir)/mpif.h
else
rm -rf $(srcdir)/Nek5000/core/mpif.h $(includedir)/mpif.h
endif
$(objdir) $(includedir):
mkdir -p $@
clean:
rm -rf nek5000 $(nek_drive_obj) $(nek_flib_obj) $(nek_clib_obj) $(srcdir)/Nek5000/core/mpif.h $(includedir)/mpif.h
.PHONY: mpiheader clean
# Assume that NEK_DIR and NEK_CASENAME are defined by parent Makefile
$(NEK_OBJ): run_makenek
#all:: $(NEK_OBJ) $(NEK_LIB) SESSION.NAME
run_makenek:
$(NEK_SOURCE_DIR)/core/makenek $(NEK_CASENAME) $(NEK_SOURCE_DIR)
SESSION.NAME:
echo $(NEK_CASENAME) > SESSION.NAME && echo $(NEK_CASE_DIR) >> SESSION.NAME
.PHONY: run_makenek
$(NEK_LIB): run_makenek
make lib
...@@ -28,16 +28,33 @@ $ scripts/update\_and\_rebuild\_libmesh.sh. ...@@ -28,16 +28,33 @@ $ scripts/update\_and\_rebuild\_libmesh.sh.
After installing libmesh, you must define the `$LIBMESH_DIR` in your environment. After installing libmesh, you must define the `$LIBMESH_DIR` in your environment.
Building and Running the Example Problems The Example Problems
----------------------------------------- --------------------
MOON is distributed with scripts for building and runninhg coupled example problems. To build and run a given example (e.g.: "integration\_example"), use the following commands:
Currently, the only working example problem is "integration_example" in `moon/examples/integration_example`.
### Building Example Problems
To configure and build each example problem, first generate the `configure` script in the top-level MOON directory:
```
$ cd moon
$ ./bootstrap
``` ```
$ cd examples/integration_example/ Then cd into the example subdirectory and simply run `configure` && `make`. This will build the MOOSE and Nek5000 libraries, then link them to the executable driver.
$ ../../scripts/build_coupled_nek.sh
$ ../../scripts/run_coupled_nek.sh
``` ```
Note that the build and run scripts must be executed from the example subdiretory. $ cd moon/examples/integration_example`
$ ../../configure
$ make
```
The `configure` script may be run with additional options (for example, to point to a custom libmesh or MOOSE installation). Run `./configure --help` to see a list of the available options.
### Running Example Problems
To run an example problem, it is recommended to use the convenience script `moon/examples/build_coupled_nek`. This script will automatically setup some input files needed by Nek5000 (such as SESSION.NAME). The script takes one command-line argument for the MOOSE configuration file, `-i <config_file>.i`.
```
$ cd moon/examples/integration_example
$ ../../scripts/build_coupled_nek.sh -i coefficient_integration.i
```
Developing Nek5000 in MOON Developing Nek5000 in MOON
-------------------------- --------------------------
......
...@@ -524,6 +524,6 @@ fi ...@@ -524,6 +524,6 @@ fi
# ALL DONE! # ALL DONE!
############################################################################### ###############################################################################
AC_CONFIG_FILES([nek.mk:nek.mk.in]) AC_CONFIG_FILES([nek.mk:Nek5000/nek.mk.in])
AC_OUTPUT AC_OUTPUT
...@@ -29,12 +29,7 @@ include $(MOOSE_DIR)/modules/modules.mk ...@@ -29,12 +29,7 @@ include $(MOOSE_DIR)/modules/modules.mk
############################################################################### ###############################################################################
# nek # nek
NEK_SOURCE_DIR := $(MOON_DIR)/Nek5000 include nek.mk
NEK_CASE_DIR := $(CURDIR)
NEK_CASENAME := $(shell basename $(NEK_CASE_DIR))
NEK_OBJ := obj/$(NEK_CASENAME).o
NEK_LIB := $(NEK_CASE_DIR)/libnek5000.so
include $(NEK_SOURCE_DIR)/nek.mk
# moon # moon
APPLICATION_DIR := $(MOON_DIR) APPLICATION_DIR := $(MOON_DIR)
...@@ -47,11 +42,6 @@ APPLICATION_DIR := $(CURDIR) ...@@ -47,11 +42,6 @@ APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := $(shell basename $(APPLICATION_DIR)) APPLICATION_NAME := $(shell basename $(APPLICATION_DIR))
MAIN_DIR := $(MOON_DIR)/src MAIN_DIR := $(MOON_DIR)/src
BUILD_EXEC := yes BUILD_EXEC := yes
ifeq ($(shell uname),Darwin)
EXTERNAL_FLAGS := $(NEK_OBJ) $(NEK_LIB) -Wl,-no_compact_unwind
else
EXTERNAL_FLAGS := $(NEK_OBJ) $(NEK_LIB)
endif
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME)) DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include $(FRAMEWORK_DIR)/app.mk include $(FRAMEWORK_DIR)/app.mk
......
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