-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
793 lines (652 loc) · 27.4 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
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
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
cmake_minimum_required(VERSION 3.14)
project(Artiatomi LANGUAGES CUDA CXX)
set(CMAKE_BUILD_TYPE Debug)
set(CUDA_COMPILE_OPTIONS --use_fast_math)
#set(CUDA_COMPILE_OPTIONS -g -G -lineinfo) #to debug kernels
set(CMAKE_CXX_STANDARD 14)
set(EMTOOLS_PATH "src/EmTools" CACHE PATH "Path to EmTools source.")
set(CLICKER_PATH "src/Clicker" CACHE PATH "Path to Clicker source.")
set(EMSART_PATH "src/EmSART" CACHE PATH "Path to EmSART source.")
set(ISA_PATH "src/ImageStackAlignator" CACHE PATH "Path to ImageStackAlignator source.")
set(STA_PATH "src/SubTomogramAverageMPI" CACHE PATH "Path to SubTomogramAverageMPI source.")
if(UNIX)
set(CUDA_PATH "/usr/local/cuda" CACHE PATH "Path to CUDA root")
endif()
if(WIN32)
set(MIKTEX_BINARY_PATH "C:/Program Files/MiKTeX 2.9/miktex/bin/x64/")
endif()
######################### CUDA #############################
set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_PATH})
if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()
find_package(CUDA 9.0 REQUIRED)
#find_library(CUDA_LIBRARY cuda ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
#find_library(CUFFT_LIBRARY cufft ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
#find_library(NPPC_LIBRARY nppc ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
#find_library(NPPI_LIBRARY nppi ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
set(CUDA_LIBS ${CUDA_CUDA_LIBRARY}
${CUDA_CUFFT_LIBRARIES}
${CUDA_nppc_LIBRARY}
${CUDA_nppial_LIBRARY}
${CUDA_nppicc_LIBRARY}
${CUDA_nppicom_LIBRARY}
${CUDA_nppidei_LIBRARY}
${CUDA_nppif_LIBRARY}
${CUDA_nppig_LIBRARY}
${CUDA_nppim_LIBRARY}
${CUDA_nppist_LIBRARY}
${CUDA_nppisu_LIBRARY}
${CUDA_nppitc_LIBRARY})
#set(CUDA_LIBS ${CUDA_LIBRARIES})
set(BIN2C_EXEC bin2c) #in cuda toolkit binary path
######################### CUDA #############################
set(OpenCL_INCLUDE_DIR "/usr/local/cuda/include")
set(OpenCL_LIBRARY "/usr/local/cuda/lib64/libOpenCL.so")
find_package(OpenCL REQUIRED)
find_package(OpenGL REQUIRED)
message( ${OpenCL_INCLUDE_DIR} )
message( ${OpenCL_LIBRARIES} )
message( ${OPENGL_INCLUDE_DIR} )
message( ${OPENGL_LIBRARIES} )
######################### OpenCL #############################
######################### FFTW ###########################
if(WIN32)
set(FFTW_ROOT "${CMAKE_SOURCE_DIR}/${EMTOOLS_PATH}/libs/FFTW")
set(FFTW_INC ${FFTW_ROOT})
set(FFTW_LIB ${FFTW_ROOT}/libfftw3f-3.lib)
else()
set(FFTW_LIB "fftw3f")
endif()
##########################################################
######################### Qt #############################
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(CMAKE_VERSION VERSION_LESS "3.7.0")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()
find_package(Qt5 COMPONENTS Core Widgets DBus OpenGL REQUIRED)
######################### Qt #############################
######################### System ################################
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
######################### System ################################
######################### MPI ################################
find_package(MPI REQUIRED)
######################### MPI ################################
####################################################################################################
####################################################################################################
######################### MKLog #####################################
set(MK_LOG_SRC
${EMTOOLS_PATH}/MKLog/MKLog.cpp)
set(MK_LOG_INC
${EMTOOLS_PATH}/Basics
${EMTOOLS_PATH}/MKLog)
set(MK_LOG_LIB
)
######################### MKLog #####################################
######################### Threading ################################
set(THREADING_SRC
${EMTOOLS_PATH}/Threading/SpecificBackgroundThread.cpp)
set(THREADING_INC
${EMTOOLS_PATH}/Basics
${EMTOOLS_PATH}/Threading)
set(THREADING_LIB
Threads::Threads)
######################### Threading ################################
######################### FilterGraph #####################################
set(FILTER_GRAPH_SRC
${EMTOOLS_PATH}/FilterGraph/Matrix.cpp
${EMTOOLS_PATH}/FilterGraph/PointF.cpp
${EMTOOLS_PATH}/FilterGraph/FilterSize.cpp
${EMTOOLS_PATH}/FilterGraph/FilterROI.cpp
${EMTOOLS_PATH}/FilterGraph/FilterPoint2D.cpp)
set(FILTER_GRAPH_INC
${EMTOOLS_PATH}/FilterGraph
${EMTOOLS_PATH}/Basics)
set(FILTER_GRAPH_LIB
)
######################### FilterGraph #####################################
######################### Minimization ################################
set(MINIMIZATION_SRC
${EMTOOLS_PATH}/Minimization/levmar.cpp)
set(MINIMIZATION_INC
${EMTOOLS_PATH}/Basics
${EMTOOLS_PATH}/Minimization)
set(MINIMIZATION_LIB
)
######################### Minimization ################################
######################### FileIO #####################################
set(FILEIO_SRC
${EMTOOLS_PATH}/FileIO/CtfFile.cpp
${EMTOOLS_PATH}/FileIO/Dm3File.cpp
${EMTOOLS_PATH}/FileIO/Dm3FileTag.cpp
${EMTOOLS_PATH}/FileIO/Dm3FileTagDirectory.cpp
${EMTOOLS_PATH}/FileIO/Dm4File.cpp
${EMTOOLS_PATH}/FileIO/Dm4FileTag.cpp
${EMTOOLS_PATH}/FileIO/Dm4FileTagDirectory.cpp
${EMTOOLS_PATH}/FileIO/EmFile.cpp
${EMTOOLS_PATH}/FileIO/File.cpp
${EMTOOLS_PATH}/FileIO/FileIOException.cpp
${EMTOOLS_PATH}/FileIO/FileReader.cpp
${EMTOOLS_PATH}/FileIO/FileWriter.cpp
${EMTOOLS_PATH}/FileIO/ImageBase.cpp
${EMTOOLS_PATH}/FileIO/ImodFiducialFile.cpp
${EMTOOLS_PATH}/FileIO/MarkerFile.cpp
${EMTOOLS_PATH}/FileIO/MDocFile.cpp
${EMTOOLS_PATH}/FileIO/MotiveList.cpp
${EMTOOLS_PATH}/FileIO/MovieStack.cpp
${EMTOOLS_PATH}/FileIO/MRCFile.cpp
${EMTOOLS_PATH}/FileIO/SERFile.cpp
${EMTOOLS_PATH}/FileIO/ShiftFile.cpp
${EMTOOLS_PATH}/FileIO/SimpleFileList.cpp
${EMTOOLS_PATH}/FileIO/SingleFrame.cpp
${EMTOOLS_PATH}/FileIO/TIFFFile.cpp
${EMTOOLS_PATH}/FileIO/TiltSeries.cpp
${EMTOOLS_PATH}/FileIO/Volume.cpp)
set(FILEIO_INC
${EMTOOLS_PATH}/FileIO
${EMTOOLS_PATH}/Basics
${MK_LOG_INC}
${FILTER_GRAPH_INC}
${MINIMIZATION_INC})
set(FILEIO_LIB
)
######################### FileIO #####################################
######################### OpenCLHelpers #####################################
set(OPENCL_HELPERS_SRC
${EMTOOLS_PATH}/OpenCLHelpers/OpenCLDeviceVariable.cpp
${EMTOOLS_PATH}/OpenCLHelpers/OpenCLException.cpp
${EMTOOLS_PATH}/OpenCLHelpers/OpenCLHelpers.cpp
${EMTOOLS_PATH}/OpenCLHelpers/OpenCLKernel.cpp
)
set(OPENCL_HELPERS_INC
${EMTOOLS_PATH}/OpenCLHelpers
${EMTOOLS_PATH}/Basics
${MK_LOG_INC}
${THREADING_INC}
${OpenCL_INCLUDE_DIRS})
set(OPENCL_HELPERS_LIB
${MK_LOG_LIB}
${THREADING_LIB}
Qt5::Widgets
Qt5::Core
Qt5::OpenGL
Qt5::DBus
${OPENGL_LIBRARIES}
${OpenCL_LIBRARIES})
######################### OpenCLHelpers #####################################
######################### CudaHelpers ################################
set(CUDA_HELPERS_SRC
${EMTOOLS_PATH}/CudaHelpers/CudaArrays.cpp
${EMTOOLS_PATH}/CudaHelpers/CudaContext.cpp
${EMTOOLS_PATH}/CudaHelpers/CudaDeviceProperties.cpp
${EMTOOLS_PATH}/CudaHelpers/CudaException.cpp
${EMTOOLS_PATH}/CudaHelpers/CudaHelpers.cpp
${EMTOOLS_PATH}/CudaHelpers/CudaKernel.cpp
${EMTOOLS_PATH}/CudaHelpers/CudaTextures.cpp
${EMTOOLS_PATH}/CudaHelpers/CudaVariables.cpp
${EMTOOLS_PATH}/CudaHelpers/NPPImageBase.cpp
${EMTOOLS_PATH}/CudaHelpers/NPPImages.cpp)
set(CUDA_HELPERS_INC
${EMTOOLS_PATH}/CudaHelpers
${EMTOOLS_PATH}/Basics
${THREADING_INC}
${MK_LOG_INC}
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
set(CUDA_HELPERS_LIB
${CUDA_LIBS}
${THREADING_LIB})
######################### CudaHelpers ################################
######################### CC #####################################
set(CC_SRC
${EMTOOLS_PATH}/CrossCorrelation/CrossCorrelator.cpp)
set(CC_INC
${EMTOOLS_PATH}/CrossCorrelation
${EMTOOLS_PATH}/Basics
${FILEIO_INC}
${FILTER_GRAPH_INC}
${EMTOOLS_PATH}/FileIO
${EMTOOLS_PATH}/FilterGraph
${FFTW_INC})
set(CC_LIB
${FILTER_GRAPH_LIB}
${FILEIO_LIB}
${FFTW_LIB})
######################### CC #####################################
######################### STA FileIO #####################################
set(STA_FILEIO_SRC
${STA_PATH}/io/EMFile.cpp
${STA_PATH}/io/File.cpp
${STA_PATH}/io/FileIOException.cpp
${STA_PATH}/io/FileReader.cpp
${STA_PATH}/io/FileWriter.cpp
${STA_PATH}/io/Image.cpp
${STA_PATH}/io/ImageConverterMethods.cpp
${STA_PATH}/io/MotiveList.cpp)
set(STA_FILEIO_INC
${STA_PATH}/io
${STA_PATH}/basics
${MK_LOG_INC}
${FILTER_GRAPH_INC}
${MINIMIZATION_INC})
set(STA_FILEIO_LIB
)
######################### STA FileIO #####################################
######################### STA CudaHelpers ################################
set(STA_CUDA_HELPERS_SRC
${STA_PATH}/cuda/CudaArrays.cpp
${STA_PATH}/cuda/CudaContext.cpp
${STA_PATH}/cuda/CudaDeviceProperties.cpp
${STA_PATH}/cuda/CudaException.cpp
${STA_PATH}/cuda/CudaGral.cpp
${STA_PATH}/cuda/CudaKernel.cpp
${STA_PATH}/cuda/CudaTextures.cpp
${STA_PATH}/cuda/CudaVariables.cpp)
set(STA_CUDA_HELPERS_INC
${STA_PATH}/cuda
${STA_PATH}/basics
${THREADING_INC}
${MK_LOG_INC}
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
set(STA_CUDA_HELPERS_LIB
${CUDA_LIBS}
${THREADING_LIB})
######################### STA CudaHelpers ################################
######################### STA Config ################################
set(STA_CONFIG_SRC
${STA_PATH}/config/Config.cpp
${STA_PATH}/config/ConfigExceptions.cpp)
set(STA_CONFIG_INC
${STA_PATH}/config
${STA_PATH}/basics)
set(STA_CONFIG_LIB)
######################### STA Config ################################
####################################################################################################
####################################################################################################
####################################################################################################
############################# Applications #####################################################
####################################################################################################
######################### Clicker #####################################
set(CLICKER_SRC
${MK_LOG_SRC}
${FILEIO_SRC}
${CC_SRC}
${OPENCL_HELPERS_SRC}
${MINIMIZATION_SRC}
${THREADING_SRC}
${FILTER_GRAPH_SRC}
${CLICKER_PATH}/mymainwindow.ui
${CLICKER_PATH}/alignmentreport.cpp
${CLICKER_PATH}/baseframecontroller.cpp
${CLICKER_PATH}/cropsizeselector.cpp
${CLICKER_PATH}/floatlineedit.cpp
${CLICKER_PATH}/floatslider.cpp
${CLICKER_PATH}/histogramwidget.cpp
${CLICKER_PATH}/intlineedit.cpp
${CLICKER_PATH}/intslider.cpp
${CLICKER_PATH}/main.cpp
${CLICKER_PATH}/markerlist.cpp
${CLICKER_PATH}/mymainwindow.cpp
${CLICKER_PATH}/myqlineedit.cpp
${CLICKER_PATH}/myqopenglwidget.cpp
${CLICKER_PATH}/reconstructionassistant.cpp
${CLICKER_PATH}/singleframecontroller.cpp
${CLICKER_PATH}/singletonoffscreensurface.cpp
${CLICKER_PATH}/squarelabel.cpp
${CLICKER_PATH}/tiltseriescontroller.cpp)
set(CLICKER_INC
${CLICKER_PATH}
${MK_LOG_INC}
${FILEIO_INC}
${CC_INC}
${OPENCL_HELPERS_INC}
${MINIMIZATION_INC}
${THREADING_INC}
${FILTER_GRAPH_INC}
)
set(CLICKER_LIB
${OPENCL_HELPERS_LIB}
${CC_LIB}
${FILEIO_LIB}
${MK_LOG_LIB}
${MINIMIZATION_LIB}
${THREADING_LIB}
${FILTER_GRAPH_LIB}
Qt5::Widgets
Qt5::Core
Qt5::OpenGL
Qt5::DBus
)
if(UNIX)
set(CLICKER_LIB
${CLICKER_LIB}
m)
endif()
if(WIN32)
add_executable(Clicker WIN32
${CLICKER_SRC})
else()
add_executable(Clicker
${CLICKER_SRC})
endif()
target_include_directories(Clicker PUBLIC ${CLICKER_INC})
target_link_libraries(Clicker ${CLICKER_LIB})
target_compile_definitions(Clicker PUBLIC NO_CUDA)
######################### Clicker #####################################
##############################################################
######################### ImageStackAlignator ################
set(ISA_SRC
${FILEIO_SRC}
${CUDA_HELPERS_SRC}
${MK_LOG_SRC}
${THREADING_SRC}
${FILTER_GRAPH_SRC}
${MINIMIZATION_SRC}
${ISA_PATH}/AlignmentOptions.cpp
${ISA_PATH}/BaseAligner.cpp
${ISA_PATH}/CudaCrossCorrelator.cpp
${ISA_PATH}/ImageStackAlignator.cpp
${ISA_PATH}/Kernels.cpp
)
set(ISA_INC
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
${EMTOOLS_PATH})
set(ISA_LIB
${CUDA_LIBS}
${FILEIO_LIB}
${MK_LOG_LIB}
${MINIMIZATION_LIB}
${THREADING_LIB}
${FILTER_GRAPH_LIB}
)
if(UNIX)
set(ISA_LIB
${ISA_LIB}
m)
endif()
set(CMAKE_VERBOSE_MAKEFILE ON)
# PTX-Kernel file
cuda_compile_ptx(ISA_PTX_FILES ${ISA_PATH}/ImageStackAlignatorKernels/kernel.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${ISA_PATH}/ImageStackAlignatorKernels/kernel.cu.h COMMAND ${BIN2C_EXEC} -p 0 --const --name KernelCC ${ISA_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${ISA_PATH}/ImageStackAlignatorKernels/kernel.cu.h DEPENDS ${ISA_PTX_FILES})
add_custom_target(isa_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${ISA_PATH}/ImageStackAlignatorKernels/kernel.cu.h ${ISA_PATH}/ImageStackAlignatorKernels/kernel.cu
SOURCES ${ISA_PATH}/ImageStackAlignatorKernels/kernel.cu)
# Executable
add_executable(ImageStackAlignator
${ISA_SRC})
# Executable depends on ptx files
add_dependencies(ImageStackAlignator isa_ptx_header)
target_include_directories(ImageStackAlignator PUBLIC ${ISA_INC})
target_link_libraries(ImageStackAlignator ${ISA_LIB})
target_compile_definitions(ImageStackAlignator PUBLIC NO_OPENCL)
target_compile_options(ImageStackAlignator PUBLIC -fpermissive)
######################################################################
######################### EmSART Common ##############################
# Common definitions for EmSART, EmSARTRefine and EmSARTSubVolumes
set(EMSARTCOMMON_SRC
${MK_LOG_SRC}
${FILEIO_SRC}
${FILTER_GRAPH_SRC}
${MINIMIZATION_SRC}
${THREADING_SRC}
${CUDA_HELPERS_SRC}
${EMSART_PATH}/Kernels.cpp
${EMSART_PATH}/Projection.cpp
${EMSART_PATH}/Volume.cpp
${EMSART_PATH}/Reconstructor.cpp
${EMSART_PATH}/utils/ConfigExceptions.cpp
${EMSART_PATH}/utils/CudaConfig.cpp
${EMSART_PATH}/utils/log.cpp
${EMSART_PATH}/utils/SimpleLogger.cpp
${EMSART_PATH}/utils/Config.cpp
${EMSART_PATH}/io/FileSource.cpp
${EMSART_PATH}/io/MPISource.cpp)
set(EMSARTCOMMON_INC
${EMSART_PATH}
${FILEIO_INC}
${MK_LOG_INC}
${FILTER_GRAPH_INC}
${MINIMIZATION_INC}
${THREADING_INC}
${CUDA_HELPERS_INC}
${MPI_CXX_INCLUDE_DIRS}
)
set(EMSARTCOMMON_LIB
${FILEIO_LIB}
${MK_LOG_LIB}
${CUDA_HELPERS_LIB}
${MPI_CXX_LIBRARIES}
${FILTER_GRAPH_LIB}
${MINIMIZATION_LIB}
${THREADING_LIB}
)
# PTX-Kernel file
cuda_compile_ptx(BP_PTX_FILES ${EMSART_PATH}/cuda_kernels/BackProjectionSquareOS.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/BackProjectionSquareOS.cu.h
COMMAND ${BIN2C_EXEC} -p 0 --const --name KernelBackProjectionOS ${BP_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/BackProjectionSquareOS.cu.h DEPENDS ${BP_PTX_FILES})
add_custom_target(bp_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/BackProjectionSquareOS.cu.h ${EMSART_PATH}/cuda_kernels/BackProjectionSquareOS.cu
SOURCES ${EMSART_PATH}/cuda_kernels/BackProjectionSquareOS.cu)
cuda_compile_ptx(FPRM_PTX_FILES ${EMSART_PATH}/cuda_kernels/ForwardProjectionRayMarcher_TL.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/ForwardProjectionRayMarcher_TL.cu.h
COMMAND ${BIN2C_EXEC} -p 0 --const --name KernelForwardProjectionRayMarcher_TL ${FPRM_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/ForwardProjectionRayMarcher_TL.cu.h DEPENDS ${FPRM_PTX_FILES})
add_custom_target(fprm_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/ForwardProjectionRayMarcher_TL.cu.h ${EMSART_PATH}/cuda_kernels/ForwardProjectionRayMarcher_TL.cu
SOURCES ${EMSART_PATH}/cuda_kernels/ForwardProjectionRayMarcher_TL.cu)
cuda_compile_ptx(FPD_PTX_FILES ${EMSART_PATH}/cuda_kernels/ForwardProjectionSlicer.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/ForwardProjectionSlicer.cu.h
COMMAND ${BIN2C_EXEC} -p 0 --const --name KernelForwardProjectionSlicer ${FPD_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/ForwardProjectionSlicer.cu.h DEPENDS ${FPD_PTX_FILES})
add_custom_target(fpd_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/ForwardProjectionSlicer.cu.h ${EMSART_PATH}/cuda_kernels/ForwardProjectionSlicer.cu
SOURCES ${EMSART_PATH}/cuda_kernels/ForwardProjectionSlicer.cu)
cuda_compile_ptx(CTF_PTX_FILES ${EMSART_PATH}/cuda_kernels/ctf.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/ctf.cu.h
COMMAND ${BIN2C_EXEC} -p 0 --const --name Kernelctf ${CTF_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/ctf.cu.h DEPENDS ${CTF_PTX_FILES})
add_custom_target(ctf_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/ctf.cu.h ${EMSART_PATH}/cuda_kernels/ctf.cu
SOURCES ${EMSART_PATH}/cuda_kernels/ctf.cu)
cuda_compile_ptx(CTS_PTX_FILES ${EMSART_PATH}/cuda_kernels/CopyToSquare.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/CopyToSquare.cu.h
COMMAND ${BIN2C_EXEC} -p 0 --const --name KernelCopyToSquare ${CTS_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/CopyToSquare.cu.h DEPENDS ${CTS_PTX_FILES})
add_custom_target(cts_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/CopyToSquare.cu.h ${EMSART_PATH}/cuda_kernels/CopyToSquare.cu
SOURCES ${EMSART_PATH}/cuda_kernels/CopyToSquare.cu)
cuda_compile_ptx(COMPARE_PTX_FILES ${EMSART_PATH}/cuda_kernels/Compare.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/Compare.cu.h
COMMAND ${BIN2C_EXEC} -p 0 --const --name KernelCompare ${COMPARE_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/Compare.cu.h DEPENDS ${COMPARE_PTX_FILES})
add_custom_target(compare_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/Compare.cu.h ${EMSART_PATH}/cuda_kernels/Compare.cu
SOURCES ${EMSART_PATH}/cuda_kernels/Compare.cu)
cuda_compile_ptx(WBP_PTX_FILES ${EMSART_PATH}/cuda_kernels/wbpWeighting.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/wbpWeighting.cu.h
COMMAND ${BIN2C_EXEC} -p 0 --const --name KernelWbpWeighting ${WBP_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/wbpWeighting.cu.h DEPENDS ${WBP_PTX_FILES})
add_custom_target(wbp_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${EMSART_PATH}/cuda_kernels/wbpWeighting.cu.h ${EMSART_PATH}/cuda_kernels/wbpWeighting.cu
SOURCES ${EMSART_PATH}/cuda_kernels/wbpWeighting.cu)
######################################################################
######################### EmSART #####################################
set(EMSART_SRC
${EMSARTCOMMON_SRC}
${EMSART_PATH}/EmSart.cpp
)
set(EMSART_INC
${EMSARTCOMMON_INC}
)
set(EMSART_LIB
${EMSARTCOMMON_LIB}
)
# Executable
add_executable(EmSART
${EMSART_SRC})
# Executable depends on ptx files
add_dependencies(EmSART bp_ptx_header)
add_dependencies(EmSART fprm_ptx_header)
add_dependencies(EmSART fpd_ptx_header)
add_dependencies(EmSART ctf_ptx_header)
add_dependencies(EmSART cts_ptx_header)
add_dependencies(EmSART compare_ptx_header)
add_dependencies(EmSART wbp_ptx_header)
target_include_directories(EmSART PUBLIC ${EMSART_INC})
target_link_libraries(EmSART ${EMSART_LIB})
target_compile_definitions(EmSART PUBLIC NO_OPENCL USE_MPI)
target_compile_options(EmSART PUBLIC -fpermissive)
######################### EmSART #####################################
######################### EmSARTRefine ###############################
set(EMSARTREFINE_SRC
${EMSARTCOMMON_SRC}
${EMSART_PATH}/EmSartRefine.cpp
)
set(EMSARTREFINE_INC
${EMSARTCOMMON_INC}
)
set(EMSARTREFINE_LIB
${EMSARTCOMMON_LIB}
)
# Executable
add_executable(EmSARTRefine
${EMSARTREFINE_SRC})
# Executable depends on ptx files
add_dependencies(EmSARTRefine bp_ptx_header)
add_dependencies(EmSARTRefine fprm_ptx_header)
add_dependencies(EmSARTRefine fpd_ptx_header)
add_dependencies(EmSARTRefine ctf_ptx_header)
add_dependencies(EmSARTRefine cts_ptx_header)
add_dependencies(EmSARTRefine compare_ptx_header)
add_dependencies(EmSARTRefine wbp_ptx_header)
target_include_directories(EmSARTRefine PUBLIC ${EMSARTREFINE_INC})
target_link_libraries(EmSARTRefine ${EMSARTREFINE_LIB})
target_compile_definitions(EmSARTRefine PUBLIC NO_OPENCL USE_MPI REFINE_MODE)
target_compile_options(EmSARTRefine PUBLIC -fpermissive)
######################### EmSARTRefine ###############################
######################### EmSARTSubVolumes ###########################
set(EMSARTSUBVOLS_SRC
${EMSARTCOMMON_SRC}
${EMSART_PATH}/EmSartSubVolumes.cpp
)
set(EMSARTSUBVOLS_INC
${EMSARTCOMMON_INC}
)
set(EMSARTSUBVOLS_LIB
${EMSARTCOMMON_LIB}
)
# Executable
add_executable(EmSARTSubVols
${EMSARTSUBVOLS_SRC})
# Executable depends on ptx files
add_dependencies(EmSARTSubVols bp_ptx_header)
add_dependencies(EmSARTSubVols fprm_ptx_header)
add_dependencies(EmSARTSubVols fpd_ptx_header)
add_dependencies(EmSARTSubVols ctf_ptx_header)
add_dependencies(EmSARTSubVols cts_ptx_header)
add_dependencies(EmSARTSubVols compare_ptx_header)
add_dependencies(EmSARTSubVols wbp_ptx_header)
target_include_directories(EmSARTSubVols PUBLIC ${EMSARTSUBVOLS_INC})
target_link_libraries(EmSARTSubVols ${EMSARTSUBVOLS_LIB})
target_compile_definitions(EmSARTSubVols PUBLIC NO_OPENCL USE_MPI SUBVOLREC_MODE)
target_compile_options(EmSARTSubVols PUBLIC -fpermissive)
######################### EmSARTSubVolumes ###############################
######################### Tutorial #####################################
find_package(LATEX COMPONENTS PDFLATEX)
if(LATEX_FOUND)
include(docs/UseLATEX.cmake)
file(GLOB_RECURSE tutorial_files RELATIVE ${CMAKE_SOURCE_DIR} docs/Tutorial/*.tex)
ADD_LATEX_DOCUMENT(
docs/Tutorial/Tutorial.tex
INPUTS ${tutorial_files}
FORCE_PDF
)
endif()
######################### Tutorial #####################################
######################### STA Common ########################
set(STA_COMMON_SRC
${STA_FILEIO_SRC}
${STA_CUDA_HELPERS_SRC}
${STA_CONFIG_SRC}
${MK_LOG_SRC}
${THREADING_SRC}
${FILTER_GRAPH_SRC}
${MINIMIZATION_SRC}
${STA_PATH}/AvgProcess.cpp
${STA_PATH}/BasicKernel.cpp
${STA_PATH}/CudaReducer.cpp
${STA_PATH}/CudaRot.cpp
${STA_PATH}/stdafx.cpp
)
set(STA_COMMON_INC
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
${MPI_CXX_INCLUDE_DIRS}
${STA_FILEIO_INC}
${STA_CUDA_HELPERS_INC}
${STA_CONFIG_INC}
${STA_PATH}/SubTomogramAverageMPI)
set(STA_COMMON_LIB
${CUDA_LIBS}
${MPI_CXX_LIBRARIES}
${STA_FILEIO_LIB}
${STA_CUDA_HELPERS_LIB}
${STA_CONFIG_LIB}
${MK_LOG_LIB}
${MINIMIZATION_LIB}
${THREADING_LIB}
${FILTER_GRAPH_LIB}
)
set(CMAKE_VERBOSE_MAKEFILE ON)
# PTX-Kernel files
cuda_compile_ptx(STA_PTX_FILES ${STA_PATH}/cuda_kernels/kernel.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${STA_PATH}/cuda_kernels/kernel.cu.h COMMAND ${BIN2C_EXEC} -p 0 --const --name SubTomogramAverageKernel ${STA_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${STA_PATH}/cuda_kernels/kernel.cu.h DEPENDS ${STA_PTX_FILES})
add_custom_target(sta_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${STA_PATH}/cuda_kernels/kernel.cu.h ${STA_PATH}/cuda_kernels/kernel.cu
SOURCES ${STA_PATH}/cuda_kernels/kernel.cu)
cuda_compile_ptx(STA_BASIC_PTX_FILES ${STA_PATH}/cuda_kernels/basicKernels.cu OPTIONS ${CUDA_COMPILE_OPTIONS})
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/${STA_PATH}/cuda_kernels/basicKernels.cu.h COMMAND ${BIN2C_EXEC} -p 0 --const --name SubTomogramAverageBasicKernel ${STA_BASIC_PTX_FILES} > ${CMAKE_SOURCE_DIR}/${STA_PATH}/cuda_kernels/basicKernels.cu.h DEPENDS ${STA_BASIC_PTX_FILES})
add_custom_target(sta_basic_ptx_header ALL
DEPENDS ${CMAKE_SOURCE_DIR}/${STA_PATH}/cuda_kernels/basicKernels.cu.h ${STA_PATH}/cuda_kernels/basicKernels.cu
SOURCES ${STA_PATH}/cuda_kernels/basicKernels.cu)
######################### STA Common ########################
######################### SubTomogramAverageMPI ########################
set(STA_SRC
${STA_COMMON_SRC}
${STA_PATH}/SubTomogramAverageMPI.cpp
)
set(STA_INC
${STA_COMMON_INC}
)
set(STA_LIB
${STA_COMMON_LIB}
)
# Executable
add_executable(SubTomogramAverageMPI
${STA_SRC})
# Executable depends on ptx files
add_dependencies(SubTomogramAverageMPI sta_ptx_header)
add_dependencies(SubTomogramAverageMPI sta_basic_ptx_header)
target_include_directories(SubTomogramAverageMPI PUBLIC ${STA_INC})
target_link_libraries(SubTomogramAverageMPI ${STA_LIB})
target_compile_definitions(SubTomogramAverageMPI PUBLIC NO_OPENCL USE_MPI)
target_compile_options(SubTomogramAverageMPI PUBLIC -fpermissive)
######################### SubTomogramAverageMPI ########################
######################### AddParticles ########################
set(ADDPARTICLES_SRC
${STA_COMMON_SRC}
${STA_PATH}/AddParticles.cpp
)
set(ADDPARTICLES_INC
${STA_COMMON_INC}
)
set(ADDPARTICLES_LIB
${STA_COMMON_LIB}
)
# Executable
add_executable(AddParticles
${ADDPARTICLES_SRC})
# Executable depends on ptx files
add_dependencies(AddParticles sta_ptx_header)
add_dependencies(AddParticles sta_basic_ptx_header)
target_include_directories(AddParticles PUBLIC ${ADDPARTICLES_INC})
target_link_libraries(AddParticles ${ADDPARTICLES_LIB})
target_compile_definitions(AddParticles PUBLIC NO_OPENCL USE_MPI)
target_compile_options(AddParticles PUBLIC -fpermissive)
######################### AddParticles ########################