forked from toastpp/toastpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.incl.in
executable file
·213 lines (166 loc) · 5.52 KB
/
Makefile.incl.in
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
SHELL = /bin/sh
# =======================================================================
# TOAST directory Tree
ifndef TOASTDIR
TOASTDIR = $(PWD)
endif
TOASTVER = $(TOASTDIR)/@OBJDIR@
ARCHDIR = @ARCHDIR@
TSRC = $(TOASTDIR)/src
TINC = $(TOASTDIR)/include
TDOC = $(TOASTDIR)/doc
TOASTOBJ = $(TOASTVER)/obj
TBIN = $(TOASTVER)/bin
TLIB = $(TOASTVER)/lib
RPATH = @RPATH@
# =======================================================================
# Compilers and binutils
CC = @CC@
CFLAGS = @CFLAGS@
CXX = @CXX@
CCFLAGS = @CXXFLAGS@
CCLIBS = -L/usr/X11R6/lib -lm
F77 = @F77@
FFLAGS = @FFLAGS@
FLIBS = @FLIBS@
LD = $(CXX) # may need to be queried from configure
LDFLAGS = @LDFLAGS@
SHLIB_LD = @SHLIB_LD@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
MAKE = make
RM = rm -f
RANLIB = @RANLIB@
LIB_SUFFIX = @LIB_SUFFIX@
STLIB_SUFFIX = @STLIB_SUFFIX@
SHLIB_SUFFIX = @SHLIB_SUFFIX@
BLAS_LIB_SUFFIX = @BLAS_LIB_SUFFIX@
LAPACK_LIB_SUFFIX = @LAPACK_LIB_SUFFIX@
ARPACK_LIB_SUFFIX = @ARPACK_LIB_SUFFIX@
MAKE_LIB = @MAKE_LIB@
BUILD_FDOT = @TOAST_FDOT@
#OGLLIB = @OGLLIB@
OGLLIB =
OGLINC = @OGLINC@
ifeq ($(BUILD_FDOT),1)
OGLLIB = $(TOASTDIR)/lib/libOSMesa.a $(TOASTDIR)/lib/libGLU.a
CCFLAGS += -DMESA_SUPPORT
CCLIBS += -ldl
endif
# =======================================================================
# BLAS and LAPACK libraries (determined by configure)
BLASLIB = @BLASLIB@
SPBLASLIB = -lfsbtk
LAPACKLIB = @LAPACKLIB@
# =======================================================================
# ILUPACK support
ILUPACKDIR = @ILUPACKDIR@
ifdef ILUPACKDIR
ILUPACKINC = -I$(ILUPACKDIR)/include
ILUPACKLIBDIR = $(ILUPACKDIR)/lib/
ILUPACKLIB = -L$(ILUPACKLIBDIR)
ILUFLAGS = -DHAVE_ILU
endif
# =======================================================================
# Pthreads flags
ENABLE_PTHREAD = @ENABLE_PTHREAD@
# =======================================================================
# MPI flags
ENABLE_MPI = @ENABLE_MPI@
MPIINCDIR = @MPIINCDIR@
MPILIBDIR = @MPILIBDIR@
# =======================================================================
# CUDA support
ENABLE_CUDA = @ENABLE_CUDA@
CUDA_INSTALL_PATH = @CUDA_INSTALL_PATH@
NVCC = $(CUDA_INSTALL_PATH)/bin/nvcc -arch=sm_20
# =======================================================================
# SuperLU support
SUPERLUDIR = $(TOASTDIR)/numerics/SuperLU_5.0/SRC
SUPERLUINC = -I$(SUPERLUDIR)
SUPERLULIB = @SUPERLULIB@
BUILD_SUPERLU = @BUILD_SUPERLU@
SUPERLU_LOCAL_STATIC = @SUPERLU_LOCAL_STATIC@
# =======================================================================
# ParMETIS support
ENABLE_PARMETIS = @ENABLE_PARMETIS@
PARMETISINCDIR = @PARMETISINCDIR@
PARMETISLIBDIR = @PARMETISLIBDIR@
# =======================================================================
# Scotch support
ENABLE_SCOTCH = @ENABLE_SCOTCH@
SCOTCHINCDIR = @SCOTCHINCDIR@
SCOTCHLIBDIR = @SCOTCHLIBDIR@
# =======================================================================
# Zoltan support
ENABLE_ZOLTAN = @ENABLE_ZOLTAN@
ZOLTANINCDIR = @ZOLTANINCDIR@
ZOLTANLIBDIR = @ZOLTANLIBDIR@
# =======================================================================
# Libraries
LIBS = @DL_LIBS@ @LIBS@ -lm
TLIBS = -lfe -lmath $(SUPERLULIB) -larpack $(LAPACKLIB) $(BLASLIB) \
$(SPBLASLIB) @TASKLIB@ $(FLIBS) $(ILUPACKLIB)
ifeq ($(ENABLE_ZOLTAN),yes)
TINC += -I$(ZOLTANINCDIR)
TLIBS += -L$(ZOLTANLIBDIR) -lzoltan
endif
ifeq ($(ENABLE_PARMETIS),yes)
TINC += -I$(PARMETISINCDIR)
TLIBS += -L$(PARMETISLIBDIR) -lparmetis -lmetis
endif
ifeq ($(ENABLE_SCOTCH),yes)
TINC += -I$(SCOTCHINCDIR)
TLIBS += -L$(SCOTCHLIBDIR) -lptscotch -lscotch -lscotcherr
endif
ifeq ($(ENABLE_PTHREAD),yes)
TLIBS += -lpthread
endif
ifeq ($(ENABLE_MPI),yes)
TINC += -I$(MPIINCDIR)
TLIBS += -L$(MPILIBDIR) -lmpich -lmpl
endif
MATHLIB = -L$(TLIB) -larpack @SUPERLULIB@ $(SPBLASLIB) $(LAPACKLIB) $(BLASLIB)
FELIB = -L$(TLIB) $(TLIBS)
TOASTLIB = -L$(TLIB) -ltoast $(TLIBS)
TOASTCLIB = -L$(TLIB) -lctoast -ltoast $(TLIBS)
STOASTLIB = -L$(TLIB) -lstoast -lfdot $(TLIBS)
GUIFLAGS = -I$(TSRC)/libtcl @GUIFLAGS@
GUILIBS = -ltoasttcl @GUILIBS@
GLLIB = -L/usr/lib -L/usr/X11R6/lib -lglut -lGLU -lGL -lXmu -lXext -lX11 \
-lXi -ltogl
ifeq ($(ENABLE_CUDA),yes)
LIBS += -L$(CUDA_INSTALL_PATH)/lib64 -lcudart -lcublas
CUDAINC = -I$(CUDA_INSTALL_PATH)/include -I$(TOASTDIR)/numerics/cuda
endif
# =======================================================================
FEINC = -I$(TOASTDIR) -I$(TINC) -I$(TSRC)/libtask $(SUPERLUINC) \
-I$(TSRC)/libmath -I$(TSRC)/libfe -I$(TSRC)/libdiffreg \
-I$(TSRC)/libfdot \
$(ILUPACKINC) $(OGLINC) $(CUDAINC)
TOASTINC = $(FEINC) -I$(TSRC)/libstoast
STOASTINC = $(FEINC) -I$(TSRC)/libstoast
INCLUDE = $(TOASTINC) -DFDOT
# =======================================================================
# =======================================================================
FEFLAGS = $(CCFLAGS) $(ILUFLAGS) $(FEINC)
STOASTFLAGS = $(CCFLAGS) $(ILUFLAGS) $(STOASTINC) $(RPATH)
FLAGS = $(CCFLAGS) $(ILUFLAGS) $(INCLUDE)
# =======================================================================
# =======================================================================
# MATLAB support
# =======================================================================
ifndef MEXBIN
MEXBIN = mex
endif
MEX = $(MEXBIN) @MEXFLAGS@
MEXEXT = @MEXEXT@
MEXFLAGS =
ifeq ($(BUILD_FDOT),1)
MEXFLAGS += -DMESA_SUPPORT
endif
ifeq ($(ENABLE_PTHREAD),yes)
MEXFLAGS += -DTOAST_THREAD
endif
MEXINC = $(INCLUDE)
MEXLIB = $(STOASTLIB) -llbfgs