-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
798 lines (653 loc) · 32.6 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
794
795
796
797
cmake_minimum_required(VERSION 3.1)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# --- custom targets: ---
INCLUDE( cmake/Modules/TargetDistclean.cmake OPTIONAL)
# enable @rpath in the install name for any shared library being built
set(CMAKE_MACOSX_RPATH 1)
project (CLAMR)
# The version number.
set (CLAMR_VERSION_MAJOR 2)
set (CLAMR_VERSION_MINOR 0.7)
set (CLAMR_VERSION "${CLAMR_VERSION_MAJOR}.${CLAMR_VERSION_MINOR}")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif(NOT CMAKE_BUILD_TYPE)
# uncomment to build debug
#set(CMAKE_BUILD_TYPE Debug)
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
# using Clang
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize -ftree-vectorizer-verbose=5")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -g -O0 -Wextra")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -g -O3")
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
# using GCC
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize -ftree-vectorizer-verbose=5")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -g -O0 -Wextra")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -g -O3")
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
# using Intel C++
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -vec-report3")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -g -O0 -Wextra")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -g -O3")
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
# using Visual Studio C++
endif()
#set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pedantic")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize -ftree-vectorizer-verbose=5")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -g -O0 -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -O3")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize -ftree-vectorizer-verbose=5")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -g -O0 -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -O3")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# using Intel C++
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -vec-report3")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -g -O0 -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -O3")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# using Visual Studio C++
endif()
#set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-alias -restrict -opt_report")
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -pedantic -Wc++11-long-long -Wno-overlength-strings")
if (MIC_NATIVE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-intel -std=c99 -mmic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -mmic")
link_directories("/projects/opt/intel/compilers/parallel_studio_xe_2013/composer_xe_2013_sp1.2.144/compiler/lib/mic")
else (MIC_NATIVE)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
endif (MIC_NATIVE)
if (APPLE AND "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mtune=native -Wa,-q")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native -Wa,-q")
else (APPLE AND "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=native -mtune=native")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native")
endif (APPLE AND "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
include_directories(${PROJECT_SOURCE_DIR})
if (NOT MIC_NATIVE)
find_package(OpenCL)
# OPENCL_FOUND : TRUE if found, FALSE otherwise
# OPENCL_INCLUDE_DIRS : Include directories for OpenCL
# OPENCL_LIBRARIES : The libraries to link against
if (OPENCL_FOUND)
include_directories(${OPENCL_INCLUDE_DIRS})
endif (OPENCL_FOUND)
endif (NOT MIC_NATIVE)
find_package(MPI)
if (MPI_FOUND)
include_directories(${MPI_INCLUDE_PATH})
endif (MPI_FOUND)
find_package( OpenMP)
#if(OPENMP_FOUND)
# message("OPENMP FOUND ${OpenMP_C_FLAGS}")
#else (OPENMP_FOUND)
# message("OPENMP NOT FOUND")
#endif(OPENMP_FOUND)
#find_package(ImageMagick COMPONENTS MagickCore MagickWand)
find_package(ImageMagick COMPONENTS MagickWand)
# ImageMagick_FOUND - TRUE if all components are found.
# ImageMagick_INCLUDE_DIRS - Full paths to all include dirs.
# ImageMagick_LIBRARIES - Full paths to all libraries.
# ImageMagick_<component>_FOUND - TRUE if <component> is found.
# ImageMagick_<component>_INCLUDE_DIRS - Full path to <component> include dirs.
# ImageMagick_<component>_LIBRARIES - Full path to <component> libraries.
if (ImageMagick_FOUND)
if (ImageMagick_MagickWand_FOUND)
add_definitions(-DHAVE_MAGICKWAND)
add_definitions(-DMAGICKCORE_HDRI_ENABLE=0)
add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16)
# add_definitions(-DMAGICKCORE_HDRI_ENABLE=0)
# add_definitions(-DMAGICKCORE_QUANTUM_DEPTH=16)
include_directories(${ImageMagick_INCLUDE_DIRS})
endif (ImageMagick_MagickWand_FOUND)
# message("ImageMagick_FOUND ${ImageMagick_FOUND}")
# message("ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS}")
# message("ImageMagick_LIBRARIES ${ImageMagick_LIBRARIES}")
## message("ImageMagick_MagickCore_FOUND ${ImageMagick_MagickCore_FOUND}")
## message("ImageMagick_MagickCore_INCLUDE_DIRS ${ImageMagick_MagickCore_INCLUDE_DIRS}")
## message("ImageMagick_MagickCore_LIBRARIES ${ImageMagick_MagickCore_LIBRARIES}")
# message("ImageMagick_MagickWand_FOUND ${ImageMagick_MagickWand_FOUND}")
# message("ImageMagick_MagickWand_INCLUDE_DIRS ${ImageMagick_MagickWand_INCLUDE_DIRS}")
# message("ImageMagick_MagickWand_LIBRARIES ${ImageMagick_MagickWand_LIBRARIES}")
endif (ImageMagick_FOUND)
#-----------------------------------------------------------------------------
# HDF5 support
#-----------------------------------------------------------------------------
option (HDF5_ENABLE "Enable HDF5 support" OFF)
mark_as_advanced (HDF5_ENABLE)
if(HDF5_ENABLE)
if (NOT HDF5_HDF5_HEADER)
if (BUILD_SHARED_LIBS)
set (FIND_HDF_COMPONENTS C shared)
else (BUILD_SHARED_LIBS)
set (FIND_HDF_COMPONENTS C static)
endif (BUILD_SHARED_LIBS)
message (STATUS "HDF5 find comps: ${FIND_HDF_COMPONENTS}")
set (SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME})
find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} QUIET COMPONENTS ${FIND_HDF_COMPONENTS})
message (STATUS "HDF5 C libs:${HDF5_FOUND} static:${HDF5_static_C_FOUND} and shared:${HDF5_shared_C_FOUND}")
if (HDF5_FOUND)
if (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
# check for single binary package
set (FIND_HDF_COMPONENTS C)
message (STATUS "HDF5 find comps: ${FIND_HDF_COMPONENTS}")
find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS})
message (STATUS "HDF5 libs:${HDF5_FOUND} C:${HDF5_C_FOUND}")
set (HDF5_LIBS ${HDF5_LIBS} ${HDF5_LIBRARIES})
if (HDF5_BUILD_SHARED_LIBS AND USE_SHARED_LIBS)
add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB)
else (HDF5_BUILD_SHARED_LIBS AND USE_SHARED_LIBS)
add_definitions (-DH5_BUILT_AS_STATIC_LIB)
endif (HDF5_BUILD_SHARED_LIBS AND USE_SHARED_LIBS)
else (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
if (HDF5_BUILD_SHARED_LIBS AND USE_SHARED_LIBS AND HDF5_shared_C_FOUND)
set (HDF5_LIBS ${HDF5_LIBS} ${HDF5_C_SHARED_LIBRARY} ${HDF5_HL_SHARED_LIBRARY})
else (HDF5_static_C_FOUND)
set (HDF5_LIBS ${HDF5_LIBS} ${HDF5_C_STATIC_LIBRARY} ${HDF5_HL_STATIC_LIBRARY})
endif (HDF5_BUILD_SHARED_LIBS AND USE_SHARED_LIBS AND HDF5_shared_C_FOUND)
endif (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND)
else (HDF5_FOUND)
set (FIND_HDF_COMPONENTS C)
find_package (HDF5 COMPONENTS ${FIND_HDF_COMPONENTS}) # Legacy find
if (USE_SHARED_LIBS AND EXISTS "${HDF5_LIBRARY_DIRS}/libhdf5.so")
set (HDF5_BUILD_SHARED_LIBS 1)
add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB)
else ()
set (HDF5_BUILD_SHARED_LIBS 0)
add_definitions (-DH5_BUILT_AS_STATIC_LIB)
endif ()
set (HDF5_LIBS ${HDF5_LIBS} ${HDF5_LIBRARIES})
endif (HDF5_FOUND)
set (HDF5_PACKAGE_NAME ${SEARCH_PACKAGE_NAME})
if (HDF5_FOUND)
set (HDF5_HAVE_H5PUBCONF_H 1)
set (HDF5_HAVE_HDF5 1)
set (HDF5_HDF5_HEADER "h5pubconf.h")
set (HDF5_INCLUDE_DIR_GEN ${HDF5_INCLUDE_DIR})
if (NOT HDF5_VERSION_MAJOR)
# HDF5 was build with autotools
if(EXISTS "${HDF5_LIBRARY_DIRS}/../include/H5pubconf.h")
file(STRINGS ${HDF5_LIBRARY_DIRS}/../include/H5pubconf.h "HDF5_VERSION_MAJOR REGEX")
endif()
string(REGEX MATCH "[0-9]+.[0-9]+" HDF5_VERSION_STRING "${HDF5_VERSION_MAJOR}")
endif ()
message (STATUS "HDF5-${HDF5_VERSION_STRING} found: INC=${HDF5_INCLUDE_DIR} TOOLS=${HDF5_TOOLS_DIR} HDF5_BUILD_SHARED_LIBS=${HDF5_BUILD_SHARED_LIBS}")
set(HDF5_FOUND TRUE)
add_definitions(-DHAVE_HDF5)
endif (HDF5_FOUND)
else (NOT HDF5_HDF5_HEADER)
# This project is being called from within another and HDF5 is already configured
set (HDF5_HAVE_H5PUBCONF_H 1)
set (HDF5_HAVE_HDF5 1)
endif (NOT HDF5_HDF5_HEADER)
message (STATUS "HDF5 link libs: ${HDF5_LIBS}")
option (HDF5_ENABLE_FF_SUPPORT "Enable FF version of HDF5" OFF)
mark_as_advanced (HDF5_ENABLE_FF_SUPPORT)
if (HDF5_ENABLE_FF_SUPPORT)
add_definitions (-DHDF5_FF)
message (STATUS "Enabling HDF5 FF Support")
endif (HDF5_ENABLE_FF_SUPPORT)
if (HDF5_FOUND)
INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIR})
endif (HDF5_FOUND)
else (HDF5_ENABLE)
message (STATUS "Disabling HDF5 Support")
endif(HDF5_ENABLE)
#-----------------------------------------------------------------------------
# Option to use Shared/Static libs, default is static
#-----------------------------------------------------------------------------
set (LIB_TYPE STATIC)
if (BUILD_SHARED_LIBS)
set (LIB_TYPE SHARED)
endif (BUILD_SHARED_LIBS)
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
if (NOT PRECISION_TYPE)
set (PRECISION_TYPE full_precision)
endif (NOT PRECISION_TYPE)
if (PRECISION_TYPE STREQUAL "mixed_precision")
set (MIXED_PRECISION on)
set (PRECISION_TYPE mixed_precision)
add_definitions(-DMIXED_PRECISION)
endif (PRECISION_TYPE STREQUAL "mixed_precision")
if (PRECISION_TYPE STREQUAL "full_precision")
set (FULL_PRECISION on)
set (PRECISION_TYPE full_precision)
add_definitions(-DFULL_PRECISION)
endif (PRECISION_TYPE STREQUAL "full_precision")
if (PRECISION_TYPE STREQUAL "minimum_precision")
set (MINIMUM_PRECISION on)
set (PRECISION_TYPE minimum_precision)
add_definitions(-DMINIMUM_PRECISION)
endif (PRECISION_TYPE STREQUAL "minimum_precision")
if (NOT GRAPHICS_TYPE)
set (GRAPHICS_TYPE none)
endif (NOT GRAPHICS_TYPE)
if (GRAPHICS_TYPE STREQUAL "OpenGL")
find_package(OpenGL)
endif (GRAPHICS_TYPE STREQUAL "OpenGL")
# If autodetect does not work try setting MPEHOME or
# MPE_INCLUDE_DIR and MPE_LIBRARIES
if (GRAPHICS_TYPE STREQUAL "MPE")
find_package(MPE)
find_package(X11)
endif (GRAPHICS_TYPE STREQUAL "MPE")
#message("MPI_LIBRARIES ${MPI_LIBRARIES}")
#message("MPI_INCLUDE_PATH ${MPI_INCLUDE_PATH}")
#message("GRAPHICS_TYPE is ${GRAPHICS_TYPE}")
#message("MPE_INCLUDE is ${MPE_INCLUDE_DIR}")
if (OPENGL_FOUND)
set (HAVE_GRAPHICS on)
set (HAVE_OPENGL on)
include_directories(${OPENGL_INCLUDE_DIR})
find_package(GLUT)
endif (OPENGL_FOUND)
#if(DEFINED ENV{QUO_HOME})
# if(EXISTS "$ENV{QUO_HOME}/include/")
# message(STATUS "QUO Detected")
# set (QUO_FOUND on)
# include_directories($ENV{QUO_HOME}/include)
# endif (EXISTS "$ENV{QUO_HOME}/include/")
#endif (DEFINED ENV{QUO_HOME})
#if(DEFINED ENV{REPROBLAS_HOME})
# if(EXISTS "$ENV{REPROBLAS_HOME}/include/rblas.h")
# message(STATUS "reproBlas Detected")
# set (REPROBLAS_FOUND on)
# set (HAVE_REPROBLAS ON)
# include_directories($ENV{REPROBLAS_HOME}/include)
# set (REPROBLAS_LIBRARIES -L$ENV{REPROBLAS_HOME}/libs -lreproblas_mpi -lreproblas_seq -liblas -lmpindexedfp -lindexedfp)
# endif (EXISTS "$ENV{REPROBLAS_HOME}/include/rblas.h")
#endif (DEFINED ENV{REPROBLAS_HOME})
#if(DEFINED ENV{LTTRACE_HOME})
# if(EXISTS "$ENV{LTTRACE_HOME}/lib/liblttrace.a")
# message(STATUS "LTTRACE Detected")
# include_directories($ENV{LTTRACE_HOME}/include)
# set (LTTRACE_FOUND on)
# set (HAVE_LTTRACE ON)
# set (LTTRACE_LIBRARIES -L$ENV{LTTRACE_HOME}/lib -llttrace -lz -luuid -Wl,-rpath -Wl,$ENV{LTTRACE_HOME}/lib)
# endif (EXISTS "$ENV{LTTRACE_HOME}/lib/liblttrace.a")
#endif (DEFINED ENV{LTTRACE_HOME})
#if (DEFINED ENV{LD_LIBRARY_PATH})
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,$ENV{LD_LIBRARY_PATH}")
# message("CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}")
# #string (REPLACE ":" ";" LDPATH_TMP $ENV{LD_LIBRARY_PATH})
# #foreach(LDPATH ${LDPATH_TMP})
# # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${LDPATH}")
# # message("CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}")
# #endforeach(LDPATH)
#endif (DEFINED ENV{LD_LIBRARY_PATH})
if (NOT OPENGL_FOUND)
if (MPE_FOUND)
set (HAVE_GRAPHICS on)
set (HAVE_MPE on)
include_directories(${MPE_INCLUDE_DIR})
if (X11_FOUND)
include_directories(${X11_INCLUDE_DIR})
endif (X11_FOUND)
set (MPE_LIBS ${MPE_LIBRARIES})
set (MPE_NOMPI_LIBS ${MPE_NOMPI_LIBRARIES})
set (X11_LIBS ${X11_LIBRARIES})
endif (MPE_FOUND)
endif (NOT OPENGL_FOUND)
# search for Boost
# this min version isn't correct -- FIXME
#set (BOOST_MIN_VER "1.45.0")
#find_package(Boost ${BOOST_MIN_VER})
#message("MPE_LIBRARIES ${MPE_LIBRARIES}")
#message("MPE_LIBS ${MPE_LIBS}")
#message("MPE_NOMPI_LIBS ${MPE_NOMPI_LIBS}")
#message("OPENGL_LIBRARIES ${OPENGL_LIBRARIES}")
#message("GLUT_LIBRARIES ${GLUT_LIBRARIES}")
#message("X11_LIBRARIES ${X11_LIBRARIES}")
#message("X11_LIBS ${X11_LIBS}")
add_definitions(-DHAVE_CONFIG_H)
if (CMAKE_ITTNOTIFY)
message("ITTNOTIFY FOUND")
set (ITTNOTIFY_FOUND on)
add_definitions(-DHAVE_ITTNOTIFY)
include_directories("$ENV{VTUNE_AMPLIFIER_XE_2016_DIR}/include")
set(ITTNOTIFY_LIBS "-pthread -rdynamic -L$ENV{VTUNE_AMPLIFIER_XE_2016_DIR}/lib64 -littnotify")
endif (CMAKE_ITTNOTIFY)
#message("ITTNOTIFY FOUND: " ${CMAKE_ITTNOTIFY} " " ${ITTNOTIFY_FOUND})
# add the binary tree to the search path for include files
# so that we will find config.h
include_directories("${PROJECT_BINARY_DIR}")
#ADDING TESTS CODE####
if (EXISTS "${CMAKE_SOURCE_DIR}/tests" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/tests")
add_subdirectory(tests)
endif (EXISTS "${CMAKE_SOURCE_DIR}/tests" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/tests")
if (EXISTS "${CMAKE_SOURCE_DIR}/mesh" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/mesh")
add_subdirectory(mesh)
endif (EXISTS "${CMAKE_SOURCE_DIR}/mesh" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/mesh")
if (EXISTS "${CMAKE_SOURCE_DIR}/s7" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/s7")
add_subdirectory(s7)
endif (EXISTS "${CMAKE_SOURCE_DIR}/s7" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/s7")
if (EXISTS "${CMAKE_SOURCE_DIR}/l7" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/l7")
add_subdirectory(l7)
endif (EXISTS "${CMAKE_SOURCE_DIR}/l7" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/l7")
if (EXISTS "${CMAKE_SOURCE_DIR}/graphics" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/graphics")
add_subdirectory(graphics)
endif (EXISTS "${CMAKE_SOURCE_DIR}/graphics" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/graphics")
if (EXISTS "${CMAKE_SOURCE_DIR}/timer" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/timer")
add_subdirectory(timer)
endif (EXISTS "${CMAKE_SOURCE_DIR}/timer" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/timer")
if (EXISTS "${CMAKE_SOURCE_DIR}/memstats" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/memstats")
add_subdirectory(memstats)
endif (EXISTS "${CMAKE_SOURCE_DIR}/memstats" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/memstats")
if (OPENCL_FOUND)
if (EXISTS "${CMAKE_SOURCE_DIR}/ezcl" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/ezcl")
add_subdirectory(ezcl)
endif (EXISTS "${CMAKE_SOURCE_DIR}/ezcl" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/ezcl")
endif (OPENCL_FOUND)
if (EXISTS "${CMAKE_SOURCE_DIR}/genmalloc" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/genmalloc")
add_subdirectory(genmalloc)
endif (EXISTS "${CMAKE_SOURCE_DIR}/genmalloc" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/genmalloc")
if (EXISTS "${CMAKE_SOURCE_DIR}/MallocPlus" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/MallocPlus")
add_subdirectory(MallocPlus)
endif (EXISTS "${CMAKE_SOURCE_DIR}/MallocPlus" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/MallocPlus")
if (EXISTS "${CMAKE_SOURCE_DIR}/hash" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/hash")
add_subdirectory(hash)
endif (EXISTS "${CMAKE_SOURCE_DIR}/hash" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/hash")
if (EXISTS "${CMAKE_SOURCE_DIR}/crux" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/crux")
add_subdirectory(crux)
endif (EXISTS "${CMAKE_SOURCE_DIR}/crux" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/crux")
if (EXISTS "${CMAKE_SOURCE_DIR}/PowerParser" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/PowerParser")
add_subdirectory(PowerParser)
endif (EXISTS "${CMAKE_SOURCE_DIR}/PowerParser" AND IS_DIRECTORY "${CMAKE_SOURCE_DIR}/PowerParser")
########### embed source target ###############
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/state_kernel.inc
COMMAND ${CMAKE_SOURCE_DIR}/embed_source.pl ${CMAKE_SOURCE_DIR}/state_kern.cl > state_kernel.inc
DEPENDS state_kern.cl ${CMAKE_SOURCE_DIR}/embed_source.pl)
add_custom_target(state_kernel_source ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/state_kernel.inc)
########### clamr target ###############
if (OPENCL_FOUND AND MPI_FOUND)
set(clamr_CXX_SRCS clamr.cpp state.cpp input.cpp)
set(clamr_H_SRCS state.h input.h)
set(clamr_SRCS ${clamr_CXX_SRCS} ${clamr_C_SRCS} ${clamr_H_SRCS})
add_executable(clamr ${clamr_SRCS})
set_target_properties(clamr PROPERTIES COMPILE_DEFINITIONS "HAVE_MPI;HAVE_OPENCL")
target_link_libraries(clamr dpmesh hsfc kdtree zorder pcrux dhash pezcl pgraphics timer memstats dl7 genmalloc dpMallocPlus m)
target_link_libraries(clamr ${OPENCL_LIBRARIES})
if (REPROBLAS_FOUND)
target_link_libraries(clamr ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
if (LTTRACE_FOUND)
target_link_libraries(clamr ${LTTRACE_LIBRARIES})
endif (LTTRACE_FOUND)
if (MIC_NATIVE)
target_link_libraries(clamr iomp5 cilkrts)
endif (MIC_NATIVE)
target_link_libraries(clamr ${MPI_LIBRARIES})
add_dependencies(clamr state_kernel_source)
install(TARGETS clamr DESTINATION bin)
endif (OPENCL_FOUND AND MPI_FOUND)
########### clamr_cpuonly target ###############
set(clamr_cpuonly_CXX_SRCS clamr_cpuonly.cpp state.cpp input.cpp)
set(clamr_cpuonly_H_SRCS state.h input.h)
set(clamr_cpuonly_SRCS ${clamr_cpuonly_CXX_SRCS} ${clamr_cpuonly_C_SRCS} ${clamr_cpuonly_H_SRCS})
add_executable(clamr_cpuonly ${clamr_cpuonly_SRCS})
target_link_libraries(clamr_cpuonly PowerParser mesh hsfc kdtree zorder crux hash graphics timer memstats genmalloc MallocPlus m)
if (REPROBLAS_FOUND)
target_link_libraries(clamr_cpuonly ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
#target_link_libraries(clamr_cpuonly ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
if (ITTNOTIFY_FOUND)
target_link_libraries(clamr_cpuonly ${ITTNOTIFY_LIBS})
endif (ITTNOTIFY_FOUND)
install(TARGETS clamr_cpuonly DESTINATION bin)
########### clamr_gpuonly target ###############
if (OPENCL_FOUND)
set(clamr_gpuonly_CXX_SRCS clamr_gpuonly.cpp state.cpp input.cpp)
set(clamr_gpuonly_H_SRCS state.h input.h)
set(clamr_gpuonly_SRCS ${clamr_gpuonly_CXX_SRCS} ${clamr_gpuonly_C_SRCS} ${clamr_gpuonly_H_SRCS})
add_executable(clamr_gpuonly ${clamr_gpuonly_SRCS})
set_target_properties(clamr_gpuonly PROPERTIES COMPILE_DEFINITIONS HAVE_OPENCL)
target_link_libraries(clamr_gpuonly PowerParser dmesh hsfc kdtree zorder crux dhash ezcl graphics timer memstats genmalloc dMallocPlus m)
target_link_libraries(clamr_gpuonly ${OPENCL_LIBRARIES})
if (REPROBLAS_FOUND)
target_link_libraries(clamr_gpuonly ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
if (MIC_NATIVE)
target_link_libraries(clamr_gpuonly iomp5 cilkrts)
endif (MIC_NATIVE)
add_dependencies(clamr_gpuonly state_kernel_source)
install(TARGETS clamr_gpuonly DESTINATION bin)
endif (OPENCL_FOUND)
########### clamr_mpionly target ###############
if (MPI_FOUND)
set(clamr_mpionly_CXX_SRCS clamr_mpionly.cpp state.cpp input.cpp)
set(clamr_mpionly_H_SRCS state.h input.h)
set(clamr_mpionly_SRCS ${clamr_mpionly_CXX_SRCS} ${clamr_mpionly_C_SRCS} ${clamr_mpionly_H_SRCS})
add_executable(clamr_mpionly ${clamr_mpionly_SRCS})
set_target_properties(clamr_mpionly PROPERTIES COMPILE_DEFINITIONS HAVE_MPI)
target_link_libraries(clamr_mpionly pPowerParser pmesh hsfc kdtree zorder pcrux hash pgraphics timer memstats l7 genmalloc pMallocPlus m)
if (REPROBLAS_FOUND)
target_link_libraries(clamr_mpionly ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
if (LTTRACE_FOUND)
target_link_libraries(clamr_mpionly ${LTTRACE_LIBRARIES})
endif (LTTRACE_FOUND)
if (MIC_NATIVE)
target_link_libraries(clamr_mpionly iomp5 cilkrts)
endif (MIC_NATIVE)
target_link_libraries(clamr_mpionly ${MPI_LIBRARIES})
if (ITTNOTIFY_FOUND)
target_link_libraries(clamr_mpionly ${ITTNOTIFY_LIBS})
endif (ITTNOTIFY_FOUND)
install(TARGETS clamr_mpionly DESTINATION bin)
endif (MPI_FOUND)
########### clamr_openmponly target ###############
# This shares the clamr_cpuonly.cpp source file
if(OPENMP_FOUND)
set(clamr_openmponly_CXX_SRCS clamr_cpuonly.cpp state.cpp input.cpp)
set(clamr_openmponly_H_SRCS state.h input.h)
set(clamr_openmponly_SRCS ${clamr_openmponly_CXX_SRCS} ${clamr_openmponly_C_SRCS} ${clamr_openmponly_H_SRCS})
add_executable(clamr_openmponly ${clamr_openmponly_SRCS})
set_target_properties(clamr_openmponly PROPERTIES COMPILE_FLAGS ${OpenMP_C_FLAGS})
set_target_properties(clamr_openmponly PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS})
set_target_properties(clamr_openmponly PROPERTIES LINK_FLAGS "${OpenMP_C_FLAGS}")
target_link_libraries(clamr_openmponly PowerParser mpmesh hsfc kdtree zorder crux mphash graphics mptimer memstats genmalloc mpMallocPlus m)
if (REPROBLAS_FOUND)
target_link_libraries(clamr_openmponly ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
if (MIC_NATIVE)
target_link_libraries(clamr_openmponly iomp5 cilkrts)
endif (MIC_NATIVE)
if (ITTNOTIFY_FOUND)
target_link_libraries(clamr_openmponly ${ITTNOTIFY_LIBS})
endif (ITTNOTIFY_FOUND)
install(TARGETS clamr_openmponly DESTINATION bin)
endif(OPENMP_FOUND)
########### clamr_mpiopenmponly target ###############
# This uses the clamr_mpionly driver with the OpenMP compile flag set
if (MPI_FOUND AND OPENMP_FOUND)
set(clamr_mpiopenmponly_CXX_SRCS clamr_mpionly.cpp state.cpp input.cpp)
set(clamr_mpiopenmponly_H_SRCS state.h input.h)
set(clamr_mpiopenmponly_SRCS ${clamr_mpiopenmponly_CXX_SRCS} ${clamr_mpiopenmponly_C_SRCS} ${clamr_mpiopenmponly_H_SRCS})
add_executable(clamr_mpiopenmponly ${clamr_mpiopenmponly_SRCS})
set_target_properties(clamr_mpiopenmponly PROPERTIES COMPILE_DEFINITIONS "HAVE_MPI")
set(clamr_mpiopenmponly_link_flags "${OpenMP_CXX_FLAGS}")
set_target_properties(clamr_mpiopenmponly PROPERTIES COMPILE_FLAGS ${OpenMP_C_FLAGS})
set_target_properties(clamr_mpiopenmponly PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS})
set_target_properties(clamr_mpiopenmponly PROPERTIES LINK_FLAGS "${clamr_mpiopenmponly_link_flags}")
target_link_libraries(clamr_mpiopenmponly pPowerParser pmpmesh hsfc kdtree zorder pcrux mphash pgraphics mptimer memstats mpl7 genmalloc pmpMallocPlus m)
if (REPROBLAS_FOUND)
target_link_libraries(clamr_mpiopenmponly ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
if (LTTRACE_FOUND)
target_link_libraries(clamr_mpiopenmponly ${LTTRACE_LIBRARIES})
endif (LTTRACE_FOUND)
if (MIC_NATIVE)
target_link_libraries(clamr_mpiopenmponly iomp5 cilkrts)
endif (MIC_NATIVE)
target_link_libraries(clamr_mpiopenmponly ${MPI_LIBRARIES})
install(TARGETS clamr_mpiopenmponly DESTINATION bin)
if (ITTNOTIFY_FOUND)
target_link_libraries(clamr_mpiopenmponly ${ITTNOTIFY_LIBS})
endif (ITTNOTIFY_FOUND)
endif (MPI_FOUND AND OPENMP_FOUND)
########### clamr_quo target ###############
# only build this thing if we have QUO, MPI, and OpenMP
if (QUO_FOUND AND MPI_FOUND AND OPENMP_FOUND AND Boost_FOUND)
# doing this way because we only want j7 if doing quo (for now)
# this only enables experimental software if the user has all the things
message(STATUS "Adding J7 Support")
add_subdirectory(j7)
message(STATUS "clamr_quo Minimum Requires Met")
set(clamr_quo_CXX_SRCS clamr_quo.cpp state.cpp input.cpp)
set(clamr_quo_H_SRCS state.h input.h)
set(clamr_quo_SRCS ${clamr_quo_CXX_SRCS} ${clamr_quo_C_SRCS} ${clamr_quo_H_SRCS})
add_executable(clamr_quo ${clamr_quo_SRCS})
# these sets HAVE_J7 and HAVE_QUO in config.h
set(HAVE_J7 ON)
set(HAVE_QUO ON)
set_target_properties(clamr_quo PROPERTIES COMPILE_DEFINITIONS "HAVE_MPI")
set(clamr_quo_link_flags "${OpenMP_CXX_FLAGS}")
set_target_properties(clamr_quo PROPERTIES COMPILE_FLAGS ${OpenMP_C_FLAGS})
set_target_properties(clamr_quo PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS})
set(clamr_quo_link_flags "${clamr_quo_link_flags} -L$ENV{QUO_HOME}/lib")
set_target_properties(clamr_quo PROPERTIES LINK_FLAGS "${clamr_quo_link_flags}")
target_link_libraries(clamr_quo pmesh hsfc kdtree zorder crux hash pgraphics timer memstats l7 genmalloc pMallocPlus m)
target_link_libraries(clamr_quo quo)
target_link_libraries(clamr_quo j7)
if (REPROBLAS_FOUND)
target_link_libraries(clamr_quo ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
if (LTTRACE_FOUND)
target_link_libraries(clamr_quo ${LTTRACE_LIBRARIES})
endif (LTTRACE_FOUND)
if (MIC_NATIVE)
target_link_libraries(clamr_quo iomp5 cilkrts)
endif (MIC_NATIVE)
target_link_libraries(clamr_quo ${MPI_LIBRARIES})
install(TARGETS clamr_quo DESTINATION bin)
# XXX add load imbalance code here for now
set(load_imbl_CXX_SRCS QUO.cpp QUO.hpp load-imbl.cpp)
add_executable(load-imbl ${load_imbl_CXX_SRCS})
set_target_properties(load-imbl PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS})
set_target_properties(load-imbl PROPERTIES LINK_FLAGS
"${OpenMP_CXX_FLAGS} -L$ENV{QUO_HOME}/lib")
target_link_libraries(load-imbl ${MPI_LIBRARIES})
target_link_libraries(load-imbl j7 quo)
endif()
########### clamr_gpucheck target ###############
if (OPENCL_FOUND)
set(clamr_gpucheck_CXX_SRCS clamr_gpucheck.cpp state.cpp input.cpp)
set(clamr_gpucheck_H_SRCS state.h input.h)
set(clamr_gpucheck_SRCS ${clamr_gpucheck_CXX_SRCS} ${clamr_gpucheck_C_SRCS} ${clamr_gpucheck_H_SRCS})
add_executable(clamr_gpucheck ${clamr_gpucheck_SRCS})
set_target_properties(clamr_gpucheck PROPERTIES COMPILE_DEFINITIONS HAVE_OPENCL)
target_link_libraries(clamr_gpucheck PowerParser dmesh hsfc kdtree zorder crux dhash ezcl graphics timer memstats genmalloc dMallocPlus m)
target_link_libraries(clamr_gpucheck ${OPENCL_LIBRARIES})
if (REPROBLAS_FOUND)
target_link_libraries(clamr_gpucheck ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
if (MIC_NATIVE)
target_link_libraries(clamr_gpucheck iomp5 cilkrts)
endif (MIC_NATIVE)
add_dependencies(clamr_gpucheck state_kernel_source)
install(TARGETS clamr_gpucheck DESTINATION bin)
endif (OPENCL_FOUND)
########### clamr_mpicheck target ###############
if (MPI_FOUND)
set(clamr_mpicheck_CXX_SRCS clamr_mpicheck.cpp state.cpp input.cpp)
set(clamr_mpicheck_H_SRCS state.h input.h)
set(clamr_mpicheck_SRCS ${clamr_mpicheck_CXX_SRCS} ${clamr_mpicheck_C_SRCS} ${clamr_mpicheck_H_SRCS})
add_executable(clamr_mpicheck ${clamr_mpicheck_SRCS})
set_target_properties(clamr_mpicheck PROPERTIES COMPILE_DEFINITIONS HAVE_MPI)
target_link_libraries(clamr_mpicheck pPowerParser pmesh hsfc kdtree zorder pcrux hash pgraphics timer memstats l7 genmalloc pMallocPlus m)
if (REPROBLAS_FOUND)
target_link_libraries(clamr_mpicheck ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
if (LTTRACE_FOUND)
target_link_libraries(clamr_mpicheck ${LTTRACE_LIBRARIES})
endif (LTTRACE_FOUND)
if (MIC_NATIVE)
target_link_libraries(clamr_mpicheck iomp5 cilkrts)
endif (MIC_NATIVE)
target_link_libraries(clamr_mpicheck ${MPI_LIBRARIES})
install(TARGETS clamr_mpicheck DESTINATION bin)
endif (MPI_FOUND)
########### clamr_checkall target ###############
if (MPI_FOUND AND OPENCL_FOUND)
set(clamr_checkall_CXX_SRCS clamr_checkall.cpp state.cpp input.cpp)
set(clamr_checkall_H_SRCS state.h input.h)
set(clamr_checkall_SRCS ${clamr_checkall_CXX_SRCS} ${clamr_checkall_C_SRCS} ${clamr_checkall_H_SRCS})
add_executable(clamr_checkall ${clamr_checkall_SRCS})
set_target_properties(clamr_checkall PROPERTIES COMPILE_DEFINITIONS "HAVE_MPI;HAVE_OPENCL")
target_link_libraries(clamr_checkall dpmesh hsfc kdtree zorder pcrux dhash pezcl pgraphics timer memstats dl7 genmalloc dpMallocPlus m)
target_link_libraries(clamr_checkall ${OPENCL_LIBRARIES})
if (REPROBLAS_FOUND)
target_link_libraries(clamr_checkall ${REPROBLAS_LIBRARIES})
endif (REPROBLAS_FOUND)
if (LTTRACE_FOUND)
target_link_libraries(clamr_checkall ${LTTRACE_LIBRARIES})
endif (LTTRACE_FOUND)
if (MIC_NATIVE)
target_link_libraries(clamr_checkall iomp5 cilkrts)
endif (MIC_NATIVE)
target_link_libraries(clamr_checkall ${MPI_LIBRARIES})
add_dependencies(clamr_checkall state_kernel_source)
install(TARGETS clamr_checkall DESTINATION bin)
endif (MPI_FOUND AND OPENCL_FOUND)
########### install files ###############
if (OPENCL_FOUND)
set (CMAKE_CHECK_COMMAND "make ezcl_check &&")
else (OPENCL_FOUND)
set (CMAKE_CHECK_COMMAND "")
endif (OPENCL_FOUND)
set (CMAKE_CHECK_COMMAND ${CMAKE_CHECK_COMMAND}
make mesh_check &&
make l7_check &&
make MallocPlus_check &&
make PowerParser_check)
add_custom_target(check COMMAND ${CMAKE_CHECK_COMMAND})
set (CMAKE_DOC_COMMAND #make CLAMR_doc &&
make PowerParser_doc &&
make MallocPlus_doc &&
make L7_doc &&
make ezcl_doc &&
make genmalloc_doc &&
make Graphics_doc &&
make Hash_doc &&
make memstats_doc &&
make Mesh_doc &&
make Crux_doc)
add_custom_target(doc COMMAND ${CMAKE_DOC_COMMAND})
########### doc targets ################
#add_custom_target(CLAMR_doc
# DEPENDS CLAMR_pdfdoc CLAMR_htmldoc CLAMR_singlehtmldoc)
#set_target_properties(CLAMR_doc PROPERTIES EXCLUDE_FROM_ALL TRUE)
#
#add_custom_command(OUTPUT _build/latex/CLAMR.pdf
# COMMAND make -C docs latexpdf >& pdfdoc.out
# DEPENDS ${PDFDOC_SRCS})
#add_custom_target(CLAMR_pdfdoc DEPENDS _build/latex/CLAMR.pdf)
#set_target_properties(CLAMR_pdfdoc PROPERTIES EXCLUDE_FROM_ALL TRUE)
#
#add_custom_command(OUTPUT _build/html/UsersGuide.html
# COMMAND make -C docs html >& htmldoc.out
# DEPENDS ${DOC_SRCS})
#add_custom_target(CLAMR_htmldoc DEPENDS _build/html/UsersGuide.html)
#set_target_properties(CLAMR_htmldoc PROPERTIES EXCLUDE_FROM_ALL TRUE)
#
#add_custom_command(OUTPUT _build/singlehtml/index.html
# COMMAND make -C docs singlehtml >& singlehtmldoc.out
# DEPENDS ${DOC_SRCS})
#add_custom_target(CLAMR_singlehtmldoc DEPENDS _build/singlehtml/index.html)
#set_target_properties(CLAMR_singlehtmldoc PROPERTIES EXCLUDE_FROM_ALL TRUE)
########### configure config.h ################
# configure a header file to pass some of the CMake settings
# to the source code
# at bottom because we set things that change config above
configure_file ( "${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/config.h")
########### clean files ################
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "state_kernel.inc;clamr;clamr_cpuonly;clamr_gpuonly;clamr_mpionly;clamr_gpucheck;clamr_mpicheck;clamr_checkall;clamr_quo;total_execution_time.log;docs/_build;htmldoc.out;pdfdoc.out;singlehtmldoc.out")