-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
219 lines (184 loc) · 8.65 KB
/
CMakeLists.txt
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
cmake_minimum_required (VERSION 3.10)
project (identity)
# Credit: https://stackoverflow.com/questions/52180281/cmake-cxx-compiler-version-is-pointing-to-the-old-gcc-version
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.5)
message(FATAL_ERROR "GNU g++ 7.5.0 or later is required. Your current version is: " ${CMAKE_CXX_COMPILER_VERSION})
endif()
else()
message(FATAL_ERROR "Your compiler is currently unsupported: " ${CMAKE_CXX_COMPILER_ID})
endif()
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(CMAKE_CXX_STANDARD 17)
# -ggdb
# -O3 -ffast-math
# -g -O0
# -O2 -fgcse-after-reload -fipa-cp-clone -floop-interchange -floop-unroll-and-jam -fpeel-loops -fpredictive-commoning -fsplit-loops -fsplit-paths -ftree-loop-distribution -ftree-partial-pre -funswitch-loops -fvect-cost-model=dynamic -fversion-loops-for-strides -ffast-math
# There is a bug if -O3 if used in GCC 11.1.0, so we instead added -O2 with all options from -O3
set(CMAKE_CXX_FLAGS " -O2 -fgcse-after-reload -fipa-cp-clone -floop-interchange -floop-unroll-and-jam -fpeel-loops -fpredictive-commoning -fsplit-loops -fsplit-paths -ftree-loop-distribution -ftree-partial-pre -funswitch-loops -fvect-cost-model=dynamic -fversion-loops-for-strides -ffast-math -fopenmp -fmessage-length=0 -fpermissive")
add_library(main STATIC
${CMAKE_SOURCE_DIR}/src/FastaReader.cpp
${CMAKE_SOURCE_DIR}/src/Mutator.cpp
${CMAKE_SOURCE_DIR}/src/ReaderAlignerCoordinator.cpp
${CMAKE_SOURCE_DIR}/src/Parameters.cpp
${CMAKE_SOURCE_DIR}/src/Matrix.cpp
${CMAKE_SOURCE_DIR}/src/DataGenerator.cpp
${CMAKE_SOURCE_DIR}/src/SynDataGenerator.cpp
${CMAKE_SOURCE_DIR}/src/GLMClassifier.cpp
${CMAKE_SOURCE_DIR}/src/GLMRegressor.cpp
${CMAKE_SOURCE_DIR}/src/Normalizer.cpp
${CMAKE_SOURCE_DIR}/src/SimConverter.cpp
${CMAKE_SOURCE_DIR}/src/FeatureExpander.cpp
${CMAKE_SOURCE_DIR}/src/GLM.cpp
${CMAKE_SOURCE_DIR}/src/Node.cpp
${CMAKE_SOURCE_DIR}/src/Evaluator.cpp
${CMAKE_SOURCE_DIR}/src/Feature.cpp
${CMAKE_SOURCE_DIR}/src/FeatureSquared.cpp
${CMAKE_SOURCE_DIR}/src/FeaturePaired.cpp
${CMAKE_SOURCE_DIR}/src/StatisticInfo.cpp
${CMAKE_SOURCE_DIR}/src/ITransformer.cpp
${CMAKE_SOURCE_DIR}/src/GLMPredictor.cpp
${CMAKE_SOURCE_DIR}/src/Serializer.cpp
${CMAKE_SOURCE_DIR}/src/GlobAlignE.cpp
)
add_library(clustering STATIC
${CMAKE_SOURCE_DIR}/src/meshclust/MeShClust.cpp
${CMAKE_SOURCE_DIR}/src/meshclust/ClusterInfo.cpp
${CMAKE_SOURCE_DIR}/src/meshclust/ClusterEvaluator.cpp
${CMAKE_SOURCE_DIR}/src/meshclust/GMM.cpp
)
target_link_libraries(clustering main)
set(LTR_HEADER_FILES
${CMAKE_SOURCE_DIR}/src/ltr/LtrParameters.h
${CMAKE_SOURCE_DIR}/src/ltr/Node.h
${CMAKE_SOURCE_DIR}/src/ltr/DirectedGraph.h
${CMAKE_SOURCE_DIR}/src/ltr/RT.h
${CMAKE_SOURCE_DIR}/src/ltr/DeepNesting.fwd.h
${CMAKE_SOURCE_DIR}/src/ltr/ModulePipeline.fwd.h
)
add_library(ltr STATIC
${CMAKE_SOURCE_DIR}/src/ltr/LtrParameters.cpp
${CMAKE_SOURCE_DIR}/src/ltr/Stretch.cpp
${CMAKE_SOURCE_DIR}/src/ltr/Merger.cpp
${CMAKE_SOURCE_DIR}/src/ltr/ScorerTr.cpp
${CMAKE_SOURCE_DIR}/src/ltr/StretchFeature.cpp
${CMAKE_SOURCE_DIR}/src/ltr/Element.cpp
${CMAKE_SOURCE_DIR}/src/ltr/RTComplete.cpp
${CMAKE_SOURCE_DIR}/src/ltr/RTSolo.cpp
${CMAKE_SOURCE_DIR}/src/ltr/RTComplex.cpp
${CMAKE_SOURCE_DIR}/src/ltr/Detector.cpp
${CMAKE_SOURCE_DIR}/src/ltr/SGD.cpp
${CMAKE_SOURCE_DIR}/src/ltr/Matcher.cpp
${CMAKE_SOURCE_DIR}/src/ltr/CaseMatcher.cpp
${CMAKE_SOURCE_DIR}/src/ltr/CaseSingle.cpp
${CMAKE_SOURCE_DIR}/src/ltr/CaseSolo.cpp
${CMAKE_SOURCE_DIR}/src/ltr/CaseRecentComplex.cpp
${CMAKE_SOURCE_DIR}/src/ltr/CaseRecent.cpp
${CMAKE_SOURCE_DIR}/src/ltr/Output.cpp
${CMAKE_SOURCE_DIR}/src/ltr/OutputBed.cpp
${CMAKE_SOURCE_DIR}/src/ltr/OutputRtr.cpp
${CMAKE_SOURCE_DIR}/src/ltr/OutputCpx.cpp
${CMAKE_SOURCE_DIR}/src/ltr/Filter.cpp
${CMAKE_SOURCE_DIR}/src/ltr/LtrUtility.cpp
${CMAKE_SOURCE_DIR}/src/ltr/LocalAlignment.cpp
${CMAKE_SOURCE_DIR}/src/ltr/PostProcess.cpp
${CMAKE_SOURCE_DIR}/src/ltr/ModulePipeline.cpp
${CMAKE_SOURCE_DIR}/src/ltr/DeepNesting.cpp
)
target_link_libraries(ltr main)
set(MSL_SOURCE
${CMAKE_SOURCE_DIR}/src/msl/MslToMatrix.cpp
)
set(TEST_SOURCE
${CMAKE_SOURCE_DIR}/src/test/Test.cpp
)
set(HEADER_FILES
${CMAKE_SOURCE_DIR}/src/Util.h
${CMAKE_SOURCE_DIR}/src/Aligner.h
${CMAKE_SOURCE_DIR}/src/KmerHistogram.h
${CMAKE_SOURCE_DIR}/src/Statistician.h
${CMAKE_SOURCE_DIR}/src/BestFirst.h
${CMAKE_SOURCE_DIR}/src/LockFreeQueue.h
${CMAKE_SOURCE_DIR}/src/AlignerParallel.h
${CMAKE_SOURCE_DIR}/src/IdentityCalculator.h
${CMAKE_SOURCE_DIR}/src/IdentityCalculator1.h
)
set(CLUSTER_HEADER_FILES
${CMAKE_SOURCE_DIR}/src/meshclust/ClusteringUtil.h
${CMAKE_SOURCE_DIR}/src/meshclust/MeanShift.h
${CMAKE_SOURCE_DIR}/src/meshclust/MeanShiftLarge.h
${CMAKE_SOURCE_DIR}/src/meshclust/Cluster.h
${CMAKE_SOURCE_DIR}/src/meshclust/Reservoir.h
)
# RED source code
add_library(exception STATIC
${CMAKE_SOURCE_DIR}/src/exception/FileDoesNotExistException.cpp
${CMAKE_SOURCE_DIR}/src/exception/InvalidOperationException.cpp
${CMAKE_SOURCE_DIR}/src/exception/InvalidScoreException.cpp
${CMAKE_SOURCE_DIR}/src/exception/InvalidInputException.cpp
${CMAKE_SOURCE_DIR}/src/exception/InvalidOrderOfOperationsException.cpp
${CMAKE_SOURCE_DIR}/src/exception/InvalidStateException.cpp
)
add_library(utility STATIC
${CMAKE_SOURCE_DIR}/src/utility/EmptyLocation.cpp
${CMAKE_SOURCE_DIR}/src/utility/Location.cpp
${CMAKE_SOURCE_DIR}/src/utility/Util.cpp
)
target_link_libraries(utility exception)
set(RED_HEADER_FILES
${CMAKE_SOURCE_DIR}/src/utility/ILocation.h
${CMAKE_SOURCE_DIR}/src/nonltr/EnrichmentMarkovView.h
${CMAKE_SOURCE_DIR}/src/nonltr/KmerHashTable.h
${CMAKE_SOURCE_DIR}/src/nonltr/IChromosome.h
)
add_library(nonltr STATIC
${CMAKE_SOURCE_DIR}/src/nonltr/ChromosomeOneDigit.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/HMM.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/Scanner.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/ChromDetectorMaxima.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/ChromosomeRandom.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/Scorer.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/ChromListMaker.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/DetectorMaxima.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/LocationListCollection.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/TableBuilder.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/Chromosome.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/LocationList.cpp
${CMAKE_SOURCE_DIR}/src/nonltr/Trainer.cpp
)
add_library(repeats STATIC
${CMAKE_SOURCE_DIR}/src/red/Red.cpp
)
add_executable(red ${CMAKE_SOURCE_DIR}/src/RepeatsDetector.cpp ${RED_HEADER_FILES})
target_link_libraries(red exception utility nonltr)
add_executable(redtest ${CMAKE_SOURCE_DIR}/src/red/RedTestDrive.cpp ${RED_HEADER_FILES})
target_link_libraries(redtest repeats exception utility nonltr)
add_executable(chromtest ${CMAKE_SOURCE_DIR}/src/test/chromosometest.cpp ${RED_HEADER_FILES})
target_link_libraries(chromtest nonltr utility)
# End of RED
add_executable(identity ${CMAKE_SOURCE_DIR}/src/Identity.cpp ${HEADER_FILES})
target_link_libraries(identity main)
add_executable(meshclust ${CMAKE_SOURCE_DIR}/src/meshclust/MeShClust.cpp ${HEADER_FILES} ${CLUSTER_HEADER_FILES})
target_link_libraries(meshclust clustering)
add_executable(makeclusters ${CMAKE_SOURCE_DIR}/src/apps/MakeClusters.cpp ${HEADER_FILES} ${CLUSTER_HEADER_FILES})
target_link_libraries(makeclusters main)
add_executable(generateclusters ${CMAKE_SOURCE_DIR}/src/apps/GenerateClusters.cpp ${HEADER_FILES})
target_link_libraries(generateclusters main)
add_executable(clusteval ${CMAKE_SOURCE_DIR}/src/apps/ClustEval.cpp ${HEADER_FILES} ${CLUSTER_HEADER_FILES})
target_link_libraries(clusteval clustering)
add_executable(clustevalalign ${CMAKE_SOURCE_DIR}/src/apps/ClustEvalAlignment.cpp ${HEADER_FILES} ${CLUSTER_HEADER_FILES})
target_link_libraries(clustevalalign clustering)
add_executable(mslToMatrix ${CMAKE_SOURCE_DIR}/src/msl/MslToMatrix.cpp ${MSL_SOURCE} ${HEADER_FILES})
target_link_libraries(mslToMatrix main)
add_executable(driver ${CMAKE_SOURCE_DIR}/src/test/Test.cpp ${TEST_SOURCE} ${HEADER_FILES})
target_link_libraries(driver main)
add_executable(ltrdetector ${CMAKE_SOURCE_DIR}/src/ltr/LTR.cpp ${HEADER_FILES} ${LTR_HEADER_FILES})
target_link_libraries(ltrdetector main ltr)
add_executable(look4ltrs ${CMAKE_SOURCE_DIR}/src/ltr/look4ltrs.cpp ${HEADER_FILES} ${LTR_HEADER_FILES})
target_link_libraries(look4ltrs main ltr repeats exception utility nonltr)
add_executable(generateTrainingData ${CMAKE_SOURCE_DIR}/src/ltr/generateTrainingData.cpp ${HEADER_FILES} ${LTR_HEADER_FILES})
target_link_libraries(generateTrainingData main ltr repeats exception utility nonltr)
add_executable(generateGraphData ${CMAKE_SOURCE_DIR}/src/ltr/generateGraphData.cpp ${HEADER_FILES} ${LTR_HEADER_FILES})
target_link_libraries(generateGraphData main ltr repeats exception utility nonltr)