-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile_psc
557 lines (456 loc) · 14.5 KB
/
Makefile_psc
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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
##############################################################################
## GENERAL SETUP:
##############################################################################
DATE = $(shell date)
OS_NAME = $(shell uname -s)
OS_RELEASE = $(shell uname -r)
RELEASE = 1.0
USER = $(shell whoami)
## This part should be removed before distribution vvv ##
# User-specific configuration:
SKIPME = jbutler psc2 dnave
ifeq ($(filter-out $(SKIPME),$(USER)), $(USER))
ifndef SUBRUN
junk := $(shell csh -c "if (!(-f MakeDepend))$(MAKE) CXX=$(CXX) SUBRUN=1 MakeDepend")
junk := $(shell ./MakeDepend)
endif
endif
ifeq ($(USER),psc2)
USER = dnave
endif
## This part should be removed before distribution ^^^ ##
##############################################################################
## COMPILE-TIME CONFIGURATION:
##############################################################################
## These can be overridden from the `make' command line. For example,
##
## % make DEBUGGING=yes
##
## builds debugging executables.
##
## In most cases, one must run `make clean' before changing the defaults
## below to ensure that executables are rebuilt correctly. Generally, the
## compiler-specific makefiles sort out these options and turn on the right
## compiler flags to get the desired behavior.
# Which compiler to use; can be either `g++' or `cxx'.
COMPILER = g++
#COMPILER = cxx
# QUIET=yes causes the compiler to be less verbose about warnings.
QUIET = no
# DEBUG=yes forces out-of-date executables to be built with symbolic
# debugging information. Any other value is ignored.
DEBUG = yes
# OPTIM=<compiler optimization> forces user-defined optimizations to be used,
# rather than the compiler-specific default.
# If OPTIM=fast, then less optimization is done to speed compilation.
# If OPTIM=none, then no optimization is used.
# If unset, defaults are used.
OPTIM =
# PROFILE=yes builds sampled-profiling (i.e. gprof) executables. Any other
# value is ignored.
PROFILE = no
# FORCE_DEBUG=yes clears NDEBUG (i.e. turns on macros from <assert.h>). Any
# other value is ignored.
FORCE_DEBUG = no
# ASSERT=FAST turns on fast(er) assertion checking. Any other value is
# ignored.
ASSERT = FAST
# OPEN_MP=yes enables OpenMP directives. This is currently only supported for
# CXX compilations. Any other value is ignored.
OPEN_MP = no
# Enables Posix multithreading. This is currently only supported for CXX
# compilations, and partially for GCC v3. This is enabled by default, since
# it has no effect in Gcc compilations. Any other value is ignored.
PTHREADS = yes
##############################################################################
## BASE SYSTEM SETUP:
##############################################################################
## These macros are used in Makefile and Makefile_auto to compile Spines.
## The compiler-specific makefile augments these macros before they are used
## used to build the system. These are here to ensure that the macros are
## instantiated, and as a reminder that the macros exist.
# Location of Xerces XML parser library:
XERCES_INC =
XERCES_LIB =
# Base definitions:
SYS_DEFS = \
-DMAKE_DATE="$(DATE)" \
-DMAKE_OS_RELEASE="$(OS_RELEASE)" \
-DMAKE_RELEASE="$(RELEASE)" \
-DNEW_MAKEFILE
# XXX
ifeq ($(USER),dnave)
SYS_DEFS += -DNO_CHECK_EXECS
endif
# XXX
# Warning control:
SYS_WARN =
# Optimization control:
SYS_OPT =
# Language control (e.g. template instantiations):
SYS_LANG =
# Where to find system-specific includes:
SYS_INCS = -I. $(XERCES_INC)
# Linking control (e.g. to link templates):
SYS_LINK =
# Required libraries:
SYS_LIBS = -lm
# OpenMP macros:
ifeq ($(OPEN_MP),yes)
OMP_FLAGS =
OMP_INCS =
OMP_DEFS =
OMP_OPTIONS = \
$(OMP_FLAGS) \
$(OMP_INCS) \
$(OMP_DEFS)
OMP_LINK =
OMP_LIBS =
endif
# Posix threads macros:
ifeq ($(PTHREADS),yes)
PTHREAD_FLAGS =
PTHREAD_INCS =
PTHREAD_DEFS = -DHAVE_PTHREADS
PTHREAD_OPTIONS = \
$(PTHREAD_FLAGS) \
$(PTHREAD_INCS) \
$(PTHREAD_DEFS)
PTHREAD_LINK =
PTHREAD_LIBS =
endif
ifeq ($(OPTIM),fast)
FAST = yes
endif
##############################################################################
## COMPILATION:
##############################################################################
# Bring in the compiler-specific makefile:
ifeq ($(COMPILER),g++)
include Makefile_g++
endif
ifeq ($(COMPILER),cxx)
include Makefile_cxx
endif
# Setup final compilation options:
CPP_OPTIONS = \
$(SYS_WARN) \
$(SYS_OPT) \
$(SYS_DEFS) \
$(SYS_LANG) \
$(SYS_INCS) \
$(OMP_OPTIONS) \
$(PTHREAD_OPTIONS)
LINK_OPTIONS = \
$(SYS_WARN) \
$(SYS_LINK) \
$(OMP_LINK) \
$(PTHREAD_LINK)
LINK_LIBS = \
$(SYS_LIBS) \
$(OMP_LIBS) \
$(PTHREAD_LIBS) \
CPPO = $(LINK_OPTIONS)
CPPF = $(CPP_OPTIONS) -c
CPPC = $(CPP_OPTIONS) -c
##############################################################################
## COMPILATION TARGET SETUP:
##############################################################################
## The list of executables used by an Assemble run on real data, in rough
## order:
ASSEMBLY_EXECS = \
Assemble \
PackSource \
RequiredDataCheck \
CheckConfigurationFile \
TraceArchiveParser \
ConfigurationParser \
PartitionInput \
FetchAndTrim \
FormPairings1 \
FormPairings2 \
FormPairings3 \
BackupOriginalData \
ExtractMetainfo \
PreassembleInserts \
ReadsToAligns1 \
ReadsToAligns2 \
ReadsToAligns3 \
ReorderReads \
TrimBadEnds \
AnalyzeDepth1 \
AnalyzeDepth2 \
CorrectErrors \
DiscardCrummyAlignments \
LocateChimeras1 \
LocateChimeras2 \
LocateChimeras3 \
LocateChimeras4 \
LocateChimeras5 \
BeforeFindSeeds \
FindSeeds \
ImproveScores \
AlignsToLinks \
SaveRawLinks \
CleanAlignments \
Layout \
AllcontigsToPhrap \
ToConsensus2 \
ToConsensus3 \
MergeContigsWithGaps \
PostMergeClean \
BackupMergedContigs \
BriefGoodAligns \
MergeSupercontigs \
VerifySupercontigIntegrity \
MakeFasta \
ReportPairings \
MakeAlewife \
EvaluateConsensus \
ReadUtilization \
FinishOldReport \
RefineConsensusAlignments \
FinishNewReport \
CreateAceFile
## A supplement to the above list, consisting of executables used by Assemble
## in a run on simulated data:
SIMULATION_EXECS = \
CreateReadsFromTemplates \
MakeTemplates \
ParseRel
## The other executables which are always to be made:
UTILITY_EXECS = \
AddSuperLengths \
AlignByTransitivity \
AlignReadsToConsensus \
AllVsAll \
Blast \
CheckPairs \
Clean \
CleanAlignments \
CmpSeq \
CmpSeqPrint \
CompareRuns \
ContigifyUnplacedPartners \
CvsBack \
CvsClean \
DumpAligns \
DumpBacEnds \
EnlargeContigs \
EvaluateContigCenters \
Fasta \
FindChimeras \
FindIdenticalReads \
FindRepeats \
FixReadLocations \
GC \
GenerateHumanReadableNobbits \
LoadProject \
Ls \
MergeAssemblies \
PackSource \
PatchGaps \
PositionMarkers \
PrintAligns \
PrintFiles \
PrintNobbits \
PrintReadMetaInfo \
RecomputeGaps \
Recover \
ReportMemoryUsage \
SelectAlign \
SelectDoomedLinks \
SelectFastb \
SelectNamedReads \
SelectNamedReadsOld \
SelectQualb \
SelectReads \
ShowContigs \
ShowPairings \
ShowSuperLinks \
ShrinkAssembly \
SymmetrizeAligns \
TraceContig \
TraceLink \
TranslateAssembly \
ViewAlignments \
Walk
EXECUTABLES = \
$(ASSEMBLY_EXECS) \
$(UTILITY_EXECS) \
$(SIMULATION_EXECS)
# Standard targets:
all: assembler utilities simtools
assembler: $(ASSEMBLY_EXECS)
utilities: $(UTILITY_EXECS)
simtools: $(SIMULATION_EXECS)
Makefile_auto: MakeDepend
./MakeDepend
depend: MakeDepend
./MakeDepend
clean:
rm -f *.o $(EXECUTABLES) \
*.pixie *.third contigs.out my.permanent.log.file \
core a.out Makefile.bak bsubin
rm -rf cxx_repository
# Non-standard targets:
LayoutSRCS = Contig.h Link.h Read.h FullGraph.h SparseGraph.h RunTime.h \
MainArrays.h RawLink.h RawLink.cc RawGraph.h ActualLoc.h RunTime.cc \
Assert.h Assert.cc FastIfstream.h FastIfstream.cc \
Misc.h Templates.h ParsedArgs.cc BuildSuperContigs.cc \
BuildSparseGraph.cc FullGraph.cc BuildContigs.cc LayoutMain.cc Contig.cc \
MisplacedReads.cc BuildRawGraph.cc BuildFullGraph.cc ReadActualLocs.cc \
CleanRawGraph.cc Link.cc SparseGraph.cc ActualLoc.cc \
Read.cc ReadsConnectingContigs.cc SuperContig.h ContigLink.h \
ConvertReadLocationToActualLoc.cc PrintFullPerfect.cc \
ReportResults.cc Heuristics.h BuildSuperContigs.cc SuperContig.cc \
BuildContigEarMuff.cc BuildSuperContigActualLocs.cc EarLink.h EarLink.cc \
Ear.h BuildSortedReads.cc InsertUnassignedReads.cc \
Spgraph.h Spgraph.cc ComputeShortestPaths.cc \
WrapUnassignedReadsIntoContigs.cc bcal.h SmithWat.h \
BuildPerfectFullGraph.cc InsertSubsetReadsIntoContigs.cc \
ContigsToPhrapInput.cc MakeReadLocations.cc ComparePlacementInContigs.cc \
MakeReadLocations.h ComparePlacementInContigs.h PlaceEarlinksInGaps.cc \
GapsToPhrapInput.cc DetectEarmuffConflicts.cc Ear.cc \
DisplayGenomeAssembly.cc RemoveRepetitiveLinks.cc \
FindPseudoSubsetReads.cc FindPseudoSubsetReads.h System.cc \
MergePseudomaximalReads.cc ReadMetaInfoBroker.cc ReadMetaInfoBroker.h \
Heuristics.cc ArrayTempls.h ReadLocation.h ReadLocation.cc \
OutputFcns.h ReadActualLocs.h BuildContigs.h \
BuildSuperContigs.h Basevector.cc Basevector.h \
BuildContigEarMuff.h DetectEarmuffConflicts.h InteractiveSession.h InteractiveSession.cc \
ConvertReadLocationToActualLoc.h MergeVerifiedReadPairs.cc \
InsertAllMissedNeighborLinksInFullgraph.cc DismantleFullToRaw.cc ContigActualloc.h \
ContigActualloc.cc Misc.cc LogoddRatios.h LogoddRatios.cc \
LayoutSubroutines.h LayoutSubroutines.cc UseGoldenOverlaps.h UseGoldenOverlaps.cc \
CountLinks.cc LinkStat.cc ReadPairing.h ReadPairing.cc ReadMetaInfo.h ReadMetaInfo.cc
LayoutOBJS = BuildSparseGraph.o FullGraph.o ReadMetaInfoBroker.o ReadLocation.o \
BuildSortedReads.o BuildPerfectFullGraph.o Assert.o RawLink.o RunTime.o \
PrintFullPerfect.o BuildContigEarMuff.o FastIfstream.o \
BuildContigs.o LayoutMain.o Contig.o MisplacedReads.o \
BuildSuperContigActualLocs.o SuperContig.o BuildSuperContigs.o EarLink.o \
BuildRawGraph.o common.o BuildFullGraph.o ReadActualLocs.o \
ReportResults.o ConvertReadLocationToActualLoc.o \
CleanRawGraph.o Link.o SparseGraph.o ActualLoc.o \
Kclock.o GetHost.o String.o System.o \
Read.o ReadsConnectingContigs.o InsertUnassignedReads.o \
Splink.o Spgraph.o ComputeShortestPaths.o WrapUnassignedReadsIntoContigs.o \
InsertSubsetReadsIntoContigs.o Basevector.o \
ContigsToPhrapInput.o MakeReadLocations.o ComparePlacementInContigs.o \
PlaceEarlinksInGaps.o ParsedArgs.o Crash.o \
GapsToPhrapInput.o DetectEarmuffConflicts.o Ear.o \
DisplayGenomeAssembly.o InsertAllMissedNeighborLinksInFullgraph.o \
FindPseudoSubsetReads.o MergePseudomaximalReads.o \
Heuristics.o InteractiveSession.o MergeVerifiedReadPairs.o \
ContigActualloc.o Misc.o LogoddRatios.o \
LayoutSubroutines.o UseGoldenOverlaps.o Vec.o CountLinks.o LinkStat.o \
ReadPairing.o ReadMetaInfo.o PrintMemStats.o Feudal.o $(PROCBUF_OBJ)
Layout: $(LayoutOBJS) $(LayoutSRCS)
$(CPLUSPLUS) $(CPPO) -o Layout $(LayoutOBJS) $(LINK_LIBS)
ifeq ($(COMPILER),cxx)
MakeDepend: procbuf_local.o
endif
MakeDepend: MakeDepend.o String.o System.o Assert.o Crash.o
$(CPLUSPLUS) $(LINK_OPTIONS) -o MakeDepend \
MakeDepend.o String.o System.o Assert.o Crash.o $(LINK_LIBS)
Random.o: Random.cc
cp Random.cc Random.c
$(CC) -c Random.c -w -Drandom=randomx -Dsrandom=srandomx -o Random.o
rm Random.c
Alignment.o: Alignment.cc
$(CPLUSPLUS) $(CPPC_SAFE) $*.cc
LayoutMain.o: LayoutMain.cc
$(CPLUSPLUS) $(CPPF) $*.cc
procbuf_local.o: procbuf_local.cc procbuf_local.h
String.o: String.cc String.h Assert.h Types.h
System.o: System.cc System.h String.h Types.h
# How to compile C++ files:
.cc.o:
$(CPLUSPLUS) $(CPP_OPTIONS) -c $*.cc
##############################################################################
## ADDITIONAL TARGETS:
##############################################################################
## Prepping Spines for download:
## For example:
##
## % make download DOWNLOAD_DIR=<destination>
##
## This will create three tarred, gzipped directories: the binaries, the
## source, and a valid data directory with sample project.
ifndef $(DOWNLOAD_DIR)
DOWNLOAD_DIR = for_download
endif
BIN_DL_DIR = $(DOWNLOAD_DIR)/Spines_bin
SRC_DL_DIR = $(DOWNLOAD_DIR)/Spines_src
DATA_DL_DIR = $(DOWNLOAD_DIR)/Spines_data
download: bin_download src_download data_download
bin_download: $(EXECUTABLES) ViewAlignments.cc Time Manual.html LICENSE.txt lib$(XERCES_LIB).so LICENSE.xerces.txt
rm -rf $(BIN_DL_DIR)
mkdir -p $(BIN_DL_DIR)
cp $(EXECUTABLES) Time $(BIN_DL_DIR)
cp Manual.html $(BIN_DL_DIR)
cp LICENSE.txt $(BIN_DL_DIR)
cp ViewAlignments.cc $(BIN_DL_DIR)
cp lib$(XERCES_LIB).so LICENSE.xerces.txt $(BIN_DL_DIR)
( cd $(DOWNLOAD_DIR); \
tar -cvf Spines_bin.tar Spines_bin; \
rm -rf Spines_bin; \
gzip -vf Spines_bin.tar )
src_download:
rm -rf $(SRC_DL_DIR)
mkdir -p $(SRC_DL_DIR)
find . \( -name "*.c" -o \
-name "*.cc" -o \
-name "*.cpp" -o \
-name "*.h" -o \
-name "*.hh" -o \
-name "*.hpp" \) -print | cpio -pd $(SRC_DL_DIR)
cp Makefile $(SRC_DL_DIR)
cp LICENSE.txt $(SRC_DL_DIR)
cp LICENSE.xerces.txt $(SRC_DL_DIR)/xerces_include
( cd $(DOWNLOAD_DIR); \
tar -cvf Spines_src.tar --exclude=CVS Spines_src; \
rm -rf Spines_src; \
gzip -vf Spines_src.tar )
data_download:
( cd $(DOWNLOAD_DIR); \
rm -rf Spines_data; \
cvs checkout Spines_data; \
tar -cvf Spines_data.tar --exclude=CVS Spines_data; \
rm -rf Spines_data; \
gzip -vf Spines_data.tar )
kecho:
@echo $(command)
gcov_clean:
rm -f *.bb *.bbg *.da *.gcov
diff: PrintFiles
@./kcomp `PrintFiles`
## Additional targets available with CXX:
PIXIES = ReadsToAligns.pixie Layout.pixie LoadProject.pixie \
AlignReadsToConsensus.pixie FetchAndTrim.pixie
THIRDS = ReadsToAligns.third Layout.third LoadProject.third \
AlignReadsToConsensus.third FetchAndTrim.third
pixie: $(PIXIES)
third: $(THIRDS)
ReadsToAligns.pixie: ReadsToAligns
atom -tool pixie ReadsToAligns
LoadProject.pixie: LoadProject
atom -tool pixie LoadProject
AlignReadsToConsensus.pixie: AlignReadsToConsensus
atom -tool pixie AlignReadsToConsensus
FetchAndTrim.pixie: FetchAndTrim
atom -tool pixie FetchAndTrim
Layout.pixie: Layout
atom -tool pixie Layout
ReadsToAligns.third: ReadsToAligns
atom -tool third ReadsToAligns
LoadProject.third: LoadProject
atom -tool third LoadProject
AlignReadsToConsensus.third: AlignReadsToConsensus
atom -tool third AlignReadsToConsensus
FetchAndTrim.third: FetchAndTrim
atom -tool third FetchAndTrim
Layout.third: Layout
atom -tool third Layout
# Import automatic dependencies here:
include Makefile_auto