This repository has been archived by the owner on Nov 23, 2019. It is now read-only.
forked from yayahjb/ncdist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
397 lines (351 loc) · 14.8 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
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
######################################################################
# Makefile - makefile to create sfdist #
# #
# Version 1.1.0 05 July 2019 #
# #
# Herbert J. Bernstein ([email protected]) #
# Lawrence C Andrews #
# #
# (C) Copyright 2016 - 2019 Herbert J. Bernstein, Lawrence C. Andrews#
# #
######################################################################
######################################################################
# #
# YOU MAY REDISTRIBUTE THE sfdist PACKAGE UNDER THE TERMS OF THE GPL #
# #
# ALTERNATIVELY YOU MAY REDISTRIBUTE THE sfdist API UNDER THE TERMS #
# OF THE LGPL #
# #
######################################################################
########################### GPL NOTICES ##############################
# #
# 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; either version 2 of #
# (the License, or (at your option) any later version. #
# #
# 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 #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU 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 #
# #
######################################################################
######################### LGPL NOTICES ###############################
# #
# This library is free software; you can redistribute it and/or #
# modify it under the terms of the GNU Lesser General Public #
# License as published by the Free Software Foundation; either #
# version 2.1 of the License, or (at your option) any later version. #
# #
# This library 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 #
# Lesser General Public License for more details. #
# #
# You should have received a copy of the GNU Lesser General Public #
# License along with this library; if not, write to the Free #
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, #
# MA 02110-1301 USA #
# #
######################################################################
ifeq ($(OS),Windows_NT)
uname_S := Windows
else
uname_S := $(shell uname -s)
endif
ifeq ($(uname_S), Darwin)
RCPP_HEADERS ?= /Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rcpp/include
RCPPARMA_HEADERS ?= /Library/Frameworks/R.framework/Versions/3.3/Resources/library/RcppArmadillo/include
RCPPPARA_HEADERS ?= /Library/Frameworks/R.framework/Versions/3.3/Resources/library/RcppParallel/include
RPATH_HEADERS ?= /Library/Frameworks/R.framework/Versions/3.3/Headers
RPATH_LIBRARIES ?= /Library/Frameworks/R.framework/Versions/3.3/Resources/lib
else
RCPP_HEADERS ?= /usr/local/lib/R/site-library/Rcpp/include
RCPPARMA_HEADERS ?= /usr/local/lib/R/site-library/RcppArmadillo/include
RCPPPARA_HEADERS ?= /usr/local/lib/R/site-library/RcppParallel/include
RPATH_HEADERS ?= /usr/share/R/include
RPATH_LIBRARIES ?= /usr/lib/R/lib
endif
CFLAGS ?= -g -O3 -fPIC -fopenmp
CXXFLAGS ?= -g -O3 -std=gnu++11 -fPIC -fopenmp
#CFLAGS ?= -g -O0 -fPIC -fopenmp
#CXXFLAGS ?= -g -O0 -std=gnu++11 -fPIC -fopenmp
LIBSOURCES = \
B4.cpp \
C3.cpp \
CellInputData.cpp \
D7.cpp \
D7_Boundary.cpp \
D7_BoundaryList.cpp \
D7_Subboundary.cpp \
D7_ClassifySubboundaries.cpp\
G6.cpp \
inverse.cpp \
LatticeConverter.cpp \
LRL_Cell.cpp \
LRL_Cell_Degrees.cpp \
LRL_CoordinateConversionMatrices.cpp \
LRL_StringTools.cpp \
MatD7.cpp \
MatG6.cpp \
MatS6.cpp \
MatN.cpp \
MatMN.cpp \
Mat66.cpp \
MaximaTools.cpp \
PrintTable.cpp \
ProjectorTools.cpp \
RandTools.cpp \
ReadCellData.cpp \
Reducer.cpp \
S6.cpp \
S6Dist.cpp \
Selling.cpp \
S6M_SellingReduce.h \
VectorTools.h \
VecN.h VecN.cpp \
Vec_N_Tools.cpp \
VectorTools.cpp \
vector_3d.cpp
DEPENDENCIES = \
B4.h B4.cpp \
CellInputData.h CellInputData.cpp \
D7.h D7.cpp \
D7_Boundary.h D7_Boundary.cpp \
D7_BoundaryList.h D7_BoundaryList.cpp \
D7_Subboundary.h D7_Subboundary.cpp \
D7_ClassifySubboundaries.h D7_ClassifySubboundaries.cpp\
G6.h G6.cpp \
inverse.h inverse.cpp \
LatticeConverter.h LatticeConverter.cpp \
LRL_Cell.h LRL_Cell.cpp \
LRL_Cell_Degrees.h \
LRL_Cell_Degrees.cpp \
LRL_CoordinateConversionMatrices.h LRL_CoordinateConversionMatrices.cpp \
LRL_StringTools.h LRL_StringTools.cpp \
MatD7.h MatD7.cpp \
MatG6.h MatG6.cpp \
MatS6.h MatS6.cpp \
MatN.h MatN.cpp \
MatMN.h MatMN.cpp \
Mat66.h Mat66.cpp \
MaximaTools.h MaximaTools.cpp \
PrintTable.h PrintTable.cpp \
ProjectorTools.h ProjectorTools.cpp \
RandTools.h RandTools.cpp \
ReadCellData.h ReadCellData.cpp \
Reducer.h Reducer.cpp \
S6.h S6.cpp \
S6M_SellingReduce.h \
Vec_N_Tools.h VectorTools.h \
VecN.h VecN.cpp \
Vec_N_Tools.cpp \
VectorTools.cpp \
vector_3d.cpp
all: ncdist ncdist_mat d7dist D7Test Follower \
rcpp_ncdist.so rcpp_d7dist.so rcpp_s6dist.so rcpp_cs6dist.so rcpp_cs6dist.so \
cs6dist_app s6dist_app cs6dist_mat cs6dist_dist cs6_s6_test
tests:
./Rtests.bash > Rtests.lst
-diff -bu Rtests.lst Rtests.out
./dist_tests.bash > dist_tests.lst
-diff -bu dist_tests.lst dist_tests.out
CS6Dist_func_.o: CS6Dist_func.cpp S6.h C3.h S6Dist.h Selling.h \
S6Dist_func.h Reducer.h Delone.h LRL_Cell.h LRL_Cell_Degrees.h NCDist.h \
CS6Dist.h CS6Dist.c VecN.h Vec_N_Tools.h
g++ $(CXXFLAGS) -c -I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
CS6Dist_func.cpp -o CS6Dist_func_.o
CS6Dist_.o: S6.h C3.h S6Dist.h Selling.h \
S6Dist_func.h Reducer.h Delone.h LRL_Cell.h LRL_Cell_Degrees.h NCDist.h \
CS6Dist.h CS6Dist.c VecN.h Vec_N_Tools.h
gcc $(CFLAGS) -c -I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
CS6Dist.c -o CS6Dist_.o
cs6dist_app: CS6Dist_func_.o CS6Dist_.o cs6dist_app.cpp \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -o cs6dist_app cs6dist_app.cpp CS6Dist_func_.o CS6Dist_.o \
-I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
$(LIBSOURCES) Delone.cpp \
-lpthread
cs6_s6_test: CS6Dist_func_.o CS6Dist_.o S6Dist_func_.o cs6_s6_test.cpp \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -o cs6_s6_test cs6_s6_test.cpp CS6Dist_func_.o CS6Dist_.o S6Dist_func_.o \
-I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
$(LIBSOURCES) Delone.cpp \
-lpthread
cs6dist_mat: CS6Dist_func_.o CS6Dist_.o cs6dist_mat.cpp \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -o cs6dist_mat cs6dist_mat.cpp CS6Dist_func_.o CS6Dist_.o \
-I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
$(LIBSOURCES) Delone.cpp \
-lpthread
cs6dist_dist: CS6Dist_func_.o CS6Dist_.o cs6dist_dist.cpp \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -o cs6dist_dist cs6dist_dist.cpp CS6Dist_func_.o CS6Dist_.o \
-I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
$(LIBSOURCES) Delone.cpp \
-lpthread
S6Dist_func_.o: S6Dist_func.cpp S6.h C3.h S6Dist.h Selling.h \
S6Dist_func.h Reducer.h Delone.h LRL_Cell_Degrees.h NCDist.h VecN.h Vec_N_Tools.h
g++ $(CXXFLAGS) -c -I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) S6Dist_func.cpp -o S6Dist_func_.o
s6dist_app: S6Dist_func_.o s6dist_app.cpp \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -o s6dist_app s6dist_app.cpp S6Dist_func_.o \
-I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
$(LIBSOURCES) Delone.cpp \
-lpthread
ncdist_mat_.o: ncdist_mat.cpp Reducer.h Delone.h LRL_Cell.h LRL_Cell_Degrees.h NCDist.h VecN.h Vec_N_Tools.h
g++ $(CXXFLAGS) -c -I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) ncdist_mat.cpp -o ncdist_mat_.o
ncdist_mat: ncdist_mat_.o \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -o ncdist_mat ncdist_mat_.o -I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
$(LIBSOURCES) Delone.cpp \
-lpthread
ncdist_.o: ncdist.cpp Reducer.h Delone.h LRL_Cell.h LRL_Cell_Degrees.h NCDist.h VecN.h Vec_N_Tools.h
g++ $(CXXFLAGS) -c -I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) ncdist.cpp -o ncdist_.o
ncdist: ncdist_.o \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -o ncdist ncdist_.o -I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
$(LIBSOURCES)Delone.cpp \
-lpthread
d7dist_.o: d7dist.cpp Reducer.h Delone.h LRL_Cell.h LRL_Cell_Degrees.h NCDist.h VecN.h Vec_N_Tools.h
g++ $(CXXFLAGS) -c -I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) d7dist.cpp -o d7dist_.o
d7dist: d7dist_.o \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -o d7dist d7dist_.o -I $(RCPPARMA_HEADERS) -I $(RCPPPARA_HEADERS) \
$(LIBSOURCES) \
D7Dist.c Delone.cpp \
-lpthread
Reducer.o: Reducer.cpp Reducer.h LRL_Cell.h LRL_Cell_Degrees.h NCDist.h
g++ $(CXXFLAGS) -I$(RPATH_HEADERS) -DNDEBUG -fpic -O2 -fPIC \
-I$(RCPP_HEADERS) \
-I$(RCPPPARA_HEADERS) \
-I$(RCPPARMA_HEADERS) -c Reducer.cpp -o Reducer.o
Delone.o: Delone.cpp Delone.h Reducer.h LRL_Cell.h LRL_Cell_Degrees.h NCDist.h
g++ $(CXXFLAGS) -I$(RPATH_HEADERS) -DNDEBUG -fpic -O2 -fPIC \
-I$(RCPP_HEADERS) \
-I$(RCPPPARA_HEADERS) \
-I$(RCPPARMA_HEADERS) -c Delone.cpp -o Delone.o
LRL_Cell.o: LRL_Cell.cpp LRL_Cell_Degrees.cpp Reducer.h LRL_Cell.h LRL_Cell_Degrees.h NCDist.h
g++ $(CXXFLAGS) -I$(RPATH_HEADERS) -DNDEBUG -fpic -O2 -fPIC \
-I$(RCPP_HEADERS) \
-I$(RCPPPARA_HEADERS) \
-I$(RCPPARMA_HEADERS) -c LRL_Cell.cpp -o LRL_Cell.o
LRL_Cell_Degrees.o: LRL_Cell.cpp LRL_Cell_Degrees.cpp Reducer.h LRL_Cell.h LRL_Cell_Degrees.h NCDist.h
g++ $(CXXFLAGS) -I$(RPATH_HEADERS) -DNDEBUG -fpic -O2 -fPIC \
-I$(RCPP_HEADERS) \
-I$(RCPPPARA_HEADERS) \
-I$(RCPPARMA_HEADERS) -c LRL_Cell_Degrees.cpp -o LRL_Cell_Degrees.o
rcpp_s6dist.so: rcpp_s6dist.cpp \
$(DEPENDENCIES) \
S6Dist_func.cpp Delone.h Delone.cpp
g++ $(CXXFLAGS) -shared -o rcpp_s6dist.so -I $(RPATH_HEADERS) -DNDEBUG -fpic -O2 -fPIC \
-I $(RCPP_HEADERS) -I $(RCPPPARA_HEADERS) -I$(RCPPARMA_HEADERS) rcpp_s6dist.cpp S6Dist_func.cpp Delone.cpp \
$(LIBSOURCES) \
-L$(RPATH_LIBRARIES) -lR -lblas -llapack -lpthread
rcpp_cs6dist.so: rcpp_cs6dist.cpp \
CS6Dist.h CS6Dist.c $(DEPENDENCIES) CS6Dist_func.cpp S6Dist_func.cpp Delone.cpp
g++ $(CXXFLAGS) -shared -o rcpp_cs6dist.so -I $(RPATH_HEADERS) -DNDEBUG -fpic -O2 -fPIC \
-I $(RCPP_HEADERS) -I $(RCPPPARA_HEADERS) -I$(RCPPARMA_HEADERS) \
rcpp_cs6dist.cpp CS6Dist.c CS6Dist_func.cpp S6Dist_func.cpp Delone.cpp \
$(LIBSOURCES) \
-L$(RPATH_LIBRARIES) -lR -lblas -llapack -lpthread
rcpp_ncdist.so: rcpp_ncdist.cpp \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -shared -o rcpp_ncdist.so -I$(RPATH_HEADERS) -DNDEBUG -fpic -O2 -fPIC \
-I$(RCPP_HEADERS) -I$(RCPPPARA_HEADERS) -I$(RCPPARMA_HEADERS) rcpp_ncdist.cpp \
Delone.cpp \
$(LIBSOURCES) \
-L$(RPATH_LIBRARIES) -lR -lblas -llapack -lpthread
rcpp_d7dist.so: rcpp_d7dist.cpp D7Dist.h D7Dist.c Delone.cpp \
$(DEPENDENCIES)
g++ $(CXXFLAGS) -shared -o rcpp_d7dist.so \
-I$(RPATH_HEADERS) -DNDEBUG -fpic -O2 -fPIC -I$(RCPP_HEADERS) \
-I$(RCPPPARA_HEADERS) -I$(RCPPARMA_HEADERS) rcpp_d7dist.cpp D7Dist.c Delone.cpp \
$(LIBSOURCES) \
-L$(RPATH_LIBRARIES) -lR -lblas -llapack -lpthread
NCDist.o: NCDist.c NCDist.h
gcc $(CFLAGS) -c NCDist.c
D7Dist.o: D7Dist.c D7Dist.h
gcc $(CFLAGS) -c D7Dist.c
D7Test: D7Test.cpp D7Dist.h d7dist.cpp D7Dist.o NCDist.o \
$(DEPENDENCIES) Delone.h Delone.cpp
g++ $(CXXFLAGS) -o D7Test D7Test.cpp D7Dist.o NCDist.o Delone.cpp \
$(LIBSOURCES) \
-lpthread
Follower: \
$(DEPENDENCIES) \
D7Dist.o \
Delone.cpp \
CreateFileName.h CreateFileName.cpp \
MapBoundaryStrings2Colors.h MapBoundaryStrings2Colors.cpp \
FileOperations.cpp FileOperations.cpp \
FollowerConstants.h FollowerConstants.cpp \
FollowerIO.h FollowerIO.cpp \
FollowerTools.h FollowerTools.cpp \
Follower_main.cpp \
NCDist.o \
FileOperations.h FileWriter.h Follow.h Follower.h \
FollowerConstants.h FollowerIO.h FollowerTools.h \
LinearAxis.h LinearAxis.cpp \
ReadGlobalData.h ReadGlobalData.cpp
g++ $(CXXFLAGS) -o Follower \
$(LIBSOURCES) \
D7Dist.o \
Delone.cpp \
CreateFileName.cpp \
MapBoundaryStrings2Colors.cpp \
FileOperations.cpp \
FollowerConstants.cpp FollowerIO.cpp FollowerTools.cpp \
LinearAxis.cpp \
Follower_main.cpp \
ReadGlobalData.cpp \
NCDist.o
MinimalS6Dist: cqrlib.c MatN.cpp S6.cpp C3.cpp Selling.cpp \
VecN.h cqrlib.h MatN.h S6Dist.cpp Selling.h \
Vec_N_Tools.cpp inverse.cpp MinimalS6Dist.cpp \
S6Dist.h TNear.h Vec_N_Tools.h \
inverse.h S6.h C3.h triple.h \
vector_3d.cpp rhrand.h VecN.cpp vector_3d.h
g++ $(CXXFLAGS) -o MinimalS6Dist \
MinimalS6Dist.cpp \
inverse.cpp S6Dist.cpp VecN.cpp vector_3d.cpp \
MatN.cpp S6.cpp C3.cpp Selling.cpp Vec_N_Tools.cpp
clean:
-@rm -rf *.o
-@rm -rf *.so
-@rm -rf D7Test
-@rm -rf Follower
distclean: clean
-@rm -rf bin
-@rm -rf build
-@rm -rf CS6Dist_func_.o
-@rm -rf cs6dist_app
-@rm -rf cs6_s6_test
-@rm -rf cs6dist_mat
-@rm -rf cs6dist_dist
-@rm -rf d7dist
-@rm -rf d7dist_.o
-@rm -rf Delone.o
-@rm -rf D7Test
-@rm -rf Follower
-@rm -rf lib
-@rm -rf LRL_Cell.o
-@rm -rf LRL_Cell_Degrees.o
-@rm -rf MinimalS6Dist
-@rm -rf ncdist
-@rm -rf ncdist_mat_.o
-@rm -rf ncdist_mat
-@rm -rf ncdist_.o
-@rm -rf ncdist
-@rm -rf Reducer.o
-@rm -rf S6Dist_func_.o
-@rm -rf s6dist_app
-@rm -rf rcpp_s6dist.so
-@rm -rf rcpp_cs6dist.so
-@rm -rf rcpp_ncdist.so
-@rm -rf rcpp_d7dist.so