-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrilinosBuildQuickRef.html
1917 lines (1839 loc) · 94.4 KB
/
TrilinosBuildQuickRef.html
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
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>Trilinos Configure, Build, Test, and Install Quick Reference Guide</title>
<meta name="author" content="Roscoe A. Bartlett" />
<style type="text/css">
/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left{
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right {
clear: right ;
float: right ;
margin-left: 1em }
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: left }
/* div.align-center * { */
/* text-align: left } */
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block {
margin-left: 2em ;
margin-right: 2em }
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="trilinos-configure-build-test-and-install-quick-reference-guide">
<h1 class="title">Trilinos Configure, Build, Test, and Install Quick Reference Guide</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr><th class="docinfo-name">Author:</th>
<td>Roscoe A. Bartlett</td></tr>
<tr><th class="docinfo-name">Contact:</th>
<td><a class="first last reference external" href="mailto:bartlett.roscoe@gmail.com">bartlett.roscoe@gmail.com</a></td></tr>
</tbody>
</table>
<div class="abstract topic">
<p class="topic-title first">Abstract</p>
<p>This document contains quick reference information on how to configure, build, test, and install Trilinos using the TriBITS CMake build system. The primary audience are users of Trilinos that need to configure and build the software. The secondary audience are actual developers of Trilinos.</p>
</div>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="auto-toc simple">
<li><a class="reference internal" href="#introduction" id="id1">1 Introduction</a></li>
<li><a class="reference internal" href="#trilinos-specific-options" id="id2">2 Trilinos-specific options</a><ul class="auto-toc">
<li><a class="reference internal" href="#enabling-disabling-time-monitors" id="id3">2.1 Enabling/disabling time monitors</a></li>
</ul>
</li>
<li><a class="reference internal" href="#getting-set-up-to-use-cmake" id="id4">3 Getting set up to use CMake</a><ul class="auto-toc">
<li><a class="reference internal" href="#installing-a-binary-release-of-cmake-casual-users" id="id5">3.1 Installing a binary release of CMake [casual users]</a></li>
<li><a class="reference internal" href="#installing-cmake-from-source-developers-and-experienced-users" id="id6">3.2 Installing CMake from source [developers and experienced users]</a></li>
</ul>
</li>
<li><a class="reference internal" href="#getting-cmake-help" id="id7">4 Getting CMake Help</a><ul class="auto-toc">
<li><a class="reference internal" href="#finding-cmake-help-at-the-website" id="id8">4.1 Finding CMake help at the website</a></li>
<li><a class="reference internal" href="#building-cmake-help-locally" id="id9">4.2 Building CMake help locally</a></li>
</ul>
</li>
<li><a class="reference internal" href="#configuring-makefile-generator" id="id10">5 Configuring (Makefile Generator)</a><ul class="auto-toc">
<li><a class="reference internal" href="#setting-up-a-build-directory" id="id11">5.1 Setting up a build directory</a></li>
<li><a class="reference internal" href="#basic-configuration" id="id12">5.2 Basic configuration</a></li>
<li><a class="reference internal" href="#selecting-the-list-of-packages-to-enable" id="id13">5.3 Selecting the list of packages to enable</a></li>
<li><a class="reference internal" href="#selecting-compiler-and-linker-options" id="id14">5.4 Selecting compiler and linker options</a></li>
<li><a class="reference internal" href="#enabling-support-for-c-11" id="id15">5.5 Enabling support for C++11</a></li>
<li><a class="reference internal" href="#disabling-the-fortran-compiler-and-all-fortran-code" id="id16">5.6 Disabling the Fortran compiler and all Fortran code</a></li>
<li><a class="reference internal" href="#enabling-runtime-debug-checking" id="id17">5.7 Enabling runtime debug checking</a></li>
<li><a class="reference internal" href="#configuring-with-mpi-support" id="id18">5.8 Configuring with MPI support</a></li>
<li><a class="reference internal" href="#configuring-for-openmp-support" id="id19">5.9 Configuring for OpenMP support</a></li>
<li><a class="reference internal" href="#building-shared-libraries" id="id20">5.10 Building shared libraries</a></li>
<li><a class="reference internal" href="#building-static-libraries-and-executables" id="id21">5.11 Building static libraries and executables</a></li>
<li><a class="reference internal" href="#enabling-support-for-an-optional-third-party-library-tpl" id="id22">5.12 Enabling support for an optional Third-Party Library (TPL)</a></li>
<li><a class="reference internal" href="#disabling-support-for-a-third-party-library-tpl" id="id23">5.13 Disabling support for a Third-Party Library (TPL)</a></li>
<li><a class="reference internal" href="#disabling-tentatively-enabled-tpls" id="id24">5.14 Disabling tentatively enabled TPLs</a></li>
<li><a class="reference internal" href="#generating-verbose-output" id="id25">5.15 Generating verbose output</a></li>
<li><a class="reference internal" href="#enabling-disabling-deprecated-warnings" id="id26">5.16 Enabling/disabling deprecated warnings</a></li>
<li><a class="reference internal" href="#disabling-deprecated-code" id="id27">5.17 Disabling deprecated code</a></li>
<li><a class="reference internal" href="#outputting-package-dependency-information" id="id28">5.18 Outputting package dependency information</a></li>
<li><a class="reference internal" href="#enabling-different-test-categories" id="id29">5.19 Enabling different test categories</a></li>
<li><a class="reference internal" href="#enabling-support-for-coverage-testing" id="id30">5.20 Enabling support for coverage testing</a></li>
<li><a class="reference internal" href="#viewing-configure-options-and-documentation" id="id31">5.21 Viewing configure options and documentation</a></li>
<li><a class="reference internal" href="#enabling-extra-repositories-with-add-on-packages" id="id32">5.22 Enabling extra repositories with add-on packages:</a></li>
<li><a class="reference internal" href="#enabling-extra-repositories-through-a-file" id="id33">5.23 Enabling extra repositories through a file</a></li>
<li><a class="reference internal" href="#reconfiguring-completely-from-scratch" id="id34">5.24 Reconfiguring completely from scratch</a></li>
<li><a class="reference internal" href="#viewing-configure-errors" id="id35">5.25 Viewing configure errors</a></li>
<li><a class="reference internal" href="#adding-configure-timers" id="id36">5.26 Adding configure timers</a></li>
<li><a class="reference internal" href="#generating-a-project-repo-version-file" id="id37">5.27 Generating a project repo version file</a></li>
<li><a class="reference internal" href="#cmake-configure-time-development-mode-and-debug-checking" id="id38">5.28 CMake configure-time development mode and debug checking</a></li>
</ul>
</li>
<li><a class="reference internal" href="#building-makefile-generator" id="id39">6 Building (Makefile generator)</a><ul class="auto-toc">
<li><a class="reference internal" href="#building-all-targets" id="id40">6.1 Building all targets</a></li>
<li><a class="reference internal" href="#discovering-what-targets-are-available-to-build" id="id41">6.2 Discovering what targets are available to build</a></li>
<li><a class="reference internal" href="#building-all-of-the-targets-for-a-package" id="id42">6.3 Building all of the targets for a package</a></li>
<li><a class="reference internal" href="#building-all-of-the-libraries-for-a-package" id="id43">6.4 Building all of the libraries for a package</a></li>
<li><a class="reference internal" href="#building-all-of-the-libraries-for-all-enabled-packages" id="id44">6.5 Building all of the libraries for all enabled packages</a></li>
<li><a class="reference internal" href="#building-a-single-object-file" id="id45">6.6 Building a single object file</a></li>
<li><a class="reference internal" href="#building-with-verbose-output-without-reconfiguring" id="id46">6.7 Building with verbose output without reconfiguring</a></li>
<li><a class="reference internal" href="#relink-a-target-without-considering-dependencies" id="id47">6.8 Relink a target without considering dependencies</a></li>
</ul>
</li>
<li><a class="reference internal" href="#testing-with-ctest" id="id48">7 Testing with CTest</a><ul class="auto-toc">
<li><a class="reference internal" href="#running-all-tests" id="id49">7.1 Running all tests</a></li>
<li><a class="reference internal" href="#only-running-tests-for-a-single-package" id="id50">7.2 Only running tests for a single package</a></li>
<li><a class="reference internal" href="#running-a-single-test-with-full-output-to-the-console" id="id51">7.3 Running a single test with full output to the console</a></li>
<li><a class="reference internal" href="#running-memory-checking" id="id52">7.4 Running memory checking</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installing" id="id53">8 Installing</a><ul class="auto-toc">
<li><a class="reference internal" href="#setting-the-install-prefix-at-configure-time" id="id54">8.1 Setting the install prefix at configure time</a></li>
<li><a class="reference internal" href="#avoiding-installing-libraries-and-headers" id="id55">8.2 Avoiding installing libraries and headers</a></li>
<li><a class="reference internal" href="#installing-the-software" id="id56">8.3 Installing the software</a></li>
</ul>
</li>
<li><a class="reference internal" href="#packaging" id="id57">9 Packaging</a><ul class="auto-toc">
<li><a class="reference internal" href="#creating-a-tarball-of-the-source-tree" id="id58">9.1 Creating a tarball of the source tree</a></li>
</ul>
</li>
<li><a class="reference internal" href="#dashboard-submissions" id="id59">10 Dashboard submissions</a></li>
</ul>
</div>
<div class="section" id="introduction">
<h1><a class="toc-backref" href="#id1">1 Introduction</a></h1>
<p>Trilinos contains a large number of packages that can be enabled and there is a fairly complex dependency tree of required and optional package enables. The following sections contain fairly generic information on how to configure, build, test, and install Trilinos that addresses a wide range of issues.</p>
<p>This is not the first document that a user should read when trying to set up to install Trilinos. For that, see the INSTALL.* file. There is a lot of information and activities mentioned in this quickref that most users (and even some Trilinos developers) will never need to know about.</p>
<p>Also, this particular quick reference has no information at all on what is actually in Trilinos. For that, go to:</p>
<blockquote>
<a class="reference external" href="http://trilinos.org">http://trilinos.org</a></blockquote>
<p>to get started.</p>
</div>
<div class="section" id="trilinos-specific-options">
<h1><a class="toc-backref" href="#id2">2 Trilinos-specific options</a></h1>
<p>Below, configure options specific to Trilinos are given. The later sections
give more generic options that are the same for all TriBITS projects.</p>
<div class="section" id="enabling-disabling-time-monitors">
<h2><a class="toc-backref" href="#id3">2.1 Enabling/disabling time monitors</a></h2>
<p>I order to enable instrumentation of select code to generate timing statistics, set:</p>
<pre class="literal-block">
-D <Project>_ENABLE_TEUCHOS_TIME_MONITOR:BOOL=ON
</pre>
<p>This will enable Teuchos time monitors by default in all Trilinos packages
that support them. To print the timers at the end of the program, call
<tt class="docutils literal"><span class="pre">Teuchos::TimeMonitor::summarize()</span></tt>.</p>
</div>
</div>
<div class="section" id="getting-set-up-to-use-cmake">
<h1><a class="toc-backref" href="#id4">3 Getting set up to use CMake</a></h1>
<p>Before one can configure Trilinos to be built, one must first obtain a
version of CMake on the system newer than 2.8.1 This guide assumes
that once CMake is installed that it will be in the default path with the name
<tt class="docutils literal">cmake</tt>.</p>
<div class="section" id="installing-a-binary-release-of-cmake-casual-users">
<h2><a class="toc-backref" href="#id5">3.1 Installing a binary release of CMake [casual users]</a></h2>
<p>Download and install the binary (version 2.8.1 or greater is
recommended) from:</p>
<blockquote>
<a class="reference external" href="http://www.cmake.org/cmake/resources/software.html">http://www.cmake.org/cmake/resources/software.html</a></blockquote>
</div>
<div class="section" id="installing-cmake-from-source-developers-and-experienced-users">
<h2><a class="toc-backref" href="#id6">3.2 Installing CMake from source [developers and experienced users]</a></h2>
<p>If you have access to the Trilinos git repositories, then install CMake with:</p>
<pre class="literal-block">
$ $TRIBITS_BASE_DIR/python/install-cmake.py \
--install-dir=<INSTALL_BASE_DIR> \
--do-all
</pre>
<p>This will result in cmake and related CMake tools being installed in
<INSTALL_BASE_DIR>/bin.</p>
<p>Getting help for installing CMake with this script:</p>
<pre class="literal-block">
$ $TRIBITS_BASE_DIR/python/install-cmake.py --help
</pre>
<p>NOTE: you will want to read the help message about how to use sudo to
install in a privileged location (like the default /usr/local/bin).</p>
</div>
</div>
<div class="section" id="getting-cmake-help">
<h1><a class="toc-backref" href="#id7">4 Getting CMake Help</a></h1>
<div class="section" id="finding-cmake-help-at-the-website">
<h2><a class="toc-backref" href="#id8">4.1 Finding CMake help at the website</a></h2>
<blockquote>
<a class="reference external" href="http://www.cmake.org">http://www.cmake.org</a></blockquote>
</div>
<div class="section" id="building-cmake-help-locally">
<h2><a class="toc-backref" href="#id9">4.2 Building CMake help locally</a></h2>
<p>To get help on CMake input options, run:</p>
<pre class="literal-block">
$ cmake --help
</pre>
<p>To get help on a single CMake function, run:</p>
<pre class="literal-block">
$ cmake --help-command <command>
</pre>
<p>To generate the entire documentation at once, run:</p>
<pre class="literal-block">
$ cmake --help-full cmake.help.html
</pre>
<p>(Open your web browser to the file cmake.help.html)</p>
</div>
</div>
<div class="section" id="configuring-makefile-generator">
<h1><a class="toc-backref" href="#id10">5 Configuring (Makefile Generator)</a></h1>
<p>While CMake supports a number of different build generators (e.g. Eclipes,
XCode, MS Visual Studio, etc.) the primary generator most people use on
Unix/Linix system is make and CMake generates exceptional Makefiles. The
materila in this section, while not exclusing to the makefile generator this
should be assumed as the default.</p>
<div class="section" id="setting-up-a-build-directory">
<h2><a class="toc-backref" href="#id11">5.1 Setting up a build directory</a></h2>
<p>In order to configure, one must set up a build directory. Trilinos does
<em>not</em> support in-source builds so the build tree must be seprate from the
source tree. The build tree can be created under the source tree such as
with:</p>
<pre class="literal-block">
$ $SOURCE_DIR
$ mkdir <SOME_BUILD_DIR>
$ cd <SOME_BUILD_DIR>
</pre>
<p>but it is generally recommended to create a build directory parallel from the
soruce tree.</p>
<p>NOTE: If you mistakenly try to configure for an in-source build (e.g. with
'cmake .') you will get an error message and instructions on how to resolve
the problem by deleting the generated CMakeCache.txt file (and other generated
files) and then follow directions on how to create a different build directory
as shown above.</p>
</div>
<div class="section" id="basic-configuration">
<h2><a class="toc-backref" href="#id12">5.2 Basic configuration</a></h2>
<ol class="loweralpha">
<li><p class="first">Create a 'do-configure' script such as [Recommended]:</p>
<pre class="literal-block">
EXTRA_ARGS=$@
cmake \
-D CMAKE_BUILD_TYPE:STRING=DEBUG \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
$EXTRA_ARGS \
${SOURCE_BASE}
</pre>
</li>
</ol>
<blockquote>
<p>and then run it with:</p>
<pre class="literal-block">
./do-configure [OTHER OPTIONS] -DTrilinos_ENABLE_<TRIBITS_PACKAGE>=ON
</pre>
<p>where <TRIBITS_PACKAGE> is Epetra, AztecOO, etc. and SOURCE_BASE is et
to the Trilinos source base directory (or your can just give it
explicitly).</p>
<p>See <cite>Trilinos/sampleScripts/*cmake</cite> for real examples.</p>
<p>NOTE: If one has already configured once and one needs to configure from
scratch (needs to wipe clean defaults for cache variables, updates
compilers, other types of changes) then one will want to delete the local
CASL and other CMake-generated files before configuring again (see
<a class="reference internal" href="#reconfiguring-completely-from-scratch">Reconfiguring completely from scratch</a>).</p>
</blockquote>
<ol class="loweralpha simple" start="2">
<li>Create a CMake file fragment and point to it [Recommended].</li>
</ol>
<blockquote>
<p>Create a do-configure script like:</p>
<pre class="literal-block">
EXTRA_ARGS=$@
cmake \
-D Trilinos_CONFIGURE_OPTIONS_FILE:FILEPATH=MyConfigureOptions.cmake \
-D Trilinos_ENABLE_TESTS:BOOL=ON \
$EXTRA_ARGS \
${SOURCE_BASE}
</pre>
<p>where MyConfigureOptions.cmake might look like:</p>
<pre class="literal-block">
SET(CMAKE_BUILD_TYPE DEBUG CACHE STRING "" FORCE)
SET(Trilinos_ENABLE_CHECKED_STL ON CACHE BOOL "" FORCE)
SET(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)
...
</pre>
<p>Using a configuration fragment file allows for better reuse of configure
options across different configure scripts and better version control of
configure options.</p>
<p>NOTE: You can actually pass in a list of configuration fragment files
which will be read in the order they are given.</p>
<p>NOTE: If you do not use 'FORCE' shown above, then the option can be
overridden on the cmake command line with -D options. Also, if you don't
use 'FORCE' then the option will not be set if it is already set in the
case (e.g. by another configuration fragment file prior in the list).</p>
</blockquote>
<ol class="loweralpha simple" start="3">
<li>Using ccmake to configure</li>
</ol>
<blockquote>
<pre class="literal-block">
$ ccmake $SOURCE_BASE
</pre>
</blockquote>
<ol class="loweralpha simple" start="4">
<li>Using the QT CMake configuration GUI:</li>
</ol>
<blockquote>
On systems where the QT CMake GUI is installed (e.g. Windows) the CMake GUI
can be a nice way to configure Trilinos if you are a user. To make your
configuration easily repeatable, you might want to create a fragment file
and just load it by setting Trilinos_CONFIGURE_OPTIONS_FILE (see above) in
the GUI.</blockquote>
</div>
<div class="section" id="selecting-the-list-of-packages-to-enable">
<h2><a class="toc-backref" href="#id13">5.3 Selecting the list of packages to enable</a></h2>
<ol class="loweralpha">
<li><p class="first">Configuring a package(s) along with all of the packages it can use:</p>
<pre class="literal-block">
$ ./do-configure \
-D Trilinos_ENABLE_<TRIBITS_PACKAGE>:BOOL=ON \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON \
-D Trilinos_ENABLE_TESTS:BOOL=ON
</pre>
</li>
</ol>
<blockquote>
<p>NOTE: This set of arguments allows a user to turn on <TRIBITS_PACKAGE> as well as
all packages that <TRIBITS_PACKAGE> can use. However, tests and examples will
only be turned on for <TRIBITS_PACKAGE> (or any other packages specifically
enabled).</p>
<p>NOTE: If a TriBITS package <TRIBITS_PACKAGE> has subpackages (e.g. <A>, <B>,
etc.), then enabling the package is equivalent to typing:</p>
<pre class="literal-block">
-D Trilinos_ENABLE_<TRIBITS_PACKAGE><A>:BOOL=ON \
-D Trilinos_ENABLE_<TRIBITS_PACKAGE><B>:BOOL=ON \
...
</pre>
<p>However, a TriBITS subpackage will only be enabled if it is not disabled
either explicitly or implicitly.</p>
</blockquote>
<ol class="loweralpha" start="2">
<li><p class="first">Configuring Trilinos to test all effects of changing a given package(s):</p>
<pre class="literal-block">
$ ./do-configure \
-D Trilinos_ENABLE_<TRIBITS_PACKAGE>:BOOL=ON \
-D Trilinos_ENABLE_ALL_FORWARD_DEP_PACKAGES:BOOL=ON \
-D Trilinos_ENABLE_TESTS:BOOL=ON
</pre>
</li>
</ol>
<blockquote>
NOTE: The above set of arguments will result in package <TRIBITS_PACKAGE>
and all packages that depend on <TRIBITS_PACKAGE> to be enabled and have all
of their tests turned on. Tests will not be enabled in packages that do not
depend on <TRIBITS_PACKAGE> in this case. This speeds up and robustifies
pre-checkin testing.</blockquote>
<ol class="loweralpha" start="3">
<li><p class="first">Configuring to build all stable packages with tests and examples:</p>
<pre class="literal-block">
$ ./do-configure \
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=ON \
-D Trilinos_ENABLE_TESTS:BOOL=ON
</pre>
</li>
</ol>
<blockquote>
<p>NOTE: Specific packages can be disabled with
Trilinos_ENABLE_<TRIBITS_PACKAGE>:BOOL=OFF. This will also disable all
packages that depend on <TRIBITS_PACKAGE>.</p>
<p>NOTE: All examples are enabled by default when setting
Trilinos_ENABLE_TESTS:BOOL=ON.</p>
<p>NOTE: By default, setting Trilinos_ENABLE_ALL_PACKAGES=ON only enables
Primary Stable Code. To have this also enable all secondary stable code,
you must also you must set Trilinos_ENABLE_SECONDARY_STABLE_CODE=ON.</p>
</blockquote>
<ol class="loweralpha" start="4">
<li><p class="first">Disable a package and all its dependencies:</p>
<pre class="literal-block">
$ ./do-configure \
-D Trilinos_ENABLE_<PACKAGE_A>:BOOL=ON \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON \
-D Trilinos_ENABLE_<PACKAGE_B>:BOOL=OFF
</pre>
</li>
</ol>
<blockquote>
<p>Above, this will enable <PACKAGE_A> and all of the packages that it
depends on except for <PACKAGE_B> and all of its forward dependencies.</p>
<p>NOTE: If a TriBITS package <TRIBITS_PACKAGE> has subpackages (e.g. <A>, <B>,
etc.), then disabling the package is equivalent to typing:</p>
<pre class="literal-block">
-D Trilinos_ENABLE_<TRIBITS_PACKAGE><A>:BOOL=OFF \
-D Trilinos_ENABLE_<TRIBITS_PACKAGE><B>:BOOL=OFF \
...
</pre>
<p>The disable of the subpackage is this case will override any enables.</p>
<p>NOTE: If a disabled package is a required dependency of some explicitly
enabled downstream package, then the configure will error out if
Trilinos_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=OFF. Otherwise, a WARNING
will be printed and the downstream package will be disabled and
configuration will continue.</p>
</blockquote>
<ol class="loweralpha simple" start="5">
<li>Removing all package enables in the Cache</li>
</ol>
<blockquote>
<pre class="literal-block">
$ ./-do-confiugre -D Trilinos_UNENABLE_ENABLED_PACKAGES:BOOL=TRUE
</pre>
<p>This option will set to empty '' all package enables, leaving all other
cache variables as they are. You can then reconfigure with a new set of
package enables for a different set of packages. This allows you to avoid
more expensive configure time checks and to preserve other cache variables
that you have set and don't want to loose.</p>
</blockquote>
</div>
<div class="section" id="selecting-compiler-and-linker-options">
<h2><a class="toc-backref" href="#id14">5.4 Selecting compiler and linker options</a></h2>
<p>The Trilinos TriBITS CMake build system offers the ability to tweak the
built-in CMake approach for setting compiler flags. When CMake creates the
object file build command for a given source file, it passes in flags to the
compiler in the order:</p>
<pre class="literal-block">
${CMAKE_<LANG>_FLAGS} ${CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE>}
</pre>
<p>where <tt class="docutils literal"><LANG></tt> = <tt class="docutils literal">C</tt>, <tt class="docutils literal">CXX</tt>, or <tt class="docutils literal">Fortran</tt> and <tt class="docutils literal"><CMAKE_BUILD_TYPE></tt> =
<tt class="docutils literal">DEBUG</tt> or <tt class="docutils literal">RELEASE</tt>. Note that the options in
<tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE></tt> come after and override those in
<tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt>! The flags in <tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> apply to all
build types. Optimization, debug, and other build-type-specific flags are set
in <tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE></tt>. CMake automatically provides a
default set of debug and release optimization flags for
<tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE></tt> (e.g. <tt class="docutils literal">CMAKE_CXX_FLAGS_DEBUG</tt> is
typically <tt class="docutils literal"><span class="pre">"-g</span> <span class="pre">-O0"</span></tt> while <tt class="docutils literal">CMAKE_CXX_FLAGS_RELEASE</tt> is typically
<tt class="docutils literal"><span class="pre">"-O3"</span></tt>). TriBITS provides a means for project and package developers and
users to set and override these compiler flag variables globally and on a
package-by-package basis. Below, the facilities for manipulating compiler
flags is described.</p>
<p>The Trilinos TriBiTS CMake build system will set up default compile flags for
GCC ('GNU') in development mode
(i.e. <tt class="docutils literal">Trilinos_ENABLE_DEVELOPMENT_MODE=ON</tt>) on order to help produce
portable code. These flags set up strong warning options and enforce langauge
standards. In release mode (i.e. <tt class="docutils literal">Trilinos_ENABLE_DEVELOPMENT_MODE=ON</tt>),
these flags are not set. These flags get set internally into the variables
<tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt>.</p>
<ol class="loweralpha simple">
<li>Configuring to build with default debug or release compiler flags:</li>
</ol>
<blockquote>
<p>To build a debug version, pass into 'cmake':</p>
<pre class="literal-block">
-D CMAKE_BUILD_TYPE:STRING=DEBUG
</pre>
<p>This will result in debug flags getting passed to the compiler according to
what is set in <tt class="docutils literal">CMAKE_<LANG>_FLAGS_DEBUG</tt>.</p>
<p>To build a release (optimized) version, pass into 'cmake':</p>
<pre class="literal-block">
-D CMAKE_BUILD_TYPE:STRING=RELEASE
</pre>
<p>This will result in optimized flags getting passed to the compiler according
to what is in <tt class="docutils literal">CMAKE_<LANG>_FLAGS_RELEASE</tt>.</p>
</blockquote>
<ol class="loweralpha simple" start="2">
<li>Adding arbitrary compiler flags but keeping other default flags:</li>
</ol>
<blockquote>
<p>To append arbitrary compiler flags to <tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> (which may be
set internally by TriBITS) that apply to all build types, configure with:</p>
<pre class="literal-block">
-D CMAKE_<LANG>_FLAGS:STRING="<EXTRA_COMPILER_OPTIONS>"
</pre>
<p>where <tt class="docutils literal"><EXTRA_COMPILER_OPTIONS></tt> are your extra compiler options like
<tt class="docutils literal"><span class="pre">"-DSOME_MACRO_TO_DEFINE</span> <span class="pre">-funroll-loops"</span></tt>. These options will get
appended to (i.e. come after) other internally defined compiler option and
therefore override them.</p>
<p>Options can also be targeted to a specific TriBITS package using:</p>
<pre class="literal-block">
-D <TRIBITS_PACKAGE>_<LANG>_FLAGS:STRING="<EXTRA_COMPILER_OPTIONS>"
</pre>
<p>The package-specific options get appened to those already in
<tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> and therefore override (but not replace) those set
globally in <tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> (either internally or by the user in the
cache).</p>
<p>NOTES:</p>
<p>1) Setting <tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> will override but will not replace any
other internally set flags in <tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> defined by the
Trilinos CMake system because these flags will come after those set
internally. To get rid of these project/TriBITS default flags, see below.</p>
<p>2) Given that CMake passes in flags in
<tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE></tt> after those in
<tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt>, this means that users setting the
<tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> and <tt class="docutils literal"><TRIBITS_PACKAGE>_<LANG>_FLAGS</tt> will <em>not</em>
override the flags in <tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE></tt> which come
after on the compile line. Therefore, setting <tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> and
<tt class="docutils literal"><TRIBITS_PACKAGE>_<LANG>_FLAGS</tt> should only be used for options that will
not get overridden by the debug or release compiler flags in
<tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE></tt>. However, setting
<tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> will work well for adding extra compiler defines
(e.g. -DSOMETHING) for example.</p>
<p>WARNING: Any options that you set through the cache variable
<tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE></tt> will get overridden in the
Trilinos CMake system for GNU compilers in development mode so don't try to
manually set CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE>! To override those
options, see <tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE>_OVERRIDE</tt>.</p>
</blockquote>
<ol class="loweralpha simple" start="3">
<li>Overriding CMAKE_BUILD_TYPE debug/release compiler options:</li>
</ol>
<blockquote>
<p>To override the default CMake-set options in
<tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE></tt>, use:</p>
<pre class="literal-block">
-D CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE>_OVERRIDE:STRING="<OPTIONS_TO_OVERRIDE>"
</pre>
<p>For example, to default debug options use:</p>
<pre class="literal-block">
-D CMAKE_C_FLAGS_DEBUG_OVERRIDE:STRING="-g -O1" \
-D CMAKE_CXX_FLAGS_DEBUG_OVERRIDE:STRING="-g -O1"
</pre>
<p>and to override default release options use:</p>
<pre class="literal-block">
-D CMAKE_C_FLAGS_RELEASE_OVERRIDE:STRING="-O3 -funroll-loops" \
-D CMAKE_CXX_FLAGS_RELEASE_OVERRIDE:STRING="-03 -fexceptions"
</pre>
<p>NOTES: The TriBITS CMake cache variable
<tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE>_OVERRIDE</tt> is used and not
<tt class="docutils literal">CMAKE_<LANG>_FLAGS_<CMAKE_BUILD_TYPE></tt> because is given a default
internally by CMake and the new varaible is needed to make the override
explicit.</p>
</blockquote>
<ol class="loweralpha simple" start="4">
<li>Appending arbitrary libraries and link flags every executable:</li>
</ol>
<blockquote>
<p>In order to append any set of arbitrary libraries and link flags to your
executables use:</p>
<pre class="literal-block">
-DTrilinos_EXTRA_LINK_FLAGS:STRING="<EXTRA_LINK_LIBRARIES>" \
-DCMAKE_EXE_LINKER_FLAGS:STRING="<EXTRA_LINK_FLAGG>"
</pre>
<p>Above, you can pass any type of library and they will always be the last
libraries listed, even after all of the TPLs.</p>
<p>NOTE: This is how you must set extra libraries like Fortran libraries and
MPI libraries (when using raw compilers). Please only use this variable
as a last resort.</p>
<p>NOTE: You must only pass in libraries in <tt class="docutils literal">Trilinos_EXTRA_LINK_FLAGS</tt> and
<em>not</em> arbitrary linker flags. To pass in extra linker flags that are not
libraries, use the built-in CMake variable <tt class="docutils literal">CMAKE_EXE_LINKER_FLAGS</tt>
instead. The TriBITS variable <tt class="docutils literal">Trilinos_EXTRA_LINK_FLAGS</tt> is badly named
in this respect but the name remains due to backward compatibility
requirements.</p>
</blockquote>
<ol class="loweralpha simple" start="5">
<li>Turning off strong warnings for individual packages:</li>
</ol>
<blockquote>
<p>To turn off strong warnings (for all langauges) for a given TriBITS
package, set:</p>
<pre class="literal-block">
-D <TRIBITS_PACKAGE>_DISABLE_STRONG_WARNINGS:BOOL=ON
</pre>
<p>This will only affect the compilation of the sources for
<tt class="docutils literal"><TRIBITS_PACKAGES></tt>, not warnings generated from the header files in
downstream packages or client code.</p>
</blockquote>
<ol class="loweralpha simple" start="6">
<li>Overriding all (strong warnings and debug/release) compiler options:</li>
</ol>
<blockquote>
<p>To override all compiler options, including both strong warning options
and debug/release options, configure with:</p>
<pre class="literal-block">
-D CMAKE_C_FLAGS:STRING="-O3 -funroll-loops" \
-D CMAKE_CXX_FLAGS:STRING="-03 -fexceptions" \
-D CMAKE_BUILD_TYPE:STRING=NONE \
-D Trilinos_ENABLE_STRONG_C_COMPILE_WARNINGS:BOOL=OFF \
-D Trilinos_ENABLE_STRONG_CXX_COMPILE_WARNINGS:BOOL=OFF \
-D Trilinos_ENABLE_SHADOW_WARNINGS:BOOL=OFF \
-D Trilinos_ENABLE_COVERAGE_TESTING:BOOL=OFF \
-D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF \
</pre>
<p>NOTE: Options like <tt class="docutils literal">Trilinos_ENABLE_SHADOW_WARNINGS</tt>,
<tt class="docutils literal">Trilinos_ENABLE_COVERAGE_TESTING</tt>, and <tt class="docutils literal">Trilinos_ENABLE_CHECKED_STL</tt>
do not need to be turned off by default but they are shown above to make it
clear what other CMake cache variables can add compiler and link arguments.</p>
<p>NOTE: By setting <tt class="docutils literal">CMAKE_BUILD_TYPE=NONE</tt>, then <tt class="docutils literal">CMAKE_<LANG>_FLAGS_NONE</tt>
will be empty and therefore the options set in <tt class="docutils literal">CMAKE_<LANG>_FLAGS</tt> will
be all that is passed in.</p>
</blockquote>
<ol class="loweralpha simple" start="7">
<li>Enable and disable shadowing warnings for all Trilinos packages:</li>
</ol>
<blockquote>
<p>To enable shadowing warnings for all Trilinos packages (that don't already
have them turned on) then use:</p>
<pre class="literal-block">
-D Trilinos_ENABLE_SHADOW_WARNINGS:BOOL=ON
</pre>
<p>To disable shadowing warnings for all Trilinos packages (even those that
have them turned on by default) then use:</p>
<pre class="literal-block">
-D Trilinos_ENABLE_SHADOW_WARNINGS:BOOL=OFF
</pre>
<p>NOTE: The default value is empty '' which lets each Trilinos package
decide for itself if shadowing warnings will be turned on or off for that
package.</p>
</blockquote>
<ol class="loweralpha simple" start="8">
<li>Removing warnings as errors for CLEANED packages:</li>
</ol>
<blockquote>
<p>To remove the -Werror flag (or some other flag that is set) from being
applied to compile CLEANED packages like Teuchos, set the following when
configuring:</p>
<pre class="literal-block">
-D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=""
</pre>
</blockquote>
</div>
<div class="section" id="enabling-support-for-c-11">
<h2><a class="toc-backref" href="#id15">5.5 Enabling support for C++11</a></h2>
<p>To enable support for C++11 in packages that support C++11 (either optionally
or required), configure with:</p>
<pre class="literal-block">
-D Trilinos_ENABLE_CXX11:BOOL=ON \
-D CMAKE_CXX_FLAGS:STRING=-std=c++11
</pre>
<p>where the C++ flags passed in may depend on the compiler you are using. This
will be followed by a set of configure-time tests to see if several C++11
features are actually supported by the configured C++ compiler and support
will be disabled if all of these features are not supported.</p>
</div>
<div class="section" id="disabling-the-fortran-compiler-and-all-fortran-code">
<h2><a class="toc-backref" href="#id16">5.6 Disabling the Fortran compiler and all Fortran code</a></h2>
<p>To disable the Fortran compiler and all Trilinos code that depends on Fortran
set:</p>
<pre class="literal-block">
-D Trilinos_ENABLE_Fortran:BOOL=OFF
</pre>
<p>NOTE: The fortran compiler may be disabled automatically by default on
systems like MS Windows.</p>
<p>NOTE: Most Apple Macs do not come with a compatible Fortran compiler by
default so you must turn off Fortran if you don't have a compatible Fortran
compiler.</p>
</div>
<div class="section" id="enabling-runtime-debug-checking">
<h2><a class="toc-backref" href="#id17">5.7 Enabling runtime debug checking</a></h2>
<ol class="loweralpha simple">
<li>Enabling Trilinos ifdefed runtime debug checking:</li>
</ol>
<blockquote>
<p>To turn on optional ifdefed runtime debug checking, configure with:</p>
<pre class="literal-block">
-D Trilinos_ENABLE_DEBUG=ON
</pre>
<p>This will result in a number of ifdefs to be enabled that will perform a
number of runtime checks. Nearly all of the debug checks in Trilinos will
get turned on by default by setting this option. This option can be set
independent of <tt class="docutils literal">CMAKE_BUILD_TYPE</tt> (which sets the compiler debug/release
options).</p>
<p>NOTES:</p>
<ul class="simple">
<li>The variable <tt class="docutils literal">CMAKE_BUILD_TYPE</tt> controls what compiler options are
passed to the compiler by default while <tt class="docutils literal">Trilinos_ENABLE_DEBUG</tt>
controls what defines are set in config.h files that control ifdefed debug
checks.</li>
<li>Setting <tt class="docutils literal"><span class="pre">-DCMAKE_BUILD_TYPE:STRING=DEBUG</span></tt> will automatically set the
default <tt class="docutils literal">Trilinos_ENABLE_DEBUG=ON</tt>.</li>
</ul>
</blockquote>
<ol class="loweralpha simple" start="2">
<li>Enabling checked STL implementation:</li>
</ol>
<blockquote>
<p>To turn on the checked STL implementation set:</p>
<pre class="literal-block">
-D Trilinos_ENABLE_CHECKED_STL:BOOL=ON
</pre>
<p>NOTES:</p>
<ul class="simple">
<li>By default, this will set -D_GLIBCXX_DEBUG as a compile option for all C++
code. This only works with GCC currently.</li>
<li>This option is disabled by default because to enable it by default can
cause runtime segfaults when linked against C++ code that was compiled
without -D_GLIBCXX_DEBUG.</li>
</ul>
</blockquote>
</div>
<div class="section" id="configuring-with-mpi-support">
<h2><a class="toc-backref" href="#id18">5.8 Configuring with MPI support</a></h2>
<p>To enable MPI support you must minimally set:</p>
<pre class="literal-block">
-D TPL_ENABLE_MPI:BOOL=ON
</pre>
<p>There is built-in logic to try to find the various MPI components on your
system but you can override (or make suggestions) with:</p>
<pre class="literal-block">
-D MPI_BASE_DIR:PATH="path"
</pre>
<p>(Base path of a standard MPI installation which has the subdirs 'bin', 'libs',
'include' etc.)</p>
<p>or:</p>
<pre class="literal-block">
-D MPI_BIN_DIR:PATH="path1;path2;...;pathn"
</pre>
<p>which sets the paths where the MPI executables (e.g. mpiCC, mpicc, mpirun,
mpiexec) can be found. By default this is set to <tt class="docutils literal"><span class="pre">${MPI_BASE_DIR}/bin</span></tt> if
<tt class="docutils literal">MPI_BASE_DIR</tt> is set.</p>
<p>The value of <tt class="docutils literal">LD_LIBRARY_PATH</tt> will also automatically be set to
<tt class="docutils literal"><span class="pre">${MPI_BASE_DIR}/lib</span></tt> if it exists. This is needed for the basic compiler
tests for some MPI implementations that are installed in non-standard
locations.</p>
<p>There are several different different variations for configuring with MPI
support:</p>
<ol class="loweralpha simple">
<li><strong>Configuring build using MPI compiler wrappers:</strong></li>
</ol>
<blockquote>
<p>The MPI compiler wrappers are turned on by default. There is built-in
logic that will try to find the right compiler wrappers. However, you can
specifically select them by setting, for example:</p>
<pre class="literal-block">
-D MPI_C_COMPILER:FILEPATH=mpicc \
-D MPI_CXX_COMPILER:FILEPATH=mpic++ \
-D MPI_Fortan_COMPILER:FILEPATH=mpif77
</pre>