forked from sandialabs/Albany
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
1296 lines (1168 loc) · 51.2 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
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
##*****************************************************************//
## Albany 3.0: Copyright 2016 Sandia Corporation //
## This Software is released under the BSD license detailed //
## in the file "license.txt" in the top-level Albany directory //
##*****************************************************************//
# CMAKE File for Albany building against an installed Trilinos
cmake_minimum_required(VERSION 2.7)
include(CMakeDependentOption)
OPTION (USE_NEW_POLICY_CMP0060 "Flag to turn on new behavior for policy CMP0060" OFF)
IF (USE_NEW_POLICY_CMP0060)
CMAKE_POLICY(SET CMP0060 NEW)
ENDIF()
if (NOT DEFINED SET_COMPILERS_AUTOMATICALLY)
set(SET_COMPILERS_AUTOMATICALLY TRUE)
endif()
if (NOT SET_COMPILERS_AUTOMATICALLY)
message("Experimental configuration.")
project(Albany CXX C Fortran)
endif ()
# Advertise that we support shared libs
SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
# Get Trilinos as one entity
IF (DEFINED ALBANY_TRILINOS_DIR)
SET(CMAKE_PREFIX_PATH ${ALBANY_TRILINOS_DIR} ${CMAKE_PREFIX_PATH})
ENDIF()
FIND_PACKAGE(Trilinos REQUIRED)
OPTION (ALBANY_SUPPRESS_TRILINOS_WARNINGS "Whether or not Trilinos headers should be treated as 'system' headers (hence, without issuing warnings)" OFF)
# Trilinos_BIN_DIRS probably should be defined in the Trilinos config. Until it is, set it here.
# This is needed to find SEACAS tools used during testing (epu, etc).
SET(Trilinos_BIN_DIRS "${Trilinos_DIR}/../../../bin")
SET(Trilinos_LIB_DIRS "${Trilinos_DIR}/../../../lib")
MESSAGE("\nFound Trilinos! Here are the details: ")
MESSAGE(" Trilinos_DIR = ${Trilinos_DIR}")
MESSAGE(" Trilinos_VERSION = ${Trilinos_VERSION}")
#MESSAGE(" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
#MESSAGE(" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
MESSAGE(" Trilinos_BIN_DIRS = ${Trilinos_BIN_DIRS}")
#MESSAGE(" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS}")
#MESSAGE(" Trilinos_LIBRARY_DIRS = ${Trilinos_LIBRARY_DIRS}")
MESSAGE(" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
#MESSAGE(" Trilinos_TPL_INCLUDE_DIRS = ${Trilinos_TPL_INCLUDE_DIRS}")
#MESSAGE(" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
MESSAGE(" Trilinos_TPL_LIBRARY_DIRS = ${Trilinos_TPL_LIBRARY_DIRS}")
MESSAGE(" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
MESSAGE(" Trilinos_CXX_COMPILER_FLAGS = ${Trilinos_CXX_COMPILER_FLAGS}")
MESSAGE("End of Trilinos details\n")
# Compress Trilinos lists that are used
#${Trilinos_INCLUDE_DIRS}
#${Trilinos_TPL_INCLUDE_DIRS}
#${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES} ${Trilinos_EXTRA_LD_FLAGS}
LIST(REVERSE Trilinos_INCLUDE_DIRS)
LIST(REMOVE_DUPLICATES Trilinos_INCLUDE_DIRS)
LIST(REVERSE Trilinos_INCLUDE_DIRS)
LIST(REVERSE Trilinos_TPL_INCLUDE_DIRS)
LIST(REMOVE_DUPLICATES Trilinos_TPL_INCLUDE_DIRS)
LIST(REVERSE Trilinos_TPL_INCLUDE_DIRS)
LIST(REVERSE Trilinos_LIBRARIES)
LIST(REMOVE_DUPLICATES Trilinos_LIBRARIES)
LIST(REVERSE Trilinos_LIBRARIES)
LIST(REVERSE Trilinos_TPL_LIBRARIES)
LIST(REMOVE_DUPLICATES Trilinos_TPL_LIBRARIES)
LIST(REVERSE Trilinos_TPL_LIBRARIES)
LIST(FIND Trilinos_PACKAGE_LIST STKClassic STKClassic_List_ID)
IF (STKClassic_List_ID GREATER -1)
MESSAGE(FATAL_ERROR "STKClassic is no longer used and conflicts with STKIo and STKMesh.")
ENDIF()
# Optional Installation helpers
# Note that some of this functionality depends on CMAKE > 2.8.8
SET (INSTALL_ALBANY FALSE CACHE BOOL "Whether Albany should be installed")
IF (INSTALL_ALBANY)
IF (${CMAKE_VERSION} VERSION_GREATER 2.8.8 OR ${CMAKE_VERSION} VERSION_EQUAL 2.8.8)
MESSAGE("")
MESSAGE("Installation files for Albany will be created")
MESSAGE("-- install location = ${CMAKE_INSTALL_PREFIX}")
MESSAGE("")
set(BINARY_INSTALL_DIR bin)
set(INCLUDE_INSTALL_DIR include)
set(LIB_INSTALL_DIR lib)
include(CMakePackageConfigHelpers)
ELSE()
MESSAGE("")
MESSAGE("Installation has been requested, but cannot continue")
MESSAGE("-- Please upgrade CMAKE to version >= 2.8.8")
MESSAGE("")
ENDIF()
ENDIF()
option (ENABLE_CROSS_COMPILE "Flag to turn on cross-compiling tools" OFF)
if (ENABLE_CROSS_COMPILE)
set (Albany_CROSS_COMPILE ON)
message ("Building with cross-compiling tools.")
else ()
set (Albany_CROSS_COMPILE OFF)
endif ()
if (SET_COMPILERS_AUTOMATICALLY)
MESSAGE("Setting and checking of compilers:")
if (Albany_CROSS_COMPILE)
# Force the compilers to be the same as Trilinos (GAH experimental)
# This syntax is needed when cross compiling or the compilers get checked
# again by the Albany configure, and will probably fail, because the options
# won't be right and the exes won't run on the host.
INCLUDE (CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME Generic)
CMAKE_FORCE_CXX_COMPILER(${Trilinos_CXX_COMPILER} Generic)
CMAKE_FORCE_C_COMPILER(${Trilinos_C_COMPILER} Generic)
CMAKE_FORCE_Fortran_COMPILER(${Trilinos_Fortran_COMPILER} Generic)
# SET(CMAKE_SYSTEM_NAME ${Trilinos_SYSTEM_NAME})
# CMAKE_FORCE_CXX_COMPILER(${Trilinos_CXX_COMPILER} ${Trilinos_CXX_COMPILER_ID})
# CMAKE_FORCE_C_COMPILER(${Trilinos_C_COMPILER} ${Trilinos_C_COMPILER_ID})
# CMAKE_FORCE_Fortran_COMPILER(${Trilinos_Fortran_COMPILER} ${Trilinos_Fortran_COMPILER_ID})
# SET(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES ${Trilinos_Fortran_IMPLICIT_LINK_LIBRARIES})
else ()
set (CMAKE_CXX_COMPILER ${Trilinos_CXX_COMPILER})
set (CMAKE_C_COMPILER ${Trilinos_C_COMPILER})
set (CMAKE_Fortran_COMPILER ${Trilinos_Fortran_COMPILER})
endif ()
else()
# Make sure the compilers match.
MESSAGE("Checking compilers:")
IF(NOT ${Trilinos_CXX_COMPILER} STREQUAL ${CMAKE_CXX_COMPILER})
MESSAGE(FATAL_ERROR "C++ compilers don't match (Trilinos: ${Trilinos_CXX_COMPILER}, ${PROJECT_NAME}: ${CMAKE_CXX_COMPILER}).")
ENDIF()
IF(NOT ${Trilinos_C_COMPILER} STREQUAL ${CMAKE_C_COMPILER})
MESSAGE(FATAL_ERROR "C compilers don't match (Trilinos: ${Trilinos_C_COMPILER}, ${PROJECT_NAME}: ${CMAKE_C_COMPILER}).")
ENDIF()
IF(NOT ${Trilinos_Fortran_COMPILER} STREQUAL ${CMAKE_Fortran_COMPILER})
MESSAGE(FATAL_ERROR "Fortran compilers don't match (Trilinos: ${Trilinos_Fortran_COMPILER}, ${PROJECT_NAME}: ${CMAKE_Fortran_COMPILER}).")
ENDIF()
SET(Trilinos_CXX_COMPILER_ID ${CMAKE_CXX_COMPILER_ID})
SET(Trilinos_C_COMPILER_ID ${CMAKE_C_COMPILER_ID})
SET(Trilinos_Fortran_COMPILER_ID ${CMAKE_Fortran_COMPILER_ID})
endif()
# Build Albany as shared libraries if Trilinos was compiled that way
IF(Trilinos_BUILD_SHARED_LIBS)
SET(Albany_LIBRARY_TYPE SHARED)
SET(BUILD_SHARED_LIBS ON)
MESSAGE("-- Building Albany with shared libraries")
ELSE(Trilinos_BUILD_SHARED_LIBS)
SET(Albany_LIBRARY_TYPE STATIC)
ENDIF(Trilinos_BUILD_SHARED_LIBS)
OPTION(Albany_BUILD_STATIC_EXE "Flag to turn on building of static executables in Albany" OFF)
IF((NOT BUILD_SHARED_LIBS) AND (Albany_BUILD_STATIC_EXE))
MESSAGE("-- Building Albany with static executables")
ENDIF((NOT BUILD_SHARED_LIBS) AND (Albany_BUILD_STATIC_EXE))
# Option to turn on and off deprecation warnings
OPTION(Albany_DEPRECATED_DECLARATIONS "Flag to turn on warnings for deprecated code" ON)
IF (Albany_DEPRECATED_DECLARATIONS)
SET(ALBANY_ENABLE_DEPRECATED ON)
MESSAGE("-- Deprecated code warnings Enabled, compiling with -DALBANY_ENABLE_DEPRECATED")
ELSE()
MESSAGE("-- Deprecated code warnings are NOT Enabled.")
ENDIF()
# End of setup and error checking
# NOTE: PROJECT command checks for compilers, so this statement
# is moved AFTER setting CMAKE_CXX_COMPILER from Trilinos
if (SET_COMPILERS_AUTOMATICALLY)
PROJECT(Albany)
endif()
# AGS: Adding these lines so Ctest can be run to submit to cdash dashboard
# Uses CTestConfig.cmake file for Cdash info.
ENABLE_TESTING()
INCLUDE(CTest)
set(ALBANY_ENABLE_FORTRAN ON CACHE BOOL "enable fortran" )
IF (CMAKE_Fortran_COMPILER AND ALBANY_ENABLE_FORTRAN) # Enable Fortran if it is enabled in Trilinos.
ENABLE_LANGUAGE(Fortran)
ENDIF()
# Make Albany inherit Trilinos compiler flags. The most important are the
# presence or absence of -NDEBUG (which can affect linking for complicated
# reasons) and -std=c++11.
SET(CMAKE_CXX_FLAGS "${Trilinos_CXX_COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}")
# GAH - temporarily set Albany flags for clang debugging
#SET(CMAKE_CXX_FLAGS "-ggdb -std=c++11 -O2 -march=native -DNDEBUG")
if (SET_COMPILERS_AUTOMATICALLY)
SET(CMAKE_AR ${Trilinos_AR})
SET(CMAKE_LINKER ${Trilinos_LINKER})
endif()
MESSAGE("-- Using ${Trilinos_CXX_COMPILER_ID} Compiler.")
# No longer needed but keep for now as this shows how to silence specific warnings on Intel compiler
#IF(${Trilinos_CXX_COMPILER_ID} MATCHES "Intel")
# SET(USING_INTEL TRUE)
# On Intel, turn of interprocedural optimization at linking to keep linker from hanging
# This could possibly be removed with further study (GAH)
# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-ip")
# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd2536,2196,858,488,161,47")
#ENDIF()
## Check for some required Trilinos package dependencies (Piro, Phalanx) ##
MESSAGE("\nChecking Trilinos build for required and optional packages:")
SET(ALBANY_REQUIRED_TRILINOS_PACKAGES
Piro
Phalanx
NOX
ThyraTpetraAdapters
Intrepid2
MiniTensor
)
foreach(package IN LISTS ALBANY_REQUIRED_TRILINOS_PACKAGES)
LIST(FIND Trilinos_PACKAGE_LIST "${package}" ${package}_List_ID)
IF (${package}_List_ID GREATER -1)
MESSAGE("-- Found ${package}, a required Trilinos package for Albany.")
ELSE()
MESSAGE("-- FATAL ERROR: Did not find ${package} package in Trilinos Installation.")
MESSAGE(FATAL_ERROR "-- Configure Trilinos with guidance from trilinos-cmake script in doc directory.")
ENDIF()
endforeach()
### Check for some OPTIONAL trilinos packages, which set DEFINES in Alany build ###
# MPI check -- defaults to TRUE
# MESSAGE("-- Checking if MPI is enabled in Trilinos:")
LIST(FIND Trilinos_TPL_LIST MPI MPI_List_ID)
IF (MPI_List_ID GREATER -1)
MESSAGE("-- Looking for MPI in Trilinos: Found, compiling with -DALBANY_MPI")
SET(ALBANY_MPI TRUE)
ELSE()
MESSAGE("-- Looking for MPI in Trilinos: NOT found, MPI NOT ENABLED!")
SET(ALBANY_MPI FALSE)
ENDIF()
# set optional dependency on stk
LIST(FIND Trilinos_PACKAGE_LIST STK have_stk_List_ID)
IF (have_stk_List_ID GREATER -1)
MESSAGE("-- Looking for STK: Found, compiling with -DALBANY_STK")
SET(ALBANY_STK TRUE)
# set optional dependency on SEACAS, for I/O via stk_io
# MESSAGE("-- Looking for SEACAS:")
LIST(FIND Trilinos_PACKAGE_LIST SEACASIoss SEACASIoss_List_ID)
IF (SEACASIoss_List_ID GREATER -1)
MESSAGE("---- Looking for SEACASIoss: Found, compiling with -DALBANY_SEACAS")
SET(ALBANY_SEACAS TRUE)
LIST(FIND SEACASIoss_LIBRARIES Iopx Iopx_List_ID)
IF (Iopx_List_ID GREATER -1)
MESSAGE("---- Looking for Iopx: Found")
SET(ALBANY_IOPX TRUE)
ELSE()
MESSAGE("---- Looking for Iopx: NOT found.")
SET(ALBANY_IOPX FALSE)
ENDIF()
ELSE()
MESSAGE("---- Looking for SEACASIoss: NOT found.")
SET(ALBANY_SEACAS FALSE)
ENDIF()
# set optional dependency on stk_percept, for uniform adaptivity
LIST(FIND Trilinos_LIBRARIES stk_percept stk_percept_List_ID)
IF (stk_percept_List_ID GREATER -1)
MESSAGE("---- Looking for stk_percept: Found, compiling with -DALBANY_STK_PERCEPT")
SET(ALBANY_STK_PERCEPT TRUE)
ELSE()
MESSAGE("---- Looking for stk_percept: NOT found.")
SET(ALBANY_STK_PERCEPT FALSE)
ENDIF()
ELSE()
MESSAGE("-- Looking for STK: NOT found.")
SET(ALBANY_STK FALSE)
ENDIF()
# set optional dependency on Panzer's ExprEval subpackage
LIST (FIND Trilinos_PACKAGE_LIST PanzerExprEval PanzerExprEval_List_ID)
IF (PanzerExprEval_List_ID GREATER -1)
MESSAGE("-- Looking for PanzerExprEval: Found, compiling with -DALBANY_PANZER_EXPR_EVAL")
SET(ALBANY_PANZER_EXPR_EVAL TRUE)
ELSE ()
MESSAGE("-- Looking for PanzerExprEval: NOT found.")
SET(ALBANY_PANZER_EXPR_EVAL FALSE)
ENDIF()
# set optional dependency on Zoltan, for partitioning
# MESSAGE("-- Looking for Zoltan:")
LIST(FIND Trilinos_PACKAGE_LIST Zoltan Zoltan_List_ID)
IF (Zoltan_List_ID GREATER -1)
SET(ALBANY_ZOLTAN TRUE)
IF(ALBANY_STK)
SET(ALBANY_STK_REBALANCE TRUE)
MESSAGE("-- Looking for Zoltan: Found, compiling with -DALBANY_ZOLTAN -DALBANY_STK_REBALANCE")
ELSE()
SET(ALBANY_STK_REBALANCE FALSE)
MESSAGE("-- Looking for Zoltan: Found, compiling with -DALBANY_ZOLTAN")
ENDIF()
ELSE()
MESSAGE("-- Looking for Zoltan: NOT found.")
SET(ALBANY_ZOLTAN FALSE)
SET(ALBANY_STK_REBALANCE FALSE)
ENDIF()
# set optional dependency on Amesos2, for solving and preconditioning
LIST(FIND Trilinos_PACKAGE_LIST Amesos2 Amesos2_List_ID)
IF (Amesos2_List_ID GREATER -1)
MESSAGE("-- Looking for Amesos2: Found, compiling with -DALBANY_AMESOS2")
SET(ALBANY_AMESOS2 TRUE)
# We can't rely on Amesos2_TPL_LIST any longer; KLU2 and Basker are not
# TPLs. These will soon be enabled by default in Amesos2. So we'll just
# assume we have a coarse direct solver.
SET(ALBANY_AMESOS2_OPERATIONAL_SOLVER TRUE)
ELSE()
MESSAGE("-- Looking for Amesos2: NOT found.")
SET(ALBANY_AMESOS2 FALSE)
SET(ALBANY_AMESOS2_OPERATIONAL_SOLVER FALSE)
ENDIF()
# set optional dependency on Ifpack2, for preconditioning
LIST(FIND Trilinos_PACKAGE_LIST Ifpack2 Ifpack2_List_ID)
IF (Ifpack2_List_ID GREATER -1)
MESSAGE("-- Looking for Ifpack2: Found, compiling with -DALBANY_IFPACK2")
SET(ALBANY_IFPACK2 TRUE)
ELSE()
MESSAGE("-- Looking for Ifpack2: NOT found.")
SET(ALBANY_IFPACK2 FALSE)
ENDIF()
# set optional dependency on Teko, for preconditioning
LIST(FIND Trilinos_PACKAGE_LIST Teko Teko_List_ID)
IF (Teko_List_ID GREATER -1)
MESSAGE("-- Looking for Teko: Found, compiling with -DALBANY_TEKO")
SET(ALBANY_TEKO TRUE)
ELSE()
MESSAGE("-- Looking for Teko: NOT found.")
SET(ALBANY_TEKO FALSE)
ENDIF()
# set optional dependency on MueLu, for preconditioning
LIST(FIND Trilinos_PACKAGE_LIST MueLu MueLu_List_ID)
IF (MueLu_List_ID GREATER -1)
MESSAGE("-- Looking for MueLu: Found, compiling with -DALBANY_MUELU")
SET(ALBANY_MUELU TRUE)
LIST(FIND MueLu_PACKAGE_LIST Ifpack2 MueLu_Ifpack2_List_ID)
LIST(FIND MueLu_PACKAGE_LIST Amesos2 MueLu_Amesos2_List_ID)
IF ((MueLu_Ifpack2_List_ID GREATER -1) AND (MueLu_Amesos2_List_ID GREATER -1) AND ALBANY_AMESOS2_OPERATIONAL_SOLVER)
MESSAGE("---- MueLu tests enabled")
SET(ALBANY_MUELU_EXAMPLES TRUE)
ELSE()
MESSAGE("---- MueLu tests NOT enabled. Ifpack2 and Amesos2 compiled with an operational solver are required.")
SET(ALBANY_MUELU_EXAMPLES FALSE)
ENDIF()
ELSE()
MESSAGE("-- Looking for MueLu: NOT found.")
SET(ALBANY_MUELU FALSE)
SET(ALBANY_MUELU_EXAMPLES FALSE)
ENDIF()
LIST(FIND Trilinos_PACKAGE_LIST Rythmos Rythmos_List_ID)
IF (Rythmos_List_ID GREATER -1)
MESSAGE("-- Looking for Rythmos: Found, compiling with -DALBANY_RYTHMOS")
SET(ALBANY_RYTHMOS TRUE)
ELSE()
MESSAGE("-- Looking for Rythmos: NOT found.")
SET(ALBANY_RYTHMOS FALSE)
ENDIF()
# Set optional build of only Albany (Epetra) executable.
# Be default, it will be on, so both the Albany and AlbanyT executables will
# be built in the Tpetra Albany branch. The idea is ultimately you'll
# be able to build only the AlbanyT executable in which case Epetra will not
# be needed at all in the Trilinos. This will be accomplished by ifdef'ing
# out all the Epetra stuff
OPTION(ENABLE_ALBANY_EPETRA_EXE "Flag to turn on building of Albany Epetra Executable" ON)
IF (ENABLE_ALBANY_EPETRA_EXE)
MESSAGE("-- ALBANY_EPETRA_EXE is Enabled, compiling with -DALBANY_EPETRA")
SET(ALBANY_EPETRA TRUE)
# DAKOTA uses Epetra currently
LIST(FIND Trilinos_PACKAGE_LIST TriKota TriKota_List_ID)
IF (TriKota_List_ID GREATER -1)
MESSAGE("-- Looking for Dakota via TriKota: Found, compiling with -DALBANY_DAKOTA")
SET(ALBANY_DAKOTA TRUE)
ELSE()
MESSAGE("-- Looking for Dakota via TriKota: NOT found.")
SET(ALBANY_DAKOTA FALSE)
ENDIF()
ELSE()
MESSAGE("-- ALBANY_EPETRA_EXE is NOT Enabled.")
SET(ALBANY_EPETRA FALSE)
SET(ALBANY_DAKOTA FALSE)
ENDIF()
# Check for optional physics sets in Albany
MESSAGE("\nChecking which Albany physics sets are enabled:")
# set optional dependency on demoPDEs, defaults to Enabled
OPTION(ENABLE_DEMO_PDES "Flag to turn on demonstration PDEs problems" ON)
IF (ENABLE_DEMO_PDES)
MESSAGE("-- DEMO_PDES is Enabled, compiling with -DALBANY_DEMO_PDES")
SET(ALBANY_DEMO_PDES TRUE)
ELSE()
MESSAGE("-- DEMO_PDES is NOT Enabled.")
SET(ALBANY_DEMO_PDES FALSE)
ENDIF()
# Check if Trilinos has ROL
LIST(FIND Trilinos_PACKAGE_LIST ROL ROL_List_ID)
IF (ROL_List_ID GREATER -1)
MESSAGE("-- Looking for ROL in Trilinos: Found, compiling with -DALBANY_ROL")
SET(ALBANY_ROL TRUE)
ELSE()
MESSAGE("-- Looking for ROL in Trilinos: NOT found.")
SET(ALBANY_ROL FALSE)
ENDIF()
# Check for the presence of MiniTensor for LCM, SCOREC, and ATO builds.
# Lets catch this missing option at Albany configure time and not during the compile.
#
SET(ALBANY_MINITENSOR FALSE)
IF (EXISTS "${Trilinos_INCLUDE_DIRS}/MiniTensor.h")
MESSAGE("-- Looking for MiniTensor package in Trilinos: Found ...")
SET(ALBANY_MINITENSOR TRUE)
ENDIF()
IF (NOT ALBANY_MINITENSOR)
IF (ENABLE_LCM OR ENABLE_ATO OR ENABLE_SCOREC)
MESSAGE(FATAL_ERROR "Trilinos was not built with MiniTensor enabled - it is required for LCM, SCOREC, and ATO.")
ENDIF()
ENDIF()
# set optional dependency on LCM, defaults to Disabled
OPTION(ENABLE_LCM "Flag to turn on LCM Mechanics source code" OFF)
OPTION(ENABLE_LCM_TEST_EXES "Flag to turn on LCM Mechanics test executables" ON)
SET(LCM_TEST_EXES FALSE)
IF (ENABLE_LCM)
IF (NOT ALBANY_MINITENSOR)
MESSAGE(FATAL_ERROR
"LCM enabled but MiniTensor not installed from Trilinos (LCM needs MiniTensor)")
ENDIF()
IF (NOT ALBANY_ROL)
MESSAGE(FATAL_ERROR
"LCM enabled but ROL not installed from Trilinos (LCM needs ROL)")
ENDIF()
MESSAGE("-- LCM is Enabled, compiling with -DALBANY_LCM")
SET(ALBANY_LCM TRUE)
IF (ENABLE_LCM_TEST_EXES AND ALBANY_STK) # Need STK for the EXES
SET(LCM_TEST_EXES TRUE)
ENDIF()
ELSE()
MESSAGE("-- LCM is NOT Enabled.")
SET(ALBANY_LCM FALSE)
ENDIF()
# Check if Trilinos has DTK
LIST(FIND Trilinos_PACKAGE_LIST DataTransferKit DataTransferKit_List_ID)
IF (DataTransferKit_List_ID GREATER -1)
MESSAGE("-- Looking for DTK in Trilinos: Found, compiling with -DALBANY_DTK")
SET(ALBANY_DTK TRUE)
ELSE()
MESSAGE("-- Looking for DTK in Trilinos: NOT found.")
SET(ALBANY_DTK FALSE)
ENDIF()
# Check if Trilinos has Tempus
LIST(FIND Trilinos_PACKAGE_LIST Tempus Tempus_List_ID)
IF (Tempus_List_ID GREATER -1)
MESSAGE("-- Looking for Tempus in Trilinos: Found, compiling with -DALBANY_TEMPUS")
SET(ALBANY_TEMPUS TRUE)
ELSE()
MESSAGE("-- Looking for Tempus in Trilinos: NOT found.")
IF (ENABLE_LCM)
MESSAGE(FATAL_ERROR
"LCM enabled but Tempus not installed from Trilinos (LCM needs Tempus)! Please recompile Trilinos with Tempus enabled.")
ENDIF()
SET(ALBANY_TEMPUS FALSE)
ENDIF()
# set optional dependency on MPMD, defaults to Disabled
OPTION(ENABLE_MPMD "Flag to turn on MPMD source code" OFF)
IF (ENABLE_MPMD)
SET(ALBANY_MPMD TRUE)
ENDIF()
# set optional dependency on ATO, defaults to Disabled
OPTION(ENABLE_ATO "Flag to turn on ATO source code" OFF)
OPTION(ENABLE_ATO_SOLVER_EPETRA "Flag to turn on ATO::SolverEpetra code" OFF)
IF (ENABLE_ATO)
MESSAGE("-- ATO is Enabled, compiling with -DALBANY_ATO")
SET(ALBANY_ATO TRUE)
IF (NOT ENABLE_LCM)
SET(ENABLE_LCM TRUE)
MESSAGE("-- ATO requires LCM... compiling with -DALBANY_LCM")
SET(ALBANY_LCM TRUE)
ENDIF()
IF (ENABLE_ALBANY_EPETRA_EXE)
IF (ENABLE_ATO_SOLVER_EPETRA)
SET(ALBANY_ATO_SOLVER_EPETRA TRUE)
MESSAGE("-- ATO_SOLVER_EPETRA is Enabled.")
ELSE()
MESSAGE("-- ATO_SOLVER_EPETRA is disabled.")
ENDIF()
ELSE()
MESSAGE("-- ATO_SOLVER_EPETRA is disabled.")
MESSAGE("-- WARNING: ATO was set to be Enabled but does not work fully yet with AlbanyT executable yet! Use at your own risk!")
ENDIF()
IF (ENABLE_ISOLIB)
SET(ATO_USES_ISOLIB TRUE)
ENDIF()
IF (ENABLE_DOTK)
SET(ATO_USES_DOTK TRUE)
ENDIF()
IF (ENABLE_NLopt)
SET(ATO_USES_NLOPT TRUE)
ENDIF()
IF (ENABLE_Cogent)
SET(ATO_USES_COGENT TRUE)
ENDIF()
ELSE()
MESSAGE("-- ATO is NOT Enabled.")
SET(ALBANY_ATO FALSE)
ENDIF()
# set optional dependency on Peridigm peridynamics code, defaults to Disabled
OPTION(ENABLE_PERIDIGM "Flag to turn on Albany-Peridigm code coupling" OFF)
IF(ENABLE_PERIDIGM)
IF(ENABLE_ALBANY_EPETRA_EXE)
SET(CMAKE_PREFIX_PATH ${PERIDIGM_DIR} ${CMAKE_PREFIX_PATH})
FIND_PACKAGE(Peridigm REQUIRED)
MESSAGE("\nFound Peridigm! Here are the details: ")
MESSAGE(" Peridigm_DIR = ${Peridigm_DIR}")
MESSAGE(" Peridigm_LIBRARIES = ${Peridigm_LIBRARIES}")
MESSAGE(" Peridigm_INCLUDE_DIRS = ${Peridigm_INCLUDE_DIRS}")
MESSAGE(" Peridigm_LIBRARY_DIRS = ${Peridigm_LIBRARY_DIRS}")
MESSAGE("End of Peridigm details\n")
SET(ALBANY_PERIDIGM TRUE)
MESSAGE("-- PERIDIGM is Enabled, compiling with -DALBANY_PERIDIGM")
ELSE()
MESSAGE(FATAL_ERROR "\nError: ENABLE_PERIDIGM requires ENABLE_ALBANY_EPETRA_EXE to be ON\n")
ENDIF()
ELSE()
MESSAGE("-- PERIDIGM is NOT Enabled.")
SET(ALBANY_PERIDIGM FALSE)
ENDIF()
# Set optional build of LandIce (Land Ice SciDAC project), defaults to Disabled
OPTION(ENABLE_LANDICE "Flag to turn on LandIce Source code" OFF)
IF (ENABLE_LANDICE)
MESSAGE("-- LandIce is Enabled, compiling with -DALBANY_LANDICE")
SET(ALBANY_LANDICE TRUE)
ELSE()
MESSAGE("-- LandIce is NOT Enabled.")
SET(ALBANY_LANDICE FALSE)
ENDIF()
# Set optional build of CISM Interface for LandIce (Land Ice SciDAC project),
# defaults to Disabled
OPTION(ENABLE_CISM_INTERFACE "Flag to turn on LandIce Interface to the CISM code" OFF)
OPTION(ENABLE_CISM_REDUCED_COMM "Flag to turn on reduced communicator for CISM-Albany runs" ON)
OPTION(ENABLE_CISM_EPETRA "Flag to turn on Epetra for CISM-Albany" OFF)
OPTION(ENABLE_CISM_CHECK_COMPARISONS "Flag to turn on comparisons checking for CISM-Albany" OFF)
IF (ENABLE_CISM_INTERFACE AND ENABLE_LANDICE)
SET(CISM_HAS_LANDICE TRUE)
IF (ENABLE_CISM_CHECK_COMPARISONS)
SET(CISM_CHECK_COMPARISONS TRUE)
MESSAGE("---> CISM_CHECK_COMPARISONS is Enabled, compiling with -DCISM_CHECK_COMPARISONS. Error will be thrown if comparisons fail for CISM-Albany run.")
ELSE()
MESSAGE("---> CISM_CHECK_COMPARISONS is Disabled, NOT compiling with -DCISM_CHECK_COMPARISONS. Error will NOT be thrown if comparisons fail for CISM-Albany run. Please be cautious when running ctest from CISM!")
ENDIF()
IF (ENABLE_CISM_REDUCED_COMM)
SET(REDUCED_COMM TRUE)
MESSAGE("---> CISM_REDUCED_COMM is Enabled, compiling with -DREDUCED_COMM. CISM-Albany will use reduced communicator.")
ENDIF()
IF (ENABLE_ALBANY_EPETRA_EXE)
SET(CISM_USE_EPETRA TRUE)
IF (ENABLE_CISM_EPETRA)
MESSAGE("---> CISM_EPETRA is Enabled, compiling with -DCISM_USE_EPETRA. CISM-Albany will run with Epetra software stack.")
ELSE()
MESSAGE("---> CISM_EPETRA is Disabled, NOT compiling with -DCISM_USE_EPETRA. CISM-Albany will run with Tpetra software stack.")
ENDIF()
ELSE()
MESSAGE("---> CISM_EPETRA is Disabled, NOT compiling with -DCISM_USE_EPETRA. CISM-Albany will run with Tpetra software stack.")
ENDIF()
IF (ENABLE_LCM OR ENABLE_LAME OR ENABLE_DEMO_PDES)
MESSAGE("-- WARNING: cism_driver will not link properly when built if
Albany was built with LCM, LAME, or ENABLE_DEMO_PDES. Turn these off to build
cism_driver.")
ENDIF ()
MESSAGE("---> CISM_INTERFACE is Enabled, compiling with -DCISM_HAS_LANDICE")
SET(CISM_HAS_LANDICE TRUE)
IF (NOT CISM_INCLUDE_DIR)
MESSAGE("\nError: CISM_INCLUDE_DIR not defined\n")
ELSE()
MESSAGE("---> CISM_INCLUDE_DIR ${CISM_INCLUDE_DIR}")
ENDIF()
IF (NOT CISM_EXE_DIR)
MESSAGE("\n CISM_EXE_DIR not defined. CismAlbany test will not run.\n")
ELSE()
MESSAGE("---> CISM_EXE_DIR ${CISM_EXE_DIR}")
ENDIF()
ELSEIF(ENABLE_CISM_INTERFACE AND (NOT ENABLE_LANDICE))
MESSAGE(FATAL_ERROR "\nError: ENABLE_CISM_INTERFACE requires ENABLE_LANDICE
to be ON\n")
ELSE()
MESSAGE("---> CISM_INTERFACE is NOT Enabled.")
SET(CISM_HAS_LANDICE FALSE)
ENDIF()
OPTION(ENABLE_TSUNAMI "Flag to turn on TSUNAMI Source code" OFF)
IF (ENABLE_TSUNAMI)
MESSAGE("-- TSUNAMI is Enabled, compiling with -DALBANY_TSUNAMI")
SET(ALBANY_TSUNAMI TRUE)
ELSE()
MESSAGE("-- TSUNAMI is NOT Enabled.")
SET(ALBANY_TSUNAMI FALSE)
ENDIF()
# set optional dependency of mesh on parameters, defaults to Disabled
OPTION(ENABLE_MESH_DEPENDS_ON_PARAMETERS "Flag to turn on dependency of mesh on parameters, e.g for shape optimization" OFF)
IF (ENABLE_MESH_DEPENDS_ON_PARAMETERS)
MESSAGE("-- MESH_DEPENDS_ON_PARAMETERS is Enabled, compiling with -DALBANY_MESH_DEPENDS_ON_PARAMETERS")
SET(ALBANY_MESH_DEPENDS_ON_PARAMETERS TRUE)
ELSE()
MESSAGE("-- MESH_DEPENDS_ON_PARAMETERS is NOT Enabled.")
SET(ALBANY_MESH_DEPENDS_ON_PARAMETERS FALSE)
ENDIF()
# set optional dependency of mesh on solution, defaults to Disabled
OPTION(ENABLE_MESH_DEPENDS_ON_SOLUTION "Flag to turn on dependency of mesh on solution" OFF)
IF (ENABLE_MESH_DEPENDS_ON_SOLUTION)
MESSAGE("-- MESH_DEPENDS_ON_SOLUTION is Enabled, compiling with -DALBANY_MESH_DEPENDS_ON_SOLUTION")
SET(ALBANY_MESH_DEPENDS_ON_SOLUTION TRUE)
ELSE()
MESSAGE("-- MESH_DEPENDS_ON_SOLUTION is NOT Enabled.")
SET(ALBANY_MESH_DEPENDS_ON_SOLUTION FALSE)
ENDIF()
# set optional dependency of dist parameters on solution, defaults to Disabled
OPTION(ENABLE_PARAMETERS_DEPEND_ON_SOLUTION "Flag to turn on dependency of mesh on solution" OFF)
IF (ENABLE_PARAMETERS_DEPEND_ON_SOLUTION)
MESSAGE("-- PARAMETERS_DEPEND_ON_SOLUTION is Enabled, compiling with -DALBANY_PARAMETERS_DEPEND_ON_SOLUTION")
SET(ALBANY_PARAMETERS_DEPEND_ON_SOLUTION TRUE)
ELSEIF (ENABLE_MESH_DEPENDS_ON_SOLUTION)
MESSAGE("-- PARAMETERS_DEPEND_ON_SOLUTION is Enabled because MESH_DEPENDS_ON_SOLUTION is enabled, compiling with -DALBANY_PARAMETERS_DEPEND_ON_SOLUTION")
SET(ALBANY_PARAMETERS_DEPEND_ON_SOLUTION TRUE)
ELSE()
MESSAGE("-- PARAMETERS_DEPEND_ON_SOLUTION is NOT Enabled.")
SET(ALBANY_PARAMETERS_DEPEND_ON_SOLUTION FALSE)
ENDIF()
# Set optional build of MPAS Interface for LandIce (Land Ice SciDAC project),
# defaults to Disabled
OPTION(ENABLE_MPAS_INTERFACE "Flag to turn on LandIce Source code" OFF)
IF (ENABLE_MPAS_INTERFACE AND ENABLE_LANDICE)
IF (ENABLE_ALBANY_EPETRA_EXE)
IF (ENABLE_MPAS_EPETRA)
SET(MPAS_USE_EPETRA TRUE)
MESSAGE("---> MPAS_EPETRA is Enabled, compiling with -DMPAS_USE_EPETRA. MPAS-Albany will run with Epetra software stack.")
ELSE()
MESSAGE("---> MPAS_EPETRA is Disabled, NOT compiling with -DMPAS_USE_EPETRA. MPAS-Albany will run with Tpetra software stack.")
ENDIF()
ENDIF()
MESSAGE("-- MPAS_INTERFACE is Enabled, compiling with -DMPAS_HAS_LANDICE")
SET(MPAS_HAS_LANDICE TRUE)
ELSEIF(ENABLE_MPAS_INTERFACE AND (NOT ENABLE_LANDICE))
MESSAGE(FATAL_ERROR "\nError: ENABLE_MPAS_INTERFACE requires ENABLE_LANDICE
to be ON\n")
ELSE()
MESSAGE("---> MPAS_INTERFACE is NOT Enabled.")
SET(MPAS_HAS_LANDICE FALSE)
ENDIF()
# set optional dependency of mesh on parameters, defaults to Disabled
OPTION(ENABLE_USE_CISM_FLOW_PARAMETERS "Flag to use the parameters of Glen's law used by Cism" ON)
IF (ENABLE_USE_CISM_FLOW_PARAMETERS)
MESSAGE("-- USE_CISM_FLOW_PARAMETERS is Enabled, compiling with -DUSE_CISM_FLOW_PARAMETERS.")
SET(USE_CISM_FLOW_PARAMETERS TRUE)
ELSE()
SET(USE_CISM_FLOW_PARAMETERS FALSE)
ENDIF()
# Set optional build of Aeras (Atmosphere Dynamics LDRD), defaults to Disabled
OPTION(ENABLE_AERAS "Flag to turn on Aeras Source code" OFF)
OPTION(ENABLE_AERAS_IMPLICIT_HS "Flag to turn on implicit time-int scheme for Aeras hydrostatic Source code" OFF)
IF (ENABLE_AERAS)
MESSAGE("-- Aeras is Enabled, compiling with -DALBANY_AERAS")
SET(ALBANY_AERAS TRUE)
IF (ENABLE_AERAS_IMPLICIT_HS)
MESSAGE("-- Aeras implicit hydrostatic is Enabled, compiling with -DAERAS_IMPLICIT_HS")
SET(AERAS_IMPLICIT_HS TRUE)
ELSE()
MESSAGE("-- Aeras implicit hydrostatic is NOT Enabled")
SET(AERAS_IMPLICIT_HS FALSE)
ENDIF()
ELSE()
MESSAGE("-- Aeras is NOT Enabled.")
SET(ALBANY_AERAS FALSE)
ENDIF()
# optional dependency on LAME, defaults to FALSE
OPTION(ENABLE_LAME "Flag to turn on LAME material library source code" OFF)
IF(ENABLE_LAME)
MESSAGE("-- LAME is enabled, compiling with -DALBANY_LAME")
SET(ALBANY_LAME TRUE)
# The Sierra math toolkit is needed for LAME
IF(NOT MATH_TOOLKIT_INCLUDE_DIR)
MESSAGE("\nError: MATH_TOOLKIT_INCLUDE_DIR not defined\n")
ELSE()
MESSAGE("-- MATH_TOOLKIT_INCLUDE_DIR ${MATH_TOOLKIT_INCLUDE_DIR}")
ENDIF()
IF(NOT MATH_TOOLKIT_LIBRARY_DIR)
MESSAGE("\nError: MATH_TOOLKIT_LIBRARY_DIR not defined\n")
ELSE()
MESSAGE("-- MATH_TOOLKIT_LIBRARY_DIR ${MATH_TOOLKIT_LIBRARY_DIR}")
ENDIF()
# LAME itself
IF(NOT LAME_INCLUDE_DIR)
MESSAGE("\nError: LAME_INCLUDE_DIR not defined\n")
ELSE()
MESSAGE("-- LAME_INCLUDE_DIR ${LAME_INCLUDE_DIR}")
ENDIF()
IF(NOT LAME_LIBRARY_DIR)
MESSAGE("\nError: LAME_LIBRARY_DIR not defined\n")
ELSE()
MESSAGE("-- LAME_LIBRARY_DIR ${LAME_LIBRARY_DIR}")
ENDIF()
ELSE()
MESSAGE("-- LAME is NOT Enabled.")
SET(ALBANY_LAME FALSE)
ENDIF()
# optional dependency on LAMENT, defaults to FALSE
OPTION(ENABLE_LAMENT "Flag to turn on LAMENT lmaterial library source code" OFF)
IF(ENABLE_LAMENT)
MESSAGE("-- LAMENT is enabled, compiling with -DALBANY_LAMENT")
SET(ALBANY_LAMENT TRUE)
IF(NOT LAMENT_INCLUDE_DIR)
MESSAGE("\nError: LAMENT_INCLUDE_DIR not defined\n")
ELSE()
MESSAGE("-- LAMENT_INCLUDE_DIR ${LAMENT_INCLUDE_DIR}")
ENDIF()
IF(NOT LAMENT_LIBRARY_DIR)
MESSAGE("\nError: LAMENT_LIBRARY_DIR not defined\n")
ELSE()
MESSAGE("-- LAMENT_LIBRARY_DIR ${LAMENT_LIBRARY_DIR}")
ENDIF()
ELSE()
MESSAGE("-- LAMENT is NOT Enabled.")
SET(ALBANY_LAMENT FALSE)
ENDIF()
# Add option for ASCR work, defaults to disabled
OPTION(ENABLE_ASCR "Flag to turn on ASCR-funded coupled UQ research source code" OFF)
IF (ENABLE_ASCR)
MESSAGE("-- ASCR is Enabled, compiling with -DALBANY_ASCR")
SET(ALBANY_ASCR TRUE)
ELSE()
MESSAGE("-- ASCR is NOT Enabled.")
SET(ALBANY_ASCR FALSE)
ENDIF()
# Set optional dependency on SCOREC PUMI, optional adaptivity
OPTION(ENABLE_SCOREC "Flag to turn on SCOREC dependency" OFF)
SET(ALBANY_SCOREC_DIR "" CACHE PATH "Path to standalone SCOREC installation")
IF(ENABLE_SCOREC)
# Check whether SCOREC was built as part of Trilinos
LIST(FIND Trilinos_PACKAGE_LIST SCOREC SCOREC_List_ID)
IF (SCOREC_List_ID GREATER -1)
# It was built in Trilinos
LIST(FIND Trilinos_TPL_LIST SimModel SimModel_List_ID)
# Check whether Simmetrix is also used
IF (SimModel_List_ID GREATER -1)
MESSAGE(STATUS "Simmetrix SimModel is a Trilinos TPL")
SET(ALBANY_SCOREC_SIMMODEL ON)
ENDIF()
SET(ALBANY_SCOREC_STANDALONE FALSE)
ELSE()
# Not built in Trilinos, try to find standalone
# build in SCOREC_PREFIX
FIND_PACKAGE(SCOREC 2.0.0 PATHS "${ALBANY_SCOREC_DIR}")
IF (NOT SCOREC_FOUND)
MESSAGE(FATAL_ERROR "\nError: can't find either SCOREC package\n")
ENDIF()
MESSAGE(STATUS "SCOREC Found at ${SCOREC_CONFIG}")
SET(ALBANY_SCOREC_STANDALONE TRUE)
ENDIF()
SET(ALBANY_APF TRUE)
MESSAGE(STATUS "SCOREC is enabled, compiling with -DALBANY_SCOREC")
SET(ALBANY_SCOREC TRUE)
ELSE()
MESSAGE(STATUS "SCOREC is NOT Enabled.")
SET(ALBANY_SCOREC FALSE)
ENDIF()
# RPI APF mesh interface
IF (ALBANY_APF)
MESSAGE("-- APF is Enabled, compiling with -DALBANY_APF")
ELSE()
MESSAGE("-- APF is NOT Enabled.")
ENDIF()
OPTION(ENABLE_OMEGA_H "Enable Omega_h dependency for adaptation" OFF)
SET(ALBANY_OMEGA_H_DIR "" CACHE PATH "Path to Omega_h installation")
IF(ENABLE_OMEGA_H)
FIND_PACKAGE(Omega_h 9.0.0 REQUIRED PATHS "${ALBANY_OMEGA_H_DIR}")
MESSAGE(STATUS "Omega_h found at ${Omega_h_CONFIG}")
SET(ALBANY_OMEGA_H TRUE)
ENDIF()
# ParaView's Catalyst CoProcessing package
OPTION(ENABLE_CATALYST "Flag to turn on support for the Catalyst CoProcessing library" OFF)
IF (ENABLE_CATALYST)
MESSAGE("-- Catalyst is Enabled, compiling with -DALBANY_CATALYST")
SET(ALBANY_CATALYST TRUE)
ELSE()
MESSAGE("-- Catalyst is NOT Enabled.")
SET(ALBANY_CATALYST FALSE)
ENDIF()
# Add option for CONTACT work, defaults to disabled
OPTION(ENABLE_CONTACT "Flag to turn on CONTACT code in LCM" OFF)
IF (ENABLE_CONTACT)
MESSAGE("-- CONTACT is Enabled, compiling with -DALBANY_CONTACT")
SET(ALBANY_CONTACT TRUE)
ELSE()
MESSAGE("-- CONTACT is NOT Enabled.")
SET(ALBANY_CONTACT FALSE)
ENDIF()
# Set option to disable compiling some code for nightly tests
# Some code sections take so long to compile with NVCC that nightly tests are
# timing out. This option allows disabling those sections.
OPTION(NIGHTLY_TESTING "Flag to turn off selected code during nightly testing" OFF)
IF (NIGHTLY_TESTING)
MESSAGE("-- NIGHTLY_TESTING is Enabled, compiling with -DALBANY_NIGHTLY_TEST")
SET(ALBANY_NIGHTLY_TESTING TRUE)
ELSE()
MESSAGE("-- NIGHTLY_TESTING is NOT Enabled.")
SET(ALBANY_NIGHTLY_TESTING FALSE)
ENDIF()
## Other Albany Template Options here:
MESSAGE("\nAlbany Templated Data Type Options:")
# Throw error if using ENABLE_FAST_FELIX
IF(ENABLE_FAST_FELIX)
MESSAGE(FATAL_ERROR
"\nError: ENABLE_FAST_FELIX has been removed! Use ENABLE_FAD_TYPE instead.
Example for a tetrahedral mesh in LandIce:
-D ENABLE_FAD_TYPE:STRING=SFad
-D ALBANY_SFAD_SIZE=8
For a hexahedral mesh, use ALBANY_SFAD_SIZE=16")
ENDIF()
# Set FAD data type
SET(ENABLE_FAD_TYPE "DFad" CACHE STRING "Sacado forward mode automatic differentiation data type")
IF(ENABLE_FAD_TYPE STREQUAL "SFad")
SET(ALBANY_FAD_TYPE_SFAD TRUE)
SET(ALBANY_SFAD_SIZE 32 CACHE INT "Number of derivative components chosen at compile-time for AD")
MESSAGE("-- FAD_TYPE is SFad, compiling with -DALBANY_FAD_TYPE_SFAD -DALBANY_SFAD_SIZE=${ALBANY_SFAD_SIZE}")
MESSAGE("---> WARNING: problems with elemental DOFs > ${ALBANY_SFAD_SIZE} will fail")
ELSEIF(ENABLE_FAD_TYPE STREQUAL "SLFad")
SET(ALBANY_FAD_TYPE_SLFAD TRUE)
SET(ALBANY_SLFAD_SIZE 32 CACHE INT "Maximum number of derivative components chosen at compile-time for AD")
MESSAGE("-- FAD_TYPE is SLFad, compiling with -DALBANY_FAD_TYPE_SLFAD -DALBANY_SLFAD_SIZE=${ALBANY_SLFAD_SIZE}")
MESSAGE("---> WARNING: problems with elemental DOFs > ${ALBANY_SLFAD_SIZE} will fail")
ELSEIF(ENABLE_FAD_TYPE STREQUAL "DFad")
MESSAGE("-- FAD_TYPE is DFad (default)")
ELSE()
MESSAGE(FATAL_ERROR
"\nError: ENABLE_FAD_TYPE = ${ENABLE_FAD_TYPE} is not recognized!
Options: SFad, SLFad, DFad (default)")
ENDIF()
# Set FAD data type for Tangent
SET(ENABLE_TAN_FAD_TYPE "DFad" CACHE STRING "Sacado forward mode automatic differentiation data type for Tangent")
IF(ENABLE_TAN_FAD_TYPE STREQUAL "SFad")
SET(ALBANY_TAN_FAD_TYPE_SFAD TRUE)
SET(ALBANY_TAN_SFAD_SIZE 32 CACHE INT "Number of derivative components chosen at compile-time for Tangent AD")
MESSAGE("-- TAN_FAD_TYPE is SFad, compiling with -DALBANY_TAN_FAD_TYPE_SFAD -DALBANY_TAN_SFAD_SIZE=${ALBANY_TAN_SFAD_SIZE}")
MESSAGE("---> WARNING: problems with Tangent elemental DOFs > ${ALBANY_TAN_SFAD_SIZE} will fail")
ELSEIF(ENABLE_TAN_FAD_TYPE STREQUAL "SLFad")
SET(ALBANY_TAN_FAD_TYPE_SLFAD TRUE)
SET(ALBANY_TAN_SLFAD_SIZE 32 CACHE INT "Maximum number of derivative components chosen at compile-time for Tangent AD")
MESSAGE("-- TAN_FAD_TYPE is SLFad, compiling with -DALBANY_TAN_FAD_TYPE_SLFAD -DALBANY_TAN_SLFAD_SIZE=${ALBANY_TAN_SLFAD_SIZE}")
MESSAGE("---> WARNING: problems with Tangent elemental DOFs > ${ALBANY_TAN_SLFAD_SIZE} will fail")
ELSEIF(ENABLE_TAN_FAD_TYPE STREQUAL "DFad")
MESSAGE("-- TAN_FAD_TYPE is DFad (default)")
ELSE()
MESSAGE(FATAL_ERROR
"\nError: ENABLE_TAN_FAD_TYPE = ${ENABLE_TAN_FAD_TYPE} is not recognized!
Options: SFad, SLFad, DFad")
ENDIF()
# Check if FAD data type is the same
IF(ENABLE_FAD_TYPE STREQUAL ENABLE_TAN_FAD_TYPE)
IF(ALBANY_FAD_TYPE_SFAD AND NOT ALBANY_SFAD_SIZE EQUAL ALBANY_TAN_SFAD_SIZE)
SET(ALBANY_FADTYPE_NOTEQUAL_TANFADTYPE TRUE)
MESSAGE("-- SFAD_SIZE is not TAN_SFAD_SIZE, compiling with -DALBANY_FADTYPE_NOTEQUAL_TANFADTYPE")
ELSEIF(ALBANY_FAD_TYPE_SLFAD AND NOT ALBANY_SLFAD_SIZE EQUAL ALBANY_TAN_SLFAD_SIZE)
SET(ALBANY_FADTYPE_NOTEQUAL_TANFADTYPE TRUE)
MESSAGE("-- SLFAD_SIZE is not TAN_SLFAD_SIZE, compiling with -DALBANY_FADTYPE_NOTEQUAL_TANFADTYPE")
ENDIF()
ELSE()
SET(ALBANY_FADTYPE_NOTEQUAL_TANFADTYPE TRUE)
MESSAGE("-- FAD_TYPE is not TAN_FAD_TYPE, compiling with -DALBANY_FADTYPE_NOTEQUAL_TANFADTYPE")
ENDIF()
# optionally disable the use of the Trilinos stokhos package
OPTION(ENABLE_STOKHOS "Flag to enable / disable the use of Stokhos in Albany" OFF)
IF (ENABLE_STOKHOS)
MESSAGE("-- Stokhos is Enabled, compiling with -DALBANY_STOKHOS")
set(ALBANY_STOKHOS TRUE)
LIST(FIND Trilinos_PACKAGE_LIST Stokhos STOKHOS_List_ID)
IF (NOT STOKHOS_List_ID GREATER -1)
MESSAGE(FATAL_ERROR "\nError: STOKHOS option requires Stokhos\n")
ENDIF()
ELSE()
set(ALBANY_STOKHOS FALSE)
ENDIF()
# Disable the RTC capability if Trilinos is not built with Pamgen
LIST(FIND Trilinos_PACKAGE_LIST Pamgen PAMGEN_List_ID)
IF (NOT PAMGEN_List_ID GREATER -1)
set(ALBANY_PAMGEN FALSE)
MESSAGE("-- Pamgen package not found, disabling run time compiler support.")
ELSE()
set(ALBANY_PAMGEN TRUE)
MESSAGE("-- Pamgen package found, enabling run time compiler support.")
ENDIF()
## Other Miscellaneous Albany Options here:
MESSAGE("\nMiscellaneous Albany Options:")
# optionally set global ordinal size to signed 64 bits
OPTION(ENABLE_64BIT_INT "Flag to set global ordinal size to signed 64 bit int" OFF)
IF (ENABLE_64BIT_INT)
MESSAGE("-- 64 bit GO is Enabled, compiling with -DALBANY_64BIT_INT")
SET(ALBANY_64BIT_INT TRUE)
# Turn off all the old Epetra tests - they will not run in the 64 bit compilation environment
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake)
ELSE()
MESSAGE("-- 64 bit GO is NOT Enabled.")
SET(ALBANY_64BIT_INT FALSE)
ENDIF()
# It is not currently possible to determine the status of "Kokkos_ENABLE_Cuda" from Albany. So we will deduce it
# from ${Trilinos_INCLUDE_DIRS}/KokkosCore_config.h
IF(NOT DEFINED Kokkos_ENABLE_Cuda)
SET(Kokkos_ENABLE_Cuda OFF)
IF(EXISTS "${Trilinos_INCLUDE_DIRS}/KokkosCore_config.h")
FILE(READ ${Trilinos_INCLUDE_DIRS}/KokkosCore_config.h CURRENT_CONFIG)
STRING(REGEX MATCH "\#define KOKKOS_ENABLE_CUDA" KOKKOS_CUDA_IS_SET ${CURRENT_CONFIG})
IF("#define KOKKOS_ENABLE_CUDA" STREQUAL "${KOKKOS_CUDA_IS_SET}")
MESSAGE("-- Kokkos is configured to use CUDA, Albany will also.")
SET(Kokkos_ENABLE_Cuda ON)
SET(NUM_GPUS_PER_NODE 4 CACHE INT "set Number of GPUs per Node")
MESSAGE("-- NUM_GPUS_PER_NODE=${NUM_GPUS_PER_NODE}")
SET(KOKKOS_NDEVICES "--kokkos-ndevices=${NUM_GPUS_PER_NODE}")
IF (ENABLE_CUDA_ERROR_CHECK)
SET(ALBANY_CUDA_ERROR_CHECK ON)
MESSAGE("-- CUDA Error Check is Enabled, compiling with -DALBANY_CUDA_ERROR_CHECK")
ELSE()
MESSAGE("-- CUDA Error Check is NOT Enabled.")
ENDIF()
IF (ENABLE_ALBANY_EPETRA_EXE)
MESSAGE(FATAL_ERROR "\nError: Albany with Epetra is not supported with CUDA KokkosNode! Please re-configure w/o Epetra (ENABLE_ALBANY_EPETRA_EXE=OFF).")
ENDIF()
IF (ENABLE_CUDA_NVTX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lnvToolsExt")
SET(ALBANY_CUDA_NVTX ON)
MESSAGE("-- CUDA NVTX is Enabled, compiling with -DALBANY_CUDA_NVTX")
ELSE()
MESSAGE("-- CUDA NVTX is NOT Enabled.")
ENDIF()
ELSE("#define KOKKOS_ENABLE_CUDA" STREQUAL "${KOKKOS_CUDA_IS_SET}")