forked from XBraid/xbraid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.inc
171 lines (162 loc) · 4.54 KB
/
makefile.inc
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#BHEADER**********************************************************************
#
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory. Written by
# Jacob Schroder, Rob Falgout, Tzanio Kolev, Ulrike Yang, Veselin
# Dobrev, et al. LLNL-CODE-660355. All rights reserved.
#
# This file is part of XBraid. Email [email protected] for support.
#
# This program 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) version 2.1 dated February 1999.
#
# This program 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 terms and conditions of the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with this program; if not, write to the Free Software Foundation, Inc., 59
# Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#EHEADER**********************************************************************
# Three compile time options
# make debug=yes|no
# make valgrind=yes|no
# make sequential=yes|no
# Was DEBUG specified?
ifeq ($(debug),no)
optlevel = OPTIMIZE
else
optlevel = DEBUG
endif
# Was VALGRIND specified?
ifeq ($(valgrind),yes)
lvalgrind = YES
else
lvalgrind = NO
endif
# Was MPI use specified?
ifeq ($(sequential),yes)
sequential = YES
else
sequential = NO
endif
# Default compiler options for different platforms and known machines
# Add an else statement for your machine, if the compile options need adjustment
HOSTNAME := $(shell hostname)
ifeq ($(findstring tux408,$(HOSTNAME)),tux408)
# Jacobs old LLNL tux-boxes
CC = mpicc
MPICC = mpicc
MPICXX = mpicxx
MPIF90 = mpif90
LFLAGS = -lm
ifeq ($(optlevel),DEBUG)
CFLAGS = -g -Wall -lm -fPIC
CXXFLAGS = -g -Wall -Wno-reorder -lm -fPIC
FORTFLAGS = -Og -Wall
else
CFLAGS = -O -Wall -lm -fPIC
CXXFLAGS = -O -Wall -Wno-reorder -lm -fPIC
FORTFLAGS = -O1 -Wall
endif
ifeq ($(lvalgrind),YES)
#only needed for openmpi: LFLAGS += /usr/lib64/valgrind/libmpiwrap-amd64-linux.so
endif
else ifeq ($(shell uname -s), Darwin)
# for Jacob's MacBook running Homebrew
# Need to specifically include lstdc++ (!!)
CC = gcc
MPICC = mpicc
MPICXX = mpicxx
MPIF90 = mpif90
LFLAGS = -lm -lstdc++
ifeq ($(optlevel),DEBUG)
CFLAGS = -g -Wall -fPIC
CXXFLAGS = -g -Wall -fPIC
FORTFLAGS = -Og -Wall
else
CFLAGS = -O3 -Wall -fPIC
CXXFLAGS = -O3 -Wall -fPIC
FORTFLAGS = -O1 -Wall
endif
else ifeq ($(findstring cab,$(HOSTNAME)),cab)
# for Cab
MPICC = mpiicc
MPICXX = mpiicpc
MPIF90 = mpif90
LFLAGS = -lm
ifeq ($(optlevel),DEBUG)
CFLAGS = -g -Wall -fPIC
CXXFLAGS = -g -Wall -fPIC
FORTFLAGS = -Og -Wall
else
CFLAGS = -O -Wall -fPIC
CXXFLAGS = -O -Wall -fPIC
FORTFLAGS = -O1 -Wall
endif
else ifeq ($(findstring vulcan,$(HOSTNAME)),vulcan)
# for Vulcan
MPICC = mpixlc
MPICXX = mpixlcxx
MPIF90 = mpixlf90
LFLAGS = -lm
ifeq ($(optlevel),DEBUG)
CFLAGS = -g -Wall -fPIC
CXXFLAGS = -g -Wall -fPIC
FORTFLAGS = -Og -Wall
else
CFLAGS = -O -Wall -fPIC
CXXFLAGS = -O -Wall -fPIC
FORTFLAGS = -O1 -Wall
endif
else ifeq ($(shell uname -s),Linux)
MPICC = mpicc
MPICXX = mpiCC
MPIF90 = mpif90
LFLAGS = -lm
ifeq ($(optlevel),DEBUG)
CFLAGS = -g -Wall -fPIC
CXXFLAGS = -g -Wall -fPIC
FORTFLAGS = -g -Wall
else
CFLAGS = -O3 -Wall -fPIC
CXXFLAGS = -O3 -Wall -fPIC
FORTFLAGS = -O1 -Wall
endif
##
# Add your machine name here
##
else
MPICC = mpicc
MPICXX = mpiCC
MPIF90 = mpif90
LFLAGS = -lm
ifeq ($(optlevel),DEBUG)
CFLAGS = -g -Wall -fPIC
CXXFLAGS = -g -Wall -fPIC
FORTFLAGS = -g -Wall
else
CFLAGS = -O3 -Wall -fPIC
CXXFLAGS = -O3 -Wall -fPIC
FORTFLAGS = -O1 -Wall
endif
endif
# Compiler options when compiling without MPI
ifeq ($(sequential),YES)
MPICC = gcc
MPICXX = g++
MPIF90 = gfortran
LFLAGS = -lm
ifeq ($(optlevel),DEBUG)
CFLAGS = -g -Wall -D braid_SEQUENTIAL
CXXFLAGS = -g -Wall -D braid_SEQUENTIAL
FORTFLAGS = -g -Wall -D braid_SEQUENTIAL
else
CFLAGS = -O -Wall -D braid_SEQUENTIAL
CXXFLAGS = -O -Wall -D braid_SEQUENTIAL
FORTFLAGS = -O1 -Wall -D braid_SEQUENTIAL
endif
endif