forked from sandialabs/Albany
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
1356 lines (1214 loc) · 50.9 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.8.12)
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")
# Set Trilinos commit id
IF(EXISTS "${Trilinos_DIR}/../../../TrilinosRepoVersion.txt")
FILE(STRINGS "${Trilinos_DIR}/../../../TrilinosRepoVersion.txt" TRILINOS_VERSION_FILE)
SET(TRILINOS_GIT_COMMIT_ID_LINE_LOC 1)
LIST(GET TRILINOS_VERSION_FILE ${TRILINOS_GIT_COMMIT_ID_LINE_LOC} TRILINOS_GIT_COMMIT_ID_LINE)
STRING(REGEX MATCH "^[^ ]+" Trilinos_GIT_COMMIT_ID ${TRILINOS_GIT_COMMIT_ID_LINE})
SET(ALBANY_TRILINOS_GIT_COMMIT_ID ${Trilinos_GIT_COMMIT_ID})
ENDIF()
MESSAGE("\nFound Trilinos! Here are the details: ")
MESSAGE("-- Trilinos_DIR = ${Trilinos_DIR}")
MESSAGE("-- Trilinos_VERSION = ${Trilinos_VERSION}")
MESSAGE("-- Trilinos_GIT_COMMIT_ID = ${Trilinos_GIT_COMMIT_ID}")
MESSAGE("-- Trilinos_BIN_DIRS = ${Trilinos_BIN_DIRS}")
MESSAGE("-- Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
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
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()
# Set Albany branch and commit id
EXECUTE_PROCESS(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ALBANY_GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
EXECUTE_PROCESS(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ALBANY_GIT_COMMIT_ID
OUTPUT_STRIP_TRAILING_WHITESPACE
)
MESSAGE("Albany version details:")
MESSAGE("-- ALBANY_GIT_BRANCH = ${ALBANY_GIT_BRANCH}")
MESSAGE("-- ALBANY_GIT_COMMIT_ID = ${ALBANY_GIT_COMMIT_ID}")
MESSAGE("End of Albany version details\n")
# 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)
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)
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")
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()
# 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()
# Compiler details
SET(ALBANY_CXX_COMPILER_ID ${CMAKE_CXX_COMPILER_ID})
MESSAGE("-- ALBANY_CXX_COMPILER_ID = ${ALBANY_CXX_COMPILER_ID}")
SET(ALBANY_CXX_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
MESSAGE("-- ALBANY_CXX_COMPILER_VERSION = ${ALBANY_CXX_COMPILER_VERSION}")
IF(EXISTS "${Trilinos_INCLUDE_DIRS}/KokkosCore_config.h")
FILE(READ "${Trilinos_INCLUDE_DIRS}/KokkosCore_config.h" KOKKOS_CORE_CONFIG_FILE)
STRING(REGEX MATCH "#define KOKKOS_ENABLE_OPENMP" ALBANY_ENABLE_OPENMP ${KOKKOS_CORE_CONFIG_FILE})
IF(ALBANY_ENABLE_OPENMP)
MESSAGE("-- Kokkos is configured to use OpenMP, Albany will also.")
ENDIF()
STRING(REGEX MATCH "#define KOKKOS_ENABLE_CUDA" ALBANY_ENABLE_CUDA ${KOKKOS_CORE_CONFIG_FILE})
IF(ALBANY_ENABLE_CUDA)
MESSAGE("-- Kokkos is configured to use CUDA, Albany will also.")
STRING(REGEX MATCH "#define KOKKOS_COMPILER_CUDA_VERSION ([0-9]*)" _ ${KOKKOS_CORE_CONFIG_FILE})
SET(ALBANY_CUDA_COMPILER_VERSION "${CMAKE_MATCH_1}")
MESSAGE("-- ALBANY_CUDA_COMPILER_VERSION = ${ALBANY_CUDA_COMPILER_VERSION}")
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "\nError: ${Trilinos_INCLUDE_DIRS}/KokkosCore_config.h not found!")
ENDIF()
MESSAGE("End of compiler details\n")
## Check for some required Trilinos package dependencies (Piro, Phalanx) ##
MESSAGE("Checking Trilinos build for required and optional packages")
OPTION(ENABLE_ALBANY_EPETRA "Flag to turn on building of code depending on Epetra" ON)
###############################
### Check REQUIRED packages ###
###############################
MESSAGE ("\n **********************************")
MESSAGE (" *** Required Trilinos Packages ***")
MESSAGE (" **********************************\n")
# Piro
LIST(FIND Trilinos_PACKAGE_LIST Piro Piro_List_ID)
IF (Piro_List_ID GREATER -1)
MESSAGE("-- Looking for Piro (required) in Trilinos ... Found!")
ELSE()
MESSAGE("-- Looking for Piro (required) in Trilinos ... NOT Found!")
MESSAGE(FATAL_ERROR "Albany REQUIRES Piro. Please, configure Trilinos with guidance from trilinos-cmake script in doc directory.")
ENDIF()
# Phalanx
LIST(FIND Trilinos_PACKAGE_LIST Phalanx Phalanx_List_ID)
IF (Piro_List_ID GREATER -1)
MESSAGE("-- Looking for Phalanx (required) in Trilinos ... Found!")
ELSE()
MESSAGE("-- Looking for Phalanx (required) in Trilinos ... NOT Found!")
MESSAGE(FATAL_ERROR "Albany REQUIRES Phalanx. Please, configure Trilinos with guidance from trilinos-cmake script in doc directory.")
ENDIF()
# NOX
LIST(FIND Trilinos_PACKAGE_LIST NOX NOX_List_ID)
IF (Piro_List_ID GREATER -1)
MESSAGE("-- Looking for NOX (required) in Trilinos ... Found!")
ELSE()
MESSAGE("-- Looking for NOX (required) in Trilinos ... NOT Found!")
MESSAGE(FATAL_ERROR "Albany REQUIRES NOX. Please, configure Trilinos with guidance from trilinos-cmake script in doc directory.")
ENDIF()
# ThyraTpetraAdapters
LIST(FIND Trilinos_PACKAGE_LIST ThyraTpetraAdapters ThyraTpetraAdapters_List_ID)
IF (Piro_List_ID GREATER -1)
MESSAGE("-- Looking for ThyraTpetraAdapters (required) in Trilinos ... Found!")
ELSE()
MESSAGE("-- Looking for ThyraTpetraAdapters (required) in Trilinos ... NOT Found!")
MESSAGE(FATAL_ERROR "Albany REQUIRES ThyraTpetraAdapters. Please, configure Trilinos with guidance from trilinos-cmake script in doc directory.")
ENDIF()
# Intrepid2
LIST(FIND Trilinos_PACKAGE_LIST Intrepid2 Intrepid2_List_ID)
IF (Piro_List_ID GREATER -1)
MESSAGE("-- Looking for Intrepid2 (required) in Trilinos ... Found!")
ELSE()
MESSAGE("-- Looking for Intrepid2 (required) in Trilinos ... NOT Found!")
MESSAGE(FATAL_ERROR "Albany REQUIRES Intrepid2. Please, configure Trilinos with guidance from trilinos-cmake script in doc directory.")
ENDIF()
# MiniTensor
LIST(FIND Trilinos_PACKAGE_LIST MiniTensor MiniTensor_List_ID)
IF (Piro_List_ID GREATER -1)
MESSAGE("-- Looking for MiniTensor (required) in Trilinos ... Found!")
ELSE()
MESSAGE("-- Looking for MiniTensor (required) in Trilinos ... NOT Found!")
MESSAGE(FATAL_ERROR "Albany REQUIRES MiniTensor. Please, configure Trilinos with guidance from trilinos-cmake script in doc directory.")
ENDIF()
###############################
### Check OPTIONAL packages ###
###############################
MESSAGE ("\n **********************************")
MESSAGE (" *** Optional Trilinos Packages ***")
MESSAGE (" **********************************\n")
### 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")
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")
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")
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")
SET(ALBANY_STK_PERCEPT TRUE)
ELSE()
MESSAGE(" -- Looking for stk_percept: NOT found.")
SET(ALBANY_STK_PERCEPT FALSE)
ENDIF()
#set optional dependency on STKExprEval
LIST(FIND Trilinos_PACKAGE_LIST STKExprEval STKExprEval_List_ID)
IF (STKExprEval_List_ID GREATER -1)
MESSAGE(" -- Looking for STKExprEval: Found. Compiling with -DALBANY_STK_EXPR_EVAL.")
SET(ALBANY_STK_EXPR_EVAL TRUE)
add_definitions(-DALBANY_STK_EXPR_EVAL)
ELSE()
MESSAGE(" -- Looking for STKExprEval: NOT Found.")
SET(ALBANY_STK_EXPR_EVAL 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")
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.")
ELSE()
SET(ALBANY_STK_REBALANCE FALSE)
MESSAGE("-- Looking for Zoltan: Found.")
ENDIF()
ELSE()
MESSAGE("-- Looking for Zoltan: NOT found.")
SET(ALBANY_ZOLTAN FALSE)
SET(ALBANY_STK_REBALANCE FALSE)
ENDIF()
# set optional dependency on Belos's Epetra subpackage
IF (EXISTS "${Trilinos_INCLUDE_DIRS}/BelosEpetraAdapter.hpp")
MESSAGE("-- Looking for BelosEpetra: Found.")
SET(ALBANY_BELOS_EPETRA TRUE)
ELSE ()
MESSAGE("-- Looking for BelosEpetra: NOT found.")
SET(ALBANY_BELOS_EPETRA 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.")
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.")
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.")
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.")
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()
# set optional dependency on FROSch, for preconditioning
LIST(FIND Trilinos_PACKAGE_LIST ShyLU_DDFROSch FROSch_List_ID)
IF (FROSch_List_ID GREATER -1)
MESSAGE("-- Looking for FROSch: Found.")
SET(ALBANY_FROSCH TRUE)
ELSE()
MESSAGE("-- Looking for FROSch: NOT found.")
SET(ALBANY_FROSCH FALSE)
ENDIF()
LIST(FIND Trilinos_PACKAGE_LIST Rythmos Rythmos_List_ID)
IF (Rythmos_List_ID GREATER -1)
MESSAGE("-- Looking for Rythmos: Found.")
SET(ALBANY_RYTHMOS TRUE)
ELSE()
MESSAGE("-- Looking for Rythmos: NOT found.")
SET(ALBANY_RYTHMOS 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")
SET(ALBANY_ROL TRUE)
ELSE()
MESSAGE("-- Looking for ROL in Trilinos: NOT found.")
SET(ALBANY_ROL 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")
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")
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 build of code depending on Epetra.
# Be default, it will be on, so both Tpetra and Epetra capabilities are built.
# Ideally, one should not need Epetra though, since the Tpetra stack in
# Trilinos *should* be a superset of the Epetra one (in terms of capabilities,
# not structures, obviously).
IF (ENABLE_ALBANY_EPETRA)
MESSAGE("\n-- ALBANY_EPETRA is Enabled. Checking for additional Trilinos packages")
SET(ALBANY_EPETRA TRUE)
LIST(FIND Trilinos_PACKAGE_LIST ThyraEpetraAdapters ThyraEpetraAdapters_ID)
IF (ThyraEpetraAdapters_ID GREATER -1)
MESSAGE("-- Looking for ThyraEpetraAdapters: Found.")
ELSE()
MESSAGE("-- Looking for ThyraEpetraAdapters: NOT found.")
MESSAGE (FATAL_ERROR "ENABLE_ALBANY_EPETRA=ON requires ThyraEpetraAdapters in Trilinos.\n")
ENDIF()
# 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.")
SET(ALBANY_DAKOTA TRUE)
ELSE()
MESSAGE("-- Looking for Dakota via TriKota: NOT found.")
SET(ALBANY_DAKOTA FALSE)
ENDIF()
ELSE()
MESSAGE("-- ALBANY_EPETRA 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")
SET(ALBANY_DEMO_PDES TRUE)
ELSE()
MESSAGE("-- DEMO_PDES is NOT Enabled.")
SET(ALBANY_DEMO_PDES FALSE)
ENDIF()
# set optional dependency on ATO, defaults to Disabled
OPTION(ENABLE_LCM "Flag to turn on LCM Mechanics source code" OFF)
OPTION(ENABLE_ATO "Flag to turn on ATO source code" OFF)
IF (ENABLE_ATO)
MESSAGE("-- ATO is Enabled")
SET(ALBANY_ATO TRUE)
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()
OPTION(DISABLE_LCM_EXODIFF_SENSITIVE_TESTS "Flag to turn off LCM exodiff sensitive tests" OFF)
SET(LCM_TEST_EXES FALSE)
IF (ENABLE_LCM OR ENABLE_ATO)
IF (NOT ENABLE_LCM)
MESSAGE("-- LCM is Enabled because ATO requires LCM.")
ELSE ()
MESSAGE("-- LCM is Enabled.")
ENDIF ()
SET(ALBANY_LCM TRUE)
IF (ENABLE_LCM AND NOT ALBANY_ROL)
MESSAGE(FATAL_ERROR
"LCM enabled but ROL not installed from Trilinos (LCM needs ROL)")
ENDIF()
IF (ENABLE_LCM_TEST_EXES AND ALBANY_STK) # Need STK for the EXES
SET(LCM_TEST_EXES TRUE)
ENDIF()
IF (DISABLE_LCM_EXODIFF_SENSITIVE_TESTS)
MESSAGE(" -- LCM exodiff sensitive tests are DISABLED!")
SET(DISABLE_LCM_EXODIFF_SENSITIVE_TESTS TRUE)
ENDIF()
ELSE()
MESSAGE("-- LCM is NOT Enabled.")
SET(ALBANY_LCM FALSE)
ENDIF()
# set optional dependency on MPMD, defaults to Disabled
OPTION(ENABLE_MPMD "Flag to turn on MPMD source code" OFF)
IF (ENABLE_MPMD)
MESSAGE("-- MPMP executable is Enabled.")
SET(ALBANY_MPMD TRUE)
ELSE ()
MESSAGE("-- MPMP executable is NOT Enabled.")
SET(ALBANY_MPMD 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)
OPTION(ENABLE_CISM_INTERFACE "Flag to turn on LandIce Interface to the CISM code" OFF)
OPTION(ENABLE_MPAS_INTERFACE "Flag to turn on LandIce Source code" OFF)
IF (ENABLE_LANDICE)
MESSAGE("-- LandIce is Enabled")
SET(ALBANY_LANDICE TRUE)
# 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.")
SET(USE_CISM_FLOW_PARAMETERS TRUE)
ELSE()
SET(USE_CISM_FLOW_PARAMETERS FALSE)
MESSAGE(" -- USE_CISM_FLOW_PARAMETERS is NOT Enabled.")
ENDIF()
# Set optional build of MPAS Interface for LandIce (Land Ice SciDAC project),
# defaults to Disabled
IF (ENABLE_MPAS_INTERFACE)
MESSAGE("-- MPAS_INTERFACE is Enabled")
SET(MPAS_HAS_LANDICE TRUE)
ELSE()
MESSAGE(" -- MPAS_INTERFACE is NOT Enabled.")
SET(MPAS_HAS_LANDICE FALSE)
ENDIF()
# Set optional build of CISM Interface for LandIce (Land Ice SciDAC project),
# defaults to Disabled
OPTION(ENABLE_CISM_REDUCED_COMM "Flag to turn on reduced communicator for CISM-Albany runs" ON)
OPTION(ENABLE_CISM_CHECK_COMPARISONS "Flag to turn on comparisons checking for CISM-Albany" OFF)
IF (ENABLE_CISM_INTERFACE)
MESSAGE(" -- CISM_INTERFACE is Enabled")
SET(CISM_HAS_LANDICE TRUE)
IF (ENABLE_CISM_CHECK_COMPARISONS)
SET(CISM_CHECK_COMPARISONS TRUE)
MESSAGE(" -- CISM_CHECK_COMPARISONS is Enabled. Error will be thrown if comparisons fail for CISM-Albany run.")
ELSE()
MESSAGE(" -- CISM_CHECK_COMPARISONS is Disabled. 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. CISM-Albany will use reduced communicator.")
ENDIF()
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()
ELSE()
MESSAGE(" -- CISM_INTERFACE is NOT Enabled.")
SET(CISM_HAS_LANDICE FALSE)
ENDIF()
ELSE()
MESSAGE("-- LandIce is NOT Enabled.")
SET(ALBANY_LANDICE FALSE)
IF(ENABLE_MPAS_INTERFACE)
MESSAGE(FATAL_ERROR "\nError: ENABLE_MPAS_INTERFACE requires ENABLE_LANDICE
to be ON\n")
ELSEIF(ENABLE_CISM_INTERFACE)
MESSAGE(FATAL_ERROR "\nError: ENABLE_CISM_INTERFACE requires ENABLE_LANDICE
to be ON\n")
ENDIF()
ENDIF()
OPTION(ENABLE_TSUNAMI "Flag to turn on TSUNAMI Source code" OFF)
IF (ENABLE_TSUNAMI)
MESSAGE("-- TSUNAMI is Enabled")
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")
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")
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")
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")
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 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")
SET(ALBANY_AERAS TRUE)
IF (ENABLE_AERAS_IMPLICIT_HS)
MESSAGE(" -- Aeras implicit hydrostatic is Enabled")
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")
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")
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")
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("-- SCOREC is enabled")
SET(ALBANY_SCOREC TRUE)
ELSE()
MESSAGE("-- SCOREC is NOT Enabled.")
SET(ALBANY_SCOREC FALSE)
ENDIF()
# RPI APF mesh interface
IF (ALBANY_APF)
MESSAGE("-- APF is Enabled")
ELSE()
MESSAGE("-- APF is NOT Enabled.")
ENDIF()
# Set optional dependency on TDM, defaults to Disabled
OPTION(ENABLE_TDM "Flag to turn on TDM source code" OFF)
IF (ENABLE_TDM)
IF (NOT ENABLE_SCOREC)
MESSAGE(FATAL_ERROR
"\nError: TDM requires enabling SCOREC! Re-compile with -DENABLE_SCOREC=ON!")
ENDIF()
SET(ALBANY_APF TRUE)
ADD_DEFINITIONS(-DALBANY_TDM)
MESSAGE("-- TDM is Enabled, compiling with -DALBANY_TDM")
SET(ALBANY_TDM TRUE)
ELSE()
MESSAGE("-- TDM is NOT Enabled.")
SET(ALBANY_TDM FALSE)
ENDIF()
# set optional dependency on LCM, defaults to Disabled
OPTION(ENABLE_LCM_TEST_EXES "Flag to turn on LCM Mechanics test executables" ON)
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")
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")
SET(ALBANY_CONTACT TRUE)
ELSE()
MESSAGE("-- CONTACT is NOT Enabled.")
SET(ALBANY_CONTACT 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, ALBANY_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, ALBANY_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, ALBANY_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, ALBANY_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")
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")
ENDIF()
ELSE()
SET(ALBANY_FADTYPE_NOTEQUAL_TANFADTYPE TRUE)
MESSAGE("-- FAD_TYPE is not TAN_FAD_TYPE")
ENDIF()
LIST(FIND Trilinos_PACKAGE_LIST Pamgen PAMGEN_List_ID)
IF (NOT PAMGEN_List_ID GREATER -1)
MESSAGE("-- Pamgen is Enabled. Building Pamgen tests")
set(ALBANY_PAMGEN TRUE)
ELSE()
MESSAGE("-- Pamgen is NOT Enabled. Not building Pamgen tests")
set(ALBANY_PAMGEN FALSE)
ENDIF()