3 # see makefile.notes for detailed comments/notes
9 # AUTO PICK SYSTEM TO COMPILE ON
13 # for this to work, should put in .bashrc or at command-line before running make:
17 $(warning HOSTNAME is $(HOSTNAME))
18 $(warning CFLAGS is $(CFLAGS))
21 #############################
23 # Default is all compilers are not used, so can reference (e.g.) OSX being set to 0 or not.
24 # DO NOT CHANGE THESE ZEROS! Just use these as reference for what to add or change in the next section when you pick your system or compiler.
26 #############################
28 # WATCH OUT FOR SPACES, etc. AFTER ASSIGNMENTS!!!!
33 #QUEENBEE (avoids making directories or forking in general)
37 # USEABE -> USEICCGENERIC is used
42 USEKRAKENICC=0 # best to use
for Kraken
53 # PICK SYSTEM TO COMPILE ON. Only should change "HOSTNAME->COMPILER" section below, not default!
57 hoststriped=$(shell echo $$HOSTNAME | sed
's/[0-9]*//g')
58 $(warning hoststriped is $(hoststriped))
63 #
default compiler is GCC that will always be present on linux
66 $(warning USEcompiler is
set arbitrarily in makehead.inc. Put your system into makehead.inc to
get specific compiler.)
71 # HOSTNAME->COMPILER: system name (HOSTNAME) chooses compiler to use. So don't have to have git repo keep changing for each user.
74 ifeq ($(HOSTNAME),physics-179.umd.edu)
77 $(warning USEICCINTEL is $(USEICCINTEL))
78 else ifeq ($(hoststriped),krakenpf)
80 $(warning USEKRAKENICC is $(USEKRAKENICC))
81 else ifeq ($(HOSTNAME),ki-rh42)
83 $(warning USEICCINTEL is $(USEICCINTEL))
84 else ifeq ($(HOSTNAME),ki-rh39)
86 $(warning USEICCINTEL is $(USEICCINTEL))
87 else ifeq ($(HOSTNAME),ki-jmck)
89 $(warning USEICCINTEL is $(USEICCINTEL))
90 else ifeq ($(hoststriped),login.stampede.tacc.utexas.edu)
92 $(warning USESTAMPEDE is $(USESTAMPEDE))
93 else ifeq ($(hoststriped),pfe)
95 $(warning USEPFE is $(USEPFE))
96 else ifeq ($(HOSTNAME),ubuntu)
98 $(warning USEICCINTEL is $(USEICCINTEL))
99 else ifeq ($(HOSTNAME),bh00)
101 $(warning USEICCINTEL is $(USEICCINTEL))
102 else ifeq ($(HOSTNAME),bhjet)
104 $(warning USEOSX is $(USEOSX))
106 #$(error USEcompiler never set!. Need to choose for your system: $(HOSTNAME) in makehead.inc .)
108 $(warning USEICCINTEL is $(USEICCINTEL))
113 # end else if having HOSTNAME choose compiler.
121 ########################
123 # PERFORMANCE CHECKS WITH GPROF
125 ########################
126 # default should be 0 since has large performance hit.
130 ########################
132 # Debug information in binary
134 ########################
135 # Generally ok to have, no performance hit
136 # Required for using pfmon with intelligent output
141 ########################
143 # BEGIN setup what compiling
145 ########################
148 ########################
150 # PREPARE COMMAND NAMES
152 ########################
155 PREPLD=prepgrmhdldouble
156 PREPLIAISON=prepliaison
157 PREPJONINTERP=prepiinterp
158 PREPBIN2TXT=prepbin2txt
159 PREPSMCALC=prepsmcalc
161 ########################
165 ########################
175 # different target sets
176 MPITARGETS=$(DEFTARGET) $(CMD) $(CMD2) $(LIAISONCMD) $(PREP) $(PREPLD) $(PREPLAISON)
177 LAPACKTARGETS=$(DEFTARGET) $(CMD) $(CMD2) $(LIAISONCMD) $(JONINTERPCMD) $(PREP) $(PREPLD) $(PREPLAISON) $(PREPJONINTERP)
178 BINARYTARGETS=$(CMD) $(CMD2) $(LIAISONCMD)
180 ########################
184 ########################
185 .DEFAULT_GOAL := $(CMD)
187 $(warning
default goal is $(.DEFAULT_GOAL))
188 $(warning goal is $(MAKECMDGOALS))
189 $(warning MPITARGETS is $(MPITARGETS))
191 # check for default make call
192 ifeq ($(MAKECMDGOALS),)
193 MYMAKECMDGOALS=$(.DEFAULT_GOAL)
195 MYMAKECMDGOALS=$(MAKECMDGOALS)
200 ########################
202 # DONE setup what compiling
204 ########################
208 ########################
212 ########################
214 #ifeq ($(MYMAKECMDGOALS),$(filter $(MYMAKECMDGOALS), $(MPITARGETS)))
215 ifneq ($(filter $(MPITARGETS), $(MYMAKECMDGOALS)),)
217 # i.e. MPI is only for grmhd, grmhdldouble, and liaison codes
222 # no choice for below
223 # i.e. no MPI for iinterp, bin2txt, or smcalc
231 ########################
235 # With icc and koralinsert and bounds.koral.c, issue with compile with OpenMP. Can turn off OpenMP for just that one file by trying compile and copying compile like for bounds.c and remove USINGOPENMP and -fopenmp
237 ########################
241 ########################
245 ########################
250 # turns on -mp and -pc64 for USEICC?????=1
251 # Note that if using -pc64 -mp that error in inversion seems to be limited for doubles to 1E-11 instead of 1E-15
252 # causes code to be less accurate: e.g. inversion doesn't reach to 1E-15, but rather 1E-11
253 # for some simple linear wave tests with small amplitude can cause significant problems if any noise exists in intial solution
254 # With OpenMP and icc 10.1 20080602 this feature with:
255 # -O2 -finline -finline-functions -ip -fno-alias -unroll -Wall -Wcheck -Wshadow -w2 -wd=1419,869,177,310,593,810,981,1418 $(DFLAGS) -g
256 # caused the fluxcalc_fluxctstag_emf_1d() function fail to work properly. It would cause NaN's to random appear in different places. I tried to find any associated bug, but could not. Reverting to -O0 leads to no problems.
262 # can easily see if MKL already setup by doing:
264 # in bash and see if defined
266 # otherwise must do "source" command below before compiling with lapack:
267 # on 64-bit emulated machines (most intel/amd machines):
268 # source /opt/intel/mkl/10.0.3.020/tools/environment/mklvarsem64t.sh
269 # For true 64-bit machines and 32-bit machines different source
271 # source /opt/intel/mkl/10.0.3.020/tools/environment/mklvars64.sh
273 # source /opt/intel/mkl/10.0.3.020/tools/environment/mklvars32.sh
274 # and recall the directory will be different on each machine
276 # on ki-rh39 and orange:
277 # source /u/ki/jmckinne/intel/mkl/10.0.5.025/tools/environment/mklvarsem64t.sh
279 # source /u/ki/jmckinne/intel/mkl/10.0.3.020/tools/environment/mklvarsem64t.sh
282 # http://www.netlib.org/eispack/
283 # http://www.netlib.org/lapack/double/dsyev.f
285 ifneq ($(filter $(LAPACKTARGETS), $(MYMAKECMDGOALS)),)
288 # below is for new form of library -l line
291 # NO choice for below
300 # For Kraken, choose USEGSL=0 and comment-out #include "gslincludes.h" in global.general.h : Kraken doesn't have newer GSL that's required (missing gsl/gsl_odeiv2.h) and anyways has compile time issue for some reason.
303 ########################
313 ##########################
317 ##########################
319 $(warning USEMPI is $(USEMPI))
321 $(warning USEPTHREAD is $(USEPTHREAD))
322 $(warning USELAPACK is $(USELAPACK))
323 $(warning USELAPACKNEW is $(USELAPACKNEW))
324 $(warning ENFORCEPRECISION is $(ENFORCEPRECISION))