-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
134 lines (119 loc) · 4.29 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#/***********************************************************************************
# Copyright 2006 Charles F. Gammie, Jonathan C. McKinney, Scott C. Noble,
# Gabor Toth, and Luca Del Zanna
#
# HARM version 1.0 (released May 1, 2006)
#
# This file is part of HARM. HARM is a program that solves hyperbolic
# partial differential equations in conservative form using high-resolution
# shock-capturing techniques. This version of HARM has been configured to
# solve the relativistic magnetohydrodynamic equations of motion on a
# stationary black hole spacetime in Kerr-Schild coordinates to evolve
# an accretion disk model.
#
# You are morally obligated to cite the following two papers in his/her
# scientific literature that results from use of any part of HARM:
#
# [1] Gammie, C. F., McKinney, J. C., \& Toth, G.\ 2003,
# Astrophysical Journal, 589, 444.
#
# [2] Noble, S. C., Gammie, C. F., McKinney, J. C., \& Del Zanna, L. \ 2006,
# Astrophysical Journal, 641, 626.
#
#
# Further, we strongly encourage you to obtain the latest version of
# HARM directly from our distribution website:
# http://rainman.astro.uiuc.edu/codelib/
#
#
# HARM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# HARM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with HARM; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#***********************************************************************************/
#### set USEICC to 0 if you want gcc compiler options, else set to 1 to use icc
######## gcc generally used for debugging with -g option so we can use gdb
USEICC = 1
USEOMP = 0 #please do not use this option (yet), as this has not been recently tested
USEMPI = 1
MACHINE =titan
# Add your other choices here:
ifeq ($(MACHINE),suselaptop)
MPICC =/usr/lib64/mpi/gcc/openmpi/bin/mpicc
GSLLIB=/usr/lib64:/usr/lib64/mpi/gcc/openmpi/lib64
GSLINC=/usr/include
# ADDCCFLAGS= -fPIC -shared
else
ifeq ($(MACHINE),titan)
MPICC =mpicc
GSLLIB=$(HOME)/gsl/build/lib
GSLINC=$(HOME)/gsl/build/include
ADDCCFLAGS=-I$(GSLINC)
else
$(error we are on $(MACHINE); check whether there are loose spaces in the machine name!)
exit
endif
endif
export LD_LIBRARY_PATH=$(GSLLIB)
ifeq ($(USEICC),1)
CC = $(MPICC)
CCFLAGS2 = -O2 $(ADDCCFLAGS) # -xhost -Wrestrict -I$(GSLINC) # -no-prec-div -axCORE-AVX2 -xSSE4.2 #-O2 -xAVX
#CCFLAGS = -O2
ifeq ($(USEOMP),1)
CCFLAGS = $(CCFLAGS2) -openmp
else
CCFLAGS = $(CCFLAGS2)
endif
endif
ifeq ($(USEICC),0)
CC = gcc
CCFLAGS1 = -g -O2 -ggdb -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-unknown-pragmas $(ADDCCFLAGS) #-fsanitize=address -fno-omit-frame-pointer
ifeq ($(USEOMP),1)
CCFLAGS = $(CCFLAGS1) -fopenmp
else
CCFLAGS = $(CCFLAGS1) # -I$(GSLINC)
endif
endif
ifeq ($(USEMPI),1)
EXTRALIBS= -L$(GSLLIB) -lgsl -lgslcblas -lm -lmpi
EXTRACCFLAGS=-DMPI
CC=$(MPICC) #/usr/local/bin/mpicc
else
EXTRALIBS = -L$(GSLLIB) -lgsl -lgslcblas -lm
EXTRACCFLAGS =
endif
CC_COMPILE = $(CC) $(CCFLAGS) $(EXTRACCFLAGS) -c
CC_LOAD = $(CC) $(CCFLAGS) $(EXTRACCFLAGS)
.c.o:
$(CC_COMPILE) $*.c
EXE = harm
all: $(EXE)
SRCS = \
bounds.c coord.c diag.c dump.c fixup.c \
init.c interp.c main.c metric.c lu.c \
phys.c ranc.c restart.c step_ch.c \
utoprim_1dfix1.c utoprim_1dvsq2fix1.c utoprim_2d.c u2p_util.c mpi.c
OBJS = \
bounds.o coord.o diag.o dump.o fixup.o \
init.o interp.o main.o metric.o lu.o \
phys.o ranc.o restart.o step_ch.o \
utoprim_1dfix1.o utoprim_1dvsq2fix1.o utoprim_2d.o u2p_util.o mpi.o
INCS = decs.h defs.h u2p_defs.h u2p_util.h mpi.h
$(OBJS) : $(INCS) makefile
$(EXE): $(OBJS) $(INCS) makefile
$(CC_LOAD) $(OBJS) $(EXTRALIBS) -o $(EXE)
clean:
/bin/rm -f *.o *.il
/bin/rm -f $(EXE) image_interp
newrun:
/bin/rm -rf dumps images ener.out