makenek 4.27 KB
Newer Older
1
#!/bin/bash
stefanke's avatar
stefanke committed
2
# Nek5000 build config file
stefanke's avatar
stefanke committed
3
# (c) 2008,2009,2010 UCHICAGO ARGONNE, LLC
4

5
6
7
8
###############################################################################
# VANILLA MAKENEK
###############################################################################

9
# source path 
Ron Rahaman's avatar
Ron Rahaman committed
10
SOURCE_ROOT=$(dirname $(dirname $(pwd)))/Nek5000
11
12
13
SOURCE_ROOT_CORE="$SOURCE_ROOT/core"
SOURCE_ROOT_JL="$SOURCE_ROOT/jl"
SOURCE_ROOT_CMT="$SOURCE_ROOT/core/cmt"
14

stefanke's avatar
stefanke committed
15
16
17
18
# pre-processor symbol list 
# (set PPLIST=? to get a list of available symbols)
#PPLIST="?" 

19

stefanke's avatar
stefanke committed
20
21
# OPTIONAL SETTINGS
# -----------------
22
23
24
25

# enable MPI (default true)
#IFMPI="false"

26
# enable CMT (default false)
27
28
#IFCMT="true"

stefanke's avatar
stefanke committed
29
30
31
32
33
34
35
36
# auxilliary files to compile
# NOTE: source files have to located in the same directory as makenek
#       a makefile_usr.inc has to be provided containing the build rules 
#USR="foo.o"

# linking flags
#USR_LFLAGS="-L/usr/lib -lfoo"

37

stefanke's avatar
stefanke committed
38
# generic compiler flags
39
40
#G="-g"

41
# optimization flags
stefanke's avatar
stefanke committed
42
43
#OPT_FLAGS_STD=""
#OPT_FLAGS_MAG=""
44
45
46

# enable AMG coarse grid solver (default XXT)
#IFAMG="true"
stefanke's avatar
stefanke committed
47
#IFAMG_DUMP="true"
48

stefanke's avatar
stefanke committed
49
# CVODE path
stefanke's avatar
stefanke committed
50
#CVODE_DIR=$HOME/cvode/lib
51
 
stefanke's avatar
stefanke committed
52
# MOAB/iMESH path
53
54
#MOAB_DIR="$HOME/moab"

55
56
57
58
59
60
61
62
63
64
# For linking to MOAB, the following might be needed:
# NOTE: compiler specific, use the appropriate one depending on your compiler
# GNU:
# USR_LFLAGS="-lmpi_cxx -lstdc++"
# Intel:
# USR_LFLAGS="-cxxlib"
# PGI:
# USR_LFLAGS="-pgcpplibs"
# USR_LFLAGS=" -lmpi_cxx -lstdc++"

65
66
67
68
69
70
71
# enable VisIt in situ
#  Note: you can override the lib and include paths. VISIT_LIB and VISIT_INC
#  If VISIT_STOP is set the simulation will stop after first step and wait
#  for VisIt to connect.
#IFVISIT=true
#VISIT_INSTALL="/path/to/visit/current/linux-x86_64/"
#VISIT_STOP=true
72

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
###############################################################################
# MOOSE MAKENEK
###############################################################################

# Get variables from env, if they exist.  Otherwise, set to specified defaults
MOOSE_DIR=${MOOSE_DIR:-$(dirname $(dirname $(pwd)))/moose} #default: moon/moose
LIBMESH_DIR=${LIBMESH_DIR:-$MOOSE_DIR/libmesh/installed}   #default: moon/moose/libmesh/installed
METHOD=${METHOD:-opt}                                      #default: optimized

# libmesh-config and libtool are in different places depending on whether you
# are using "installed" or "uninstalled" libmesh.
libmesh_config=${libmesh_config:-$LIBMESH_DIR/bin/libmesh-config}   #installed version
if [ ! -x "$libmesh_config" ]; then                                  
  libmesh_config="$LIBMESH_DIR/contrib/bin/libmesh-config"          #uninstalled version
fi
libmesh_LIBTOOL=${libmesh_config:-$LIBMESH_DIR/contrib/bin/libtool} #installed version
if [ ! -x "$libmesh_LIBTOOL" ]; then                                  
  libmesh_LIBTOOL="$LIBMESH_DIR/libtool"                            #uninstalled version
fi

# Get compilers and flags
libmesh_F77=$(METHOD="$METHOD" $libmesh_config --fc)
libmesh_CC=$(METHOD="$METHOD" $libmesh_config --cc)
libmesh_INCLUDE=$(METHOD="$METHOD" $libmesh_config --include)
libmesh_CPPFLAGS=$(METHOD="$METHOD" $libmesh_config --cppflags)
libmesh_FFLAGS=$(METHOD="$METHOD" $libmesh_config --cflags)
libmesh_CFLAGS=$(METHOD="$METHOD" $libmesh_config --cflags)
libmesh_LIBS=$(METHOD="$METHOD" $libmesh_config --libs)
libmesh_LDFLAGS=$(METHOD="$METHOD" $libmesh_config --ldflags)

# Set compilers and linker
F77="$libmesh_LIBTOOL --tag=F77 $LIBTOOLFLAGS --mode=compile $libmesh_F77 $libmesh_INCLUDE $libmesh_FFLAGS"
CC="$libmesh_LIBTOOL --tag=CC $LIBTOOLFLAGS --mode=compile $libmesh_CC $libmesh_INCLUDE $libmesh_CPPFLAGS $libmesh_CFLAGS"

F77LINK="$libmesh_LIBTOOL --tag=F77 $(LIBTOOLFLAGS) --mode=link $libmesh_F77 $libmesh_LIBS $libmesh_LDFLAGS"

109
###############################################################################
stefanke's avatar
stefanke committed
110
# DONT'T TOUCH WHAT FOLLOWS !!!
111
###############################################################################
stefanke's avatar
stefanke committed
112
113
# assign version tag
mver=1
114
# overwrite source path with optional 2nd argument
stefanke's avatar
stefanke committed
115
if [ -d $2 ] && [ $# -eq 2 ]; then
116
  SOURCE_ROOT="$2"
stefanke's avatar
stefanke committed
117
  echo "change source code directory to: ", $SOURCE_ROOT
118
119
120
  SOURCE_ROOT_CORE="$SOURCE_ROOT/core"
  SOURCE_ROOT_JL="$SOURCE_ROOT/jl"
  SOURCE_ROOT_CMT="$SOURCE_ROOT/core/cmt"
121
fi
122
# do some checks and create makefile
123
source $SOURCE_ROOT_CORE/makenek.inc
stefanke's avatar
stefanke committed
124
# compile
Ron Rahaman's avatar
Ron Rahaman committed
125
make -j4 -f makefile.nek nek5000 lib 2>&1 | tee compiler.out
126
exit 0