File: install.html

package info (click to toggle)
petsc 3.23.1%2Bdfsg1-1exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 515,576 kB
  • sloc: ansic: 751,607; cpp: 51,542; python: 38,598; f90: 17,352; javascript: 3,493; makefile: 3,157; sh: 1,502; xml: 619; objc: 445; java: 13; csh: 1
file content (1321 lines) | stat: -rw-r--r-- 98,559 bytes parent folder | download
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321

<!DOCTYPE html>


<html lang="en" data-content_root="../" >

  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>Configuring PETSc &#8212; PETSc 3.23.1 documentation</title>
  
  
  
  <script data-cfasync="false">
    document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
    document.documentElement.dataset.theme = localStorage.getItem("theme") || "light";
  </script>
  
  <!-- Loaded before other Sphinx assets -->
  <link href="../_static/styles/theme.css?digest=bd9e20870c6007c4c509" rel="stylesheet" />
<link href="../_static/styles/bootstrap.css?digest=bd9e20870c6007c4c509" rel="stylesheet" />
<link href="../_static/styles/pydata-sphinx-theme.css?digest=bd9e20870c6007c4c509" rel="stylesheet" />

  
  <link href="../_static/vendor/fontawesome/6.5.1/css/all.min.css?digest=bd9e20870c6007c4c509" rel="stylesheet" />
  <link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.1/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.1/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="../_static/vendor/fontawesome/6.5.1/webfonts/fa-regular-400.woff2" />

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=8f2a1f02" />
    <link rel="stylesheet" type="text/css" href="../_static/copybutton.css?v=76b2166b" />
    <link rel="stylesheet" type="text/css" href="../_static/sphinx-design.min.css?v=87e54e7c" />
    <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" />
    <link rel="stylesheet" type="text/css" href="../_static/katex-math.css?v=91adb8b6" />
    <link rel="stylesheet" type="text/css" href="../_static/css/custom.css?v=dbe1606d" />
  
  <!-- Pre-loaded scripts that we'll load fully later -->
  <link rel="preload" as="script" href="../_static/scripts/bootstrap.js?digest=bd9e20870c6007c4c509" />
<link rel="preload" as="script" href="../_static/scripts/pydata-sphinx-theme.js?digest=bd9e20870c6007c4c509" />
  <script src="../_static/vendor/fontawesome/6.5.1/js/all.min.js?digest=bd9e20870c6007c4c509"></script>

    <script src="../_static/documentation_options.js?v=34da53a5"></script>
    <script src="../_static/doctools.js?v=9a2dae69"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="../_static/clipboard.min.js?v=a7894cd8"></script>
    <script src="../_static/copybutton.js?v=a56c686a"></script>
    <script src="../_static/design-tabs.js?v=f930bc37"></script>
    <script src="../_static/katex.min.js?v=be8ff15f"></script>
    <script src="../_static/auto-render.min.js?v=ad136472"></script>
    <script src="../_static/katex_autorenderer.js?v=bebc588a"></script>
    <script>DOCUMENTATION_OPTIONS.pagename = 'install/install';</script>
    <link rel="icon" href="../_static/petsc_favicon.png"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Installing PETSc On Microsoft Windows" href="windows.html" />
    <link rel="prev" title="Quick Start Tutorial" href="install_tutorial.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta name="docsearch:language" content="en"/>
    <meta name="docbuild:last-update" content="2025-04-30T13:10:40-0500 (v3.23.1)"/>
  </head>
  
  
  <body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">

  
  
  <a id="pst-skip-link" class="skip-link" href="#main-content">Skip to main content</a>
  
  <div id="pst-scroll-pixel-helper"></div>

  
  <button type="button" class="btn rounded-pill" id="pst-back-to-top">
    <i class="fa-solid fa-arrow-up"></i>
    Back to top
  </button>

  
  <input type="checkbox"
          class="sidebar-toggle"
          name="__primary"
          id="__primary"/>
  <label class="overlay overlay-primary" for="__primary"></label>
  
  <input type="checkbox"
          class="sidebar-toggle"
          name="__secondary"
          id="__secondary"/>
  <label class="overlay overlay-secondary" for="__secondary"></label>
  
  <div class="search-button__wrapper">
    <div class="search-button__overlay"></div>
    <div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
      action="../search.html"
      method="get">
  <i class="fa-solid fa-magnifying-glass"></i>
  <input type="search"
         class="form-control"
         name="q"
         id="search-input"
         placeholder="Search the docs ..."
         aria-label="Search the docs ..."
         autocomplete="off"
         autocorrect="off"
         autocapitalize="off"
         spellcheck="false"/>
  <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
  </div>

  <header>
  
    <div class="bd-header navbar navbar-expand-lg bd-navbar">
<div class="bd-header__inner bd-page-width">
  <label class="sidebar-toggle primary-toggle" for="__primary">
    <span class="fa-solid fa-bars"></span>
  </label>
  
  
  <div class="col-lg-3 navbar-header-items__start">
    
      <div class="navbar-item">

  

<a class="navbar-brand logo" href="../index.html">
  
  
  
  
  
    
    
      
    
    
    <img src="../_static/PETSc-TAO_RGB.svg" class="logo__image only-light" alt="PETSc 3.23.1 documentation - Home"/>
    <script>document.write(`<img src="../_static/PETSc-TAO_RGB_white.svg" class="logo__image only-dark" alt="PETSc 3.23.1 documentation - Home"/>`);</script>
  
  
</a></div>
    
  </div>
  
  <div class="col-lg-9 navbar-header-items">
    
    <div class="me-auto navbar-header-items__center">
      
        <div class="navbar-item">
<nav class="navbar-nav">
  <ul class="bd-navbar-elements navbar-nav">
    
                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../overview/index.html">
                        Overview
                      </a>
                    </li>
                

                    <li class="nav-item current active">
                      <a class="nav-link nav-internal" href="index.html">
                        Install
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../tutorials/index.html">
                        Tutorials
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../manual/index.html">
                        User-Guide
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../manualpages/index.html">
                        C/Fortran API
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../petsc4py/index.html">
                        petsc4py API
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../faq/index.html">
                        FAQ
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../community/index.html">
                        Community
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../developers/index.html">
                        Developers
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../miscellaneous/index.html">
                        Misc.
                      </a>
                    </li>
                
  </ul>
</nav></div>
      
    </div>
    
    
    <div class="navbar-header-items__end">
      
        <div class="navbar-item navbar-persistent--container">
          

 <script>
 document.write(`
   <button class="btn navbar-btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="fa-solid fa-magnifying-glass"></i>
    <span class="search-button__default-text">Search</span>
    <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
   </button>
 `);
 </script>
        </div>
      
      
        <div class="navbar-item">

<script>
document.write(`
  <button class="btn btn-sm navbar-btn theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <span class="theme-switch nav-link" data-mode="light"><i class="fa-solid fa-sun fa-lg"></i></span>
    <span class="theme-switch nav-link" data-mode="dark"><i class="fa-solid fa-moon fa-lg"></i></span>
    <span class="theme-switch nav-link" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg"></i></span>
  </button>
`);
</script></div>
      
        <div class="navbar-item"><ul class="navbar-icon-links navbar-nav"
    aria-label="Icon Links">
        <li class="nav-item">
          
          
          
          
          
          
          
          
          <a href="https://gitlab.com/petsc/petsc" title="GitLab" class="nav-link" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><span><i class="fab fa-gitlab fa-lg" aria-hidden="true"></i></span>
            <span class="sr-only">GitLab</span></a>
        </li>
</ul></div>
      
    </div>
    
  </div>
  
  
    <div class="navbar-persistent--mobile">

 <script>
 document.write(`
   <button class="btn navbar-btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="fa-solid fa-magnifying-glass"></i>
    <span class="search-button__default-text">Search</span>
    <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
   </button>
 `);
 </script>
    </div>
  

  
    <label class="sidebar-toggle secondary-toggle" for="__secondary" tabindex="0">
      <span class="fa-solid fa-outdent"></span>
    </label>
  
</div>

    </div>
  
  </header>

  <div class="bd-container">
    <div class="bd-container__inner bd-page-width">
      
      
      
      <div class="bd-sidebar-primary bd-sidebar">
        

  
  <div class="sidebar-header-items sidebar-primary__section">
    
    
      <div class="sidebar-header-items__center">
        
          <div class="navbar-item">
<nav class="navbar-nav">
  <ul class="bd-navbar-elements navbar-nav">
    
                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../overview/index.html">
                        Overview
                      </a>
                    </li>
                

                    <li class="nav-item current active">
                      <a class="nav-link nav-internal" href="index.html">
                        Install
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../tutorials/index.html">
                        Tutorials
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../manual/index.html">
                        User-Guide
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../manualpages/index.html">
                        C/Fortran API
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../petsc4py/index.html">
                        petsc4py API
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../faq/index.html">
                        FAQ
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../community/index.html">
                        Community
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../developers/index.html">
                        Developers
                      </a>
                    </li>
                

                    <li class="nav-item">
                      <a class="nav-link nav-internal" href="../miscellaneous/index.html">
                        Misc.
                      </a>
                    </li>
                
  </ul>
</nav></div>
        
      </div>
    
    
    
      <div class="sidebar-header-items__end">
        
          <div class="navbar-item">

<script>
document.write(`
  <button class="btn btn-sm navbar-btn theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <span class="theme-switch nav-link" data-mode="light"><i class="fa-solid fa-sun fa-lg"></i></span>
    <span class="theme-switch nav-link" data-mode="dark"><i class="fa-solid fa-moon fa-lg"></i></span>
    <span class="theme-switch nav-link" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg"></i></span>
  </button>
`);
</script></div>
        
          <div class="navbar-item"><ul class="navbar-icon-links navbar-nav"
    aria-label="Icon Links">
        <li class="nav-item">
          
          
          
          
          
          
          
          
          <a href="https://gitlab.com/petsc/petsc" title="GitLab" class="nav-link" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><span><i class="fab fa-gitlab fa-lg" aria-hidden="true"></i></span>
            <span class="sr-only">GitLab</span></a>
        </li>
</ul></div>
        
      </div>
    
  </div>
  
    <div class="sidebar-primary-items__start sidebar-primary__section">
        <div class="sidebar-primary-item">
<nav class="bd-docs-nav bd-links"
     aria-label="Section Navigation">
  <p class="bd-links__title" role="heading" aria-level="1">Section Navigation</p>
  <div class="bd-toc-item navbar-nav"><ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="download.html">Download</a></li>
<li class="toctree-l1"><a class="reference internal" href="install_tutorial.html">Quick Start Tutorial</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Configuring PETSc</a></li>
<li class="toctree-l1"><a class="reference internal" href="windows.html">Installing PETSc On Microsoft Windows</a></li>
<li class="toctree-l1"><a class="reference internal" href="multibuild.html">Maintaining Your PETSc Installation(s)</a></li>
<li class="toctree-l1"><a class="reference internal" href="external_software.html">Supported External Software</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
</ul>
</div>
</nav></div>
    </div>
  
  
  <div class="sidebar-primary-items__end sidebar-primary__section">
  </div>
  
  <div id="rtd-footer-container"></div>


      </div>
      
      <main id="main-content" class="bd-main">
        
        
          <div class="bd-content">
            <div class="bd-article-container">
              
              <div class="bd-header-article">
<div class="header-article-items header-article__inner">
  
    <div class="header-article-items__start">
      
        <div class="header-article-item">



<nav aria-label="Breadcrumb">
  <ul class="bd-breadcrumbs">
    
    <li class="breadcrumb-item breadcrumb-home">
      <a href="../index.html" class="nav-link" aria-label="Home">
        <i class="fa-solid fa-home"></i>
      </a>
    </li>
    
    <li class="breadcrumb-item"><a href="index.html" class="nav-link">Install</a></li>
    
    <li class="breadcrumb-item active" aria-current="page">Configuring PETSc</li>
  </ul>
</nav>
</div>
      
    </div>
  
  
</div>
</div>
              
              
              
                
<div id="searchbox"></div>
                <article class="bd-article">
                  
  <section class="tex2jax_ignore mathjax_ignore" id="configuring-petsc">
<span id="doc-config-faq"></span><h1>Configuring PETSc<a class="headerlink" href="#configuring-petsc" title="Link to this heading">#</a></h1>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Obtain PETSc via the repository or download the latest tarball: <a class="reference internal" href="download.html#doc-download"><span class="std std-ref">download documentation</span></a>.</p>
<p>See <a class="reference internal" href="install_tutorial.html#tut-install"><span class="std std-ref">quick-start tutorial</span></a> for a step-by-step walk-through of the installation process.</p>
</div>
<nav class="contents local" id="table-of-contents">
<p class="topic-title">Table of Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#common-example-usages" id="id5">Common Example Usages</a></p></li>
<li><p><a class="reference internal" href="#compilers" id="id6">Compilers</a></p></li>
<li><p><a class="reference internal" href="#external-packages" id="id7">External Packages</a></p></li>
<li><p><a class="reference internal" href="#blas-lapack" id="id8">BLAS/LAPACK</a></p></li>
<li><p><a class="reference internal" href="#mpi" id="id13">MPI</a></p></li>
<li><p><a class="reference internal" href="#installing-on-macos" id="id14">Installing On macOS</a></p></li>
<li><p><a class="reference internal" href="#installation-location-in-place-or-out-of-place" id="id15">Installation Location: In-place or Out-of-place</a></p></li>
<li><p><a class="reference internal" href="#installing-on-machine-requiring-cross-compiler-or-a-job-scheduler" id="id16">Installing On Machine Requiring Cross Compiler Or A Job Scheduler</a></p></li>
<li><p><a class="reference internal" href="#installing-with-tau-instrumentation-package" id="id17">Installing With TAU Instrumentation Package</a></p></li>
<li><p><a class="reference internal" href="#installing-petsc-to-use-gpus-and-accelerators" id="id18">Installing PETSc To Use GPUs And Accelerators</a></p></li>
<li><p><a class="reference internal" href="#installing-to-run-in-browser-with-emscripten" id="id19">Installing To Run in Browser with Emscripten</a></p></li>
<li><p><a class="reference internal" href="#installing-on-large-scale-doe-systems" id="id20">Installing On Large Scale DOE Systems</a></p></li>
</ul>
</nav>
<section id="common-example-usages">
<h2><a class="toc-backref" href="#id5" role="doc-backlink">Common Example Usages</a><a class="headerlink" href="#common-example-usages" title="Link to this heading">#</a></h2>
<div class="admonition attention">
<p class="admonition-title">Attention</p>
<p>There are many example <code class="docutils notranslate"><span class="pre">configure</span></code> scripts at <code class="docutils notranslate"><span class="pre">config/examples/*.py</span></code>. These cover a
wide variety of systems, and we use some of these scripts locally for testing. One can
modify these files and run them in lieu of writing one yourself. For example:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./config/examples/arch-ci-osx-dbg.py
</pre></div>
</div>
<p>If there is a system for which we do not yet have such a <code class="docutils notranslate"><span class="pre">configure</span></code> script and/or
the script in the examples directory is outdated we welcome your feedback by submitting
your recommendations to <a class="reference external" href="mailto:petsc-maint&#37;&#52;&#48;mcs&#46;anl&#46;gov">mailto:petsc-maint<span>&#64;</span>mcs<span>&#46;</span>anl<span>&#46;</span>gov</a>. See bug report <a class="reference internal" href="../community/mailing.html#doc-creepycrawly"><span class="std std-ref">documentation</span></a> for more information.</p>
</div>
<ul>
<li><p>If you do not have a Fortran compiler or <a class="reference external" href="https://www.mpich.org/">MPICH</a> installed
locally (and want to use PETSc from C only).</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>gcc<span class="w"> </span>--with-cxx<span class="o">=</span><span class="m">0</span><span class="w"> </span>--with-fc<span class="o">=</span><span class="m">0</span><span class="w"> </span>--download-f2cblaslapack<span class="w"> </span>--download-mpich
</pre></div>
</div>
</li>
<li><p>Same as above - but install in a user specified (prefix) location.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--prefix<span class="o">=</span>/home/user/soft/petsc-install<span class="w"> </span>--with-cc<span class="o">=</span>gcc<span class="w"> </span>--with-cxx<span class="o">=</span><span class="m">0</span><span class="w"> </span>--with-fc<span class="o">=</span><span class="m">0</span><span class="w"> </span>--download-f2cblaslapack<span class="w"> </span>--download-mpich
</pre></div>
</div>
</li>
<li><p>If <a class="reference external" href="https://www.netlib.org/lapack/lug/node11.html">BLAS/LAPACK</a>, MPI sources (in “-devel” packages in most Linux distributions) are already
installed in default system/compiler locations and <code class="docutils notranslate"><span class="pre">mpicc</span></code>, <code class="docutils notranslate"><span class="pre">mpif90</span></code>, mpiexec are available
via <code class="docutils notranslate"><span class="pre">$PATH</span></code> - configure does not require any additional options.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure
</pre></div>
</div>
</li>
<li><p>If <a class="reference external" href="https://www.netlib.org/lapack/lug/node11.html">BLAS/LAPACK</a>, MPI are already installed in known user location use:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-blaslapack-dir<span class="o">=</span>/usr/local/blaslapack<span class="w"> </span>--with-mpi-dir<span class="o">=</span>/usr/local/mpich
</pre></div>
</div>
<p>or</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-blaslapack-dir<span class="o">=</span>/usr/local/blaslapack<span class="w"> </span>--with-cc<span class="o">=</span>/usr/local/mpich/bin/mpicc<span class="w"> </span>--with-mpi-f90<span class="o">=</span>/usr/local/mpich/bin/mpif90<span class="w"> </span>--with-mpiexec<span class="o">=</span>/usr/local/mpich/bin/mpiexec
</pre></div>
</div>
</li>
</ul>
<div class="yellow admonition">
<p class="admonition-title">Note</p>
<p>The configure options <code class="docutils notranslate"><span class="pre">CFLAGS</span></code>, <code class="docutils notranslate"><span class="pre">CXXFLAGS</span></code>, and <code class="docutils notranslate"><span class="pre">FFLAGS</span></code> overwrite most of the flags that PETSc would use by default. This is generally undesirable. To
add to the default flags instead use <code class="docutils notranslate"><span class="pre">COPTFLAGS</span></code>, <code class="docutils notranslate"><span class="pre">CXXOPTFLAGS</span></code>, and <code class="docutils notranslate"><span class="pre">FOPTFLAGS</span></code> (these work for all uses of ./configure). The same holds for
<code class="docutils notranslate"><span class="pre">CUDAFLAGS</span></code>, <code class="docutils notranslate"><span class="pre">HIPFLAGS</span></code>, and <code class="docutils notranslate"><span class="pre">SYCLFLAGS</span></code>.</p>
</div>
<div class="yellow admonition">
<p class="admonition-title">Note</p>
<p>Do not specify <code class="docutils notranslate"><span class="pre">--with-cc</span></code>, <code class="docutils notranslate"><span class="pre">--with-fc</span></code> etc for the above when using
<code class="docutils notranslate"><span class="pre">--with-mpi-dir</span></code> - so that <code class="docutils notranslate"><span class="pre">mpicc</span></code>/ <code class="docutils notranslate"><span class="pre">mpif90</span></code> will be picked up from mpi-dir!</p>
</div>
<ul>
<li><p>Build Complex version of PETSc (using c++ compiler):</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>gcc<span class="w"> </span>--with-fc<span class="o">=</span>gfortran<span class="w"> </span>--with-cxx<span class="o">=</span>g++<span class="w"> </span>--with-clanguage<span class="o">=</span>cxx<span class="w"> </span>--download-fblaslapack<span class="w"> </span>--download-mpich<span class="w"> </span>--with-scalar-type<span class="o">=</span>complex
</pre></div>
</div>
</li>
<li><p>Install 2 variants of PETSc, one with gnu, the other with Intel compilers. Specify
different <code class="docutils notranslate"><span class="pre">$PETSC_ARCH</span></code> for each build. See multiple PETSc install <a class="reference internal" href="multibuild.html#doc-multi"><span class="std std-ref">documentation</span></a> for further recommendations:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span><span class="nv">PETSC_ARCH</span><span class="o">=</span>linux-gnu<span class="w"> </span>--with-cc<span class="o">=</span>gcc<span class="w"> </span>--with-cxx<span class="o">=</span>g++<span class="w"> </span>--with-fc<span class="o">=</span>gfortran<span class="w"> </span>--download-mpich
<span class="gp">$ </span>make<span class="w"> </span><span class="nv">PETSC_ARCH</span><span class="o">=</span>linux-gnu<span class="w"> </span>all<span class="w"> </span><span class="nb">test</span>
<span class="gp">$ </span>./configure<span class="w"> </span><span class="nv">PETSC_ARCH</span><span class="o">=</span>linux-gnu-intel<span class="w"> </span>--with-cc<span class="o">=</span>icc<span class="w"> </span>--with-cxx<span class="o">=</span>icpc<span class="w"> </span>--with-fc<span class="o">=</span>ifort<span class="w"> </span>--download-mpich<span class="w"> </span>--with-blaslapack-dir<span class="o">=</span>/usr/local/mkl
<span class="gp">$ </span>make<span class="w"> </span><span class="nv">PETSC_ARCH</span><span class="o">=</span>linux-gnu-intel<span class="w"> </span>all<span class="w"> </span><span class="nb">test</span>
</pre></div>
</div>
</li>
</ul>
</section>
<section id="compilers">
<span id="doc-config-compilers"></span><h2><a class="toc-backref" href="#id6" role="doc-backlink">Compilers</a><a class="headerlink" href="#compilers" title="Link to this heading">#</a></h2>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>If no compilers are specified - configure will automatically look for available MPI or
regular compilers in the user’s <code class="docutils notranslate"><span class="pre">$PATH</span></code> in the following order:</p>
<ol class="arabic simple">
<li><p><code class="docutils notranslate"><span class="pre">mpicc</span></code>/<code class="docutils notranslate"><span class="pre">mpicxx</span></code>/<code class="docutils notranslate"><span class="pre">mpif90</span></code></p></li>
<li><p><code class="docutils notranslate"><span class="pre">gcc</span></code>/<code class="docutils notranslate"><span class="pre">g++</span></code>/<code class="docutils notranslate"><span class="pre">gfortran</span></code></p></li>
<li><p><code class="docutils notranslate"><span class="pre">cc</span></code>/<code class="docutils notranslate"><span class="pre">CC</span></code> etc..</p></li>
</ol>
</div>
<ul>
<li><p>Specify compilers using the options <code class="docutils notranslate"><span class="pre">--with-cc</span></code>/<code class="docutils notranslate"><span class="pre">--with-cxx</span></code>/<code class="docutils notranslate"><span class="pre">--with-fc</span></code> for c,
c++, and fortran compilers respectively:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>gcc<span class="w"> </span>--with-cxx<span class="o">=</span>g++<span class="w"> </span>--with-fc<span class="o">=</span>gfortran
</pre></div>
</div>
</li>
</ul>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>It’s best to use MPI compiler wrappers <a class="footnote-reference brackets" href="#id9" id="id1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a>. This can be done by either specifying
<code class="docutils notranslate"><span class="pre">--with-cc=mpicc</span></code> or <code class="docutils notranslate"><span class="pre">--with-mpi-dir</span></code> (and not <code class="docutils notranslate"><span class="pre">--with-cc=gcc</span></code>)</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>mpicc<span class="w"> </span>--with-cxx<span class="o">=</span>mpicxx<span class="w"> </span>--with-fc<span class="o">=</span>mpif90
</pre></div>
</div>
<p>or the following (but <strong>without</strong> <code class="docutils notranslate"><span class="pre">--with-cc=gcc</span></code>)</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-mpi-dir<span class="o">=</span>/opt/mpich2-1.1
</pre></div>
</div>
<p>See <a class="reference internal" href="#doc-config-mpi"><span class="std std-ref">MPI</span></a> for details on how to select specific MPI compiler wrappers or the
specific compiler used by the MPI compiler wrapper.</p>
</div>
<ul>
<li><p>If a Fortran compiler is not available or not needed - disable using:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-fc<span class="o">=</span><span class="m">0</span>
</pre></div>
</div>
</li>
<li><p>If a c++ compiler is not available or not needed - disable using:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cxx<span class="o">=</span><span class="m">0</span>
</pre></div>
</div>
</li>
</ul>
<p><code class="docutils notranslate"><span class="pre">configure</span></code> defaults to building PETSc in debug mode. One can switch to optimized
mode with the <code class="docutils notranslate"><span class="pre">configure</span></code> option <code class="docutils notranslate"><span class="pre">--with-debugging=0</span></code> (we suggest using a different
<code class="docutils notranslate"><span class="pre">$PETSC_ARCH</span></code> for debug and optimized builds, for example arch-debug and arch-opt, this
way you can switch between debugging your code and running for performance by simply
changing the value of <code class="docutils notranslate"><span class="pre">$PETSC_ARCH</span></code>). See multiple install <a class="reference internal" href="multibuild.html#doc-multi"><span class="std std-ref">documentation</span></a> for further details.</p>
<p>Additionally one can specify more suitable optimization flags with the options
<code class="docutils notranslate"><span class="pre">COPTFLAGS</span></code>, <code class="docutils notranslate"><span class="pre">FOPTFLAGS</span></code>, <code class="docutils notranslate"><span class="pre">CXXOPTFLAGS</span></code>. For example when using gnu compilers with
corresponding optimization flags:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>gcc<span class="w"> </span>--with-cxx<span class="o">=</span>g++<span class="w"> </span>--with-fc<span class="o">=</span>gfortran<span class="w"> </span>--with-debugging<span class="o">=</span><span class="m">0</span><span class="w"> </span><span class="nv">COPTFLAGS</span><span class="o">=</span><span class="s1">&#39;-O3 -march=native -mtune=native&#39;</span><span class="w"> </span><span class="nv">CXXOPTFLAGS</span><span class="o">=</span><span class="s1">&#39;-O3 -march=native -mtune=native&#39;</span><span class="w"> </span><span class="nv">FOPTFLAGS</span><span class="o">=</span><span class="s1">&#39;-O3 -march=native -mtune=native&#39;</span><span class="w"> </span>--download-mpich
</pre></div>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p><code class="docutils notranslate"><span class="pre">configure</span></code> cannot detect compiler libraries for certain set of compilers. In this
case one can specify additional system/compiler libraries using the <code class="docutils notranslate"><span class="pre">LIBS</span></code> option:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--LIBS<span class="o">=</span><span class="s1">&#39;-ldl /usr/lib/libm.a&#39;</span>
</pre></div>
</div>
</div>
</section>
<section id="external-packages">
<span id="doc-config-externalpack"></span><h2><a class="toc-backref" href="#id7" role="doc-backlink">External Packages</a><a class="headerlink" href="#external-packages" title="Link to this heading">#</a></h2>
<div class="yellow admonition">
<p class="admonition-title">Note</p>
<p><a class="reference external" href="https://www.netlib.org/lapack/lug/node11.html">BLAS/LAPACK</a> is the only <strong>required</strong> <a class="reference internal" href="external_software.html#doc-externalsoftware"><span class="std std-ref">external package</span></a>
(other than of course build tools such as compilers and <code class="docutils notranslate"><span class="pre">make</span></code>). PETSc may be built
and run without MPI support if processing only in serial.</p>
<p>For any <a class="reference internal" href="external_software.html#doc-externalsoftware"><span class="std std-ref">external packages</span></a> used with PETSc we highly
recommend you have PETSc download and install the packages, rather than you installing
them separately first. This insures that:</p>
<ul class="simple">
<li><p>The packages are installed with the same compilers and compiler options as PETSc
so that they can work together.</p></li>
<li><p>A <strong>compatible</strong> version of the package is installed. A generic install of this
package might not be compatible with PETSc (perhaps due to version differences - or
perhaps due to the requirement of additional patches for it to work with PETSc).</p></li>
<li><p>Some packages have bug fixes, portability patches, and upgrades for dependent
packages that have not yet been included in an upstream release, and hence may not
play nice with PETSc.</p></li>
</ul>
</div>
<p>PETSc provides interfaces to various <a class="reference internal" href="external_software.html#doc-externalsoftware"><span class="std std-ref">external packages</span></a>. One
can optionally use external solvers like <a class="reference external" href="https://computing.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods">HYPRE</a>, <a class="reference external" href="https://mumps-solver.org/">MUMPS</a>, and others from within PETSc
applications.</p>
<p>PETSc <code class="docutils notranslate"><span class="pre">configure</span></code> has the ability to download and install these <a class="reference internal" href="external_software.html#doc-externalsoftware"><span class="std std-ref">external packages</span></a>. Alternatively if these packages are already installed, then
<code class="docutils notranslate"><span class="pre">configure</span></code> can detect and use them.</p>
<p>If you are behind a firewall and cannot use a proxy for the downloads or have a very slow
network, use the additional option <code class="docutils notranslate"><span class="pre">--with-packages-download-dir=/path/to/dir</span></code>. This
will trigger <code class="docutils notranslate"><span class="pre">configure</span></code> to print the URLs of all the packages you must download. You
may then download the packages to some directory (do not uncompress or untar the files)
and then point <code class="docutils notranslate"><span class="pre">configure</span></code> to these copies of the packages instead of trying to download
them directly from the internet.</p>
<p>The following modes can be used to download/install <a class="reference internal" href="external_software.html#doc-externalsoftware"><span class="std std-ref">external packages</span></a> with <code class="docutils notranslate"><span class="pre">configure</span></code>.</p>
<ul>
<li><p><code class="docutils notranslate"><span class="pre">--download-PACKAGENAME</span></code>: Download specified package and install it, enabling PETSc to
use this package. <strong>This is the recommended method to couple any external packages with PETSc</strong>:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--download-fblaslapack<span class="w"> </span>--download-mpich
</pre></div>
</div>
</li>
<li><p><code class="docutils notranslate"><span class="pre">--download-PACKAGENAME=/path/to/PACKAGENAME.tar.gz</span></code>: If <code class="docutils notranslate"><span class="pre">configure</span></code> cannot
automatically download the package (due to network/firewall issues), one can download
the package by alternative means (perhaps wget, curl, or scp via some other
machine). Once the tarfile is downloaded, the path to this file can be specified to
configure with this option. <code class="docutils notranslate"><span class="pre">configure</span></code> will proceed to install this package and then
configure PETSc with it:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--download-mpich<span class="o">=</span>/home/petsc/mpich2-1.0.4p1.tar.gz
</pre></div>
</div>
</li>
<li><p><code class="docutils notranslate"><span class="pre">--with-PACKAGENAME-dir=/path/to/dir</span></code>: If the external package is already installed -
specify its location to <code class="docutils notranslate"><span class="pre">configure</span></code> (it will attempt to detect and include relevant
library files from this location). Normally this corresponds to the top-level
installation directory for the package:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-mpi-dir<span class="o">=</span>/home/petsc/software/mpich2-1.0.4p1
</pre></div>
</div>
</li>
<li><p><code class="docutils notranslate"><span class="pre">--with-PACKAGENAME-include=/path/to/include/dir</span></code> and
<code class="docutils notranslate"><span class="pre">--with-PACKAGENAME-lib=LIBRARYLIST</span></code>: Usually a package is defined completely by its
include file location and library list. If the package is already installed one can use
these two options to specify the package to <code class="docutils notranslate"><span class="pre">configure</span></code>. For example:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-superlu-include<span class="o">=</span>/home/petsc/software/superlu/include<span class="w"> </span>--with-superlu-lib<span class="o">=</span>/home/petsc/software/superlu/lib/libsuperlu.a
</pre></div>
</div>
<p>or</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-parmetis-include<span class="o">=</span>/sandbox/balay/parmetis/include<span class="w"> </span>--with-parmetis-lib<span class="o">=</span><span class="s2">&quot;-L/sandbox/balay/parmetis/lib -lparmetis -lmetis&quot;</span>
</pre></div>
</div>
<p>or</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-parmetis-include<span class="o">=</span>/sandbox/balay/parmetis/include<span class="w"> </span>--with-parmetis-lib<span class="o">=[</span>/sandbox/balay/parmetis/lib/libparmetis.a,libmetis.a<span class="o">]</span>
</pre></div>
</div>
</li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<ul class="simple">
<li><p>Run <code class="docutils notranslate"><span class="pre">./configure</span> <span class="pre">--help</span></code> to get the list of <a class="reference internal" href="external_software.html#doc-externalsoftware"><span class="std std-ref">external packages</span></a> and corresponding additional options (for example
<code class="docutils notranslate"><span class="pre">--with-mpiexec</span></code> for <a class="reference external" href="https://www.mpich.org/">MPICH</a>).</p></li>
<li><p>Generally one would use either one of the above installation modes for any given
package - and not mix these. (i.e combining <code class="docutils notranslate"><span class="pre">--with-mpi-dir</span></code> and
<code class="docutils notranslate"><span class="pre">--with-mpi-include</span></code> etc. should be avoided).</p></li>
<li><p>Some packages might not support certain options like <code class="docutils notranslate"><span class="pre">--download-PACKAGENAME</span></code> or
<code class="docutils notranslate"><span class="pre">--with-PACKAGENAME-dir</span></code>. Architectures like Microsoft Windows might have issues
with these options. In these cases, <code class="docutils notranslate"><span class="pre">--with-PACKAGENAME-include</span></code> and
<code class="docutils notranslate"><span class="pre">--with-PACKAGENAME-lib</span></code> options should be preferred.</p></li>
</ul>
</div>
<ul class="simple">
<li><p><code class="docutils notranslate"><span class="pre">--with-packages-build-dir=PATH</span></code>: By default, external packages will be unpacked and
the build process is run in <code class="docutils notranslate"><span class="pre">$PETSC_DIR/$PETSC_ARCH/externalpackages</span></code>. However one
can choose a different location where these packages are unpacked and the build process
is run.</p></li>
</ul>
</section>
<section id="blas-lapack">
<span id="doc-config-blaslapack"></span><h2><a class="toc-backref" href="#id8" role="doc-backlink">BLAS/LAPACK</a><a class="headerlink" href="#blas-lapack" title="Link to this heading">#</a></h2>
<p>These packages provide some basic numeric kernels used by PETSc. <code class="docutils notranslate"><span class="pre">configure</span></code> will
automatically look for <a class="reference external" href="https://www.netlib.org/lapack/lug/node11.html">BLAS/LAPACK</a> in certain standard locations, on most systems you
should not need to provide any information about <a class="reference external" href="https://www.netlib.org/lapack/lug/node11.html">BLAS/LAPACK</a> in the <code class="docutils notranslate"><span class="pre">configure</span></code>
command.</p>
<p>One can use the following options to let <code class="docutils notranslate"><span class="pre">configure</span></code> download/install <a class="reference external" href="https://www.netlib.org/lapack/lug/node11.html">BLAS/LAPACK</a>
automatically:</p>
<ul>
<li><p>When fortran compiler is present:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--download-fblaslapack
</pre></div>
</div>
</li>
<li><p>Or when configuring without a Fortran compiler - i.e <code class="docutils notranslate"><span class="pre">--with-fc=0</span></code>:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--download-f2cblaslapack
</pre></div>
</div>
</li>
</ul>
<p>Alternatively one can use other options like one of the following:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-blaslapack-lib<span class="o">=</span>libsunperf.a
<span class="gp">$ </span>./configure<span class="w"> </span>--with-blas-lib<span class="o">=</span>libblas.a<span class="w"> </span>--with-lapack-lib<span class="o">=</span>liblapack.a
<span class="gp">$ </span>./configure<span class="w"> </span>--with-blaslapack-dir<span class="o">=</span>/soft/com/packages/intel/13/079/mkl
</pre></div>
</div>
<section id="intel-mkl">
<h3>Intel MKL<a class="headerlink" href="#intel-mkl" title="Link to this heading">#</a></h3>
<p>Intel provides <a class="reference external" href="https://www.netlib.org/lapack/lug/node11.html">BLAS/LAPACK</a> via the <a class="reference external" href="https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html">MKL</a> library. One can specify it
to PETSc <code class="docutils notranslate"><span class="pre">configure</span></code> with <code class="docutils notranslate"><span class="pre">--with-blaslapack-dir=$MKLROOT</span></code> or
<code class="docutils notranslate"><span class="pre">--with-blaslapack-dir=/soft/com/packages/intel/13/079/mkl</span></code>. If the above option does
not work - one could determine the correct library list for your compilers using Intel
<a class="reference external" href="https://software.intel.com/content/www/us/en/develop/articles/intel-mkl-link-line-advisor.html">MKL Link Line Advisor</a> and specify with the <code class="docutils notranslate"><span class="pre">configure</span></code> option
<code class="docutils notranslate"><span class="pre">--with-blaslapack-lib</span></code></p>
</section>
<section id="ibm-essl">
<h3>IBM ESSL<a class="headerlink" href="#ibm-essl" title="Link to this heading">#</a></h3>
<p>Sadly, IBM’s <a class="reference external" href="https://www.ibm.com/support/knowledgecenter/en/SSFHY8/essl_welcome.html">ESSL</a> does not have all the routines of <a class="reference external" href="https://www.netlib.org/lapack/lug/node11.html">BLAS/LAPACK</a> that some
packages, such as <a class="reference external" href="https://portal.nersc.gov/project/sparse/superlu/">SuperLU</a> expect; in particular slamch, dlamch and xerbla. In this
case instead of using <a class="reference external" href="https://www.ibm.com/support/knowledgecenter/en/SSFHY8/essl_welcome.html">ESSL</a> we suggest <code class="docutils notranslate"><span class="pre">--download-fblaslapack</span></code>. If you really want
to use <a class="reference external" href="https://www.ibm.com/support/knowledgecenter/en/SSFHY8/essl_welcome.html">ESSL</a>, see <a class="reference external" href="https://www.pdc.kth.se/hpc-services">https://www.pdc.kth.se/hpc-services</a>.</p>
</section>
</section>
<section id="mpi">
<span id="doc-config-mpi"></span><h2><a class="toc-backref" href="#id13" role="doc-backlink">MPI</a><a class="headerlink" href="#mpi" title="Link to this heading">#</a></h2>
<p>The Message Passing Interface (MPI) provides the parallel functionality for PETSc.</p>
<p>MPI might already be installed. IBM, Intel, NVIDIA, and Cray provide their own and Linux and macOS package
managers also provide open-source versions called MPICH and Open MPI. If MPI is not already installed use
the following options to let PETSc’s <code class="docutils notranslate"><span class="pre">configure</span></code> download and install MPI.</p>
<ul>
<li><p>For <a class="reference external" href="https://www.mpich.org/">MPICH</a>:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--download-mpich
</pre></div>
</div>
</li>
<li><p>For <a class="reference external" href="https://www.open-mpi.org/">Open MPI</a>:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--download-openmpi
</pre></div>
</div>
</li>
<li><p>To not use MPI:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-mpi<span class="o">=</span><span class="m">0</span>
</pre></div>
</div>
</li>
<li><p>To use an installed version of MPI</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>mpicc<span class="w"> </span>--with-cxx<span class="o">=</span>mpicxx<span class="w"> </span>--with-fc<span class="o">=</span>mpif90
</pre></div>
</div>
</li>
<li><p>The Intel MPI library provides MPI compiler wrappers with compiler specific names.</p>
<p>GNU compilers: <code class="docutils notranslate"><span class="pre">gcc</span></code>, <code class="docutils notranslate"><span class="pre">g++</span></code>, <code class="docutils notranslate"><span class="pre">gfortran</span></code>:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>mpigcc<span class="w"> </span>--with-cxx<span class="o">=</span>mpigxx<span class="w"> </span>--with-fc<span class="o">=</span>mpif90
</pre></div>
</div>
<p>“Old” Intel compilers: <code class="docutils notranslate"><span class="pre">icc</span></code>, <code class="docutils notranslate"><span class="pre">icpc</span></code>, and <code class="docutils notranslate"><span class="pre">ifort</span></code>:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>mpiicc<span class="w"> </span>--with-cxx<span class="o">=</span>mpiicpc<span class="w"> </span>--with-fc<span class="o">=</span>mpiifort
</pre></div>
</div>
<p>they might not work with some Intel MPI library versions. In those cases, use</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">I_MPI_CC</span><span class="o">=</span>icc<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">I_MPI_CXX</span><span class="o">=</span>icpc<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">I_MPI_F90</span><span class="o">=</span>ifort
<span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>mpicc<span class="w"> </span>--with-cxx<span class="o">=</span>mpicxx<span class="w"> </span>--with-fc<span class="o">=</span>mpif90
</pre></div>
</div>
</li>
<li><p>“New” oneAPI Intel compilers: <code class="docutils notranslate"><span class="pre">icx</span></code>, <code class="docutils notranslate"><span class="pre">icpx</span></code>, and <code class="docutils notranslate"><span class="pre">ifx</span></code>:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>mpiicx<span class="w"> </span>--with-cxx<span class="o">=</span>mpiicpx<span class="w"> </span>--with-fc<span class="o">=</span>mpiifx
</pre></div>
</div>
<p>they might not work with some Intel MPI library versions. In those cases, use</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">I_MPI_CC</span><span class="o">=</span>icx<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">I_MPI_CXX</span><span class="o">=</span>icpx<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">I_MPI_F90</span><span class="o">=</span>ifx
<span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>mpicc<span class="w"> </span>--with-cxx<span class="o">=</span>mpicxx<span class="w"> </span>--with-fc<span class="o">=</span>mpif90
</pre></div>
</div>
</li>
<li><p>On Cray systems, after loading the appropriate MPI module, the regular compilers <code class="docutils notranslate"><span class="pre">cc</span></code>, <code class="docutils notranslate"><span class="pre">CC</span></code>, and <code class="docutils notranslate"><span class="pre">ftn</span></code>
automatically become MPI compiler wrappers.</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>cc<span class="w"> </span>--with-cxx<span class="o">=</span>CC<span class="w"> </span>--with-fc<span class="o">=</span>ftn
</pre></div>
</div>
</li>
<li><p>Instead of providing the MPI compiler wrappers, one can provide the MPI installation directory, where the MPI compiler wrappers are available in the bin directory,
(without additionally specifying <code class="docutils notranslate"><span class="pre">--with-cc</span></code> etc.) using</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$  </span>./configure<span class="w"> </span>--with-mpi-dir<span class="o">=</span>/absolute/path/to/mpi/install/directory
</pre></div>
</div>
</li>
<li><p>To control the compilers selected by <code class="docutils notranslate"><span class="pre">mpicc</span></code>, <code class="docutils notranslate"><span class="pre">mpicxx</span></code>, and <code class="docutils notranslate"><span class="pre">mpif90</span></code> one may use environmental
variables appropriate for the MPI libraries. For Intel MPI, MPICH, and Open MPI they are</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">I_MPI_CC</span><span class="o">=</span>c_compiler<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">I_MPI_CXX</span><span class="o">=</span>c++_compiler<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">I_MPI_F90</span><span class="o">=</span>fortran_compiler
<span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">MPICH_CC</span><span class="o">=</span>c_compiler<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">MPICH_CXX</span><span class="o">=</span>c++_compiler<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">MPICH_FC</span><span class="o">=</span>fortran_compiler
<span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">OMPI_CC</span><span class="o">=</span>c_compiler<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">OMPI_CXX</span><span class="o">=</span>c++_compiler<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">OMPI_FC</span><span class="o">=</span>fortran_compiler
</pre></div>
</div>
<p>Then, use</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>mpicc<span class="w"> </span>--with-fc<span class="o">=</span>mpif90<span class="w"> </span>--with-cxx<span class="o">=</span>mpicxx
</pre></div>
</div>
<p>We recommend avoiding these environmental variables unless absolutely necessary.
They are easy to forget or they may be set and then forgotten, thus resulting in unexpected behavior.</p>
<p>And avoid using the syntax <code class="docutils notranslate"><span class="pre">--with-cc=&quot;mpicc</span> <span class="pre">-cc=icx&quot;</span></code> - this can break some builds (for example: external packages that use CMake)</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The Intel environmental variables <code class="docutils notranslate"><span class="pre">I_MPI_CC</span></code>, <code class="docutils notranslate"><span class="pre">I_MPI_CXX</span></code>, and <code class="docutils notranslate"><span class="pre">I_MPI_F90</span></code> also changing the
behavior of the compiler-specific MPI compiler wrappers <code class="docutils notranslate"><span class="pre">mpigcc</span></code>, <code class="docutils notranslate"><span class="pre">mpigxx</span></code>, <code class="docutils notranslate"><span class="pre">mpif90</span></code>, <code class="docutils notranslate"><span class="pre">mpiicx</span></code>,
<code class="docutils notranslate"><span class="pre">mpiicpx</span></code>, <code class="docutils notranslate"><span class="pre">mpiifx</span></code>, <code class="docutils notranslate"><span class="pre">mpiicc</span></code>, <code class="docutils notranslate"><span class="pre">mpiicpc</span></code>, and <code class="docutils notranslate"><span class="pre">mpiifort</span></code>. These variables may be automatically
set by certain modules. So one must be careful to ensure they are using the desired compilers.</p>
</div>
</li>
</ul>
<section id="installing-with-open-mpi-with-shared-mpi-libraries">
<h3>Installing With Open MPI With Shared MPI Libraries<a class="headerlink" href="#installing-with-open-mpi-with-shared-mpi-libraries" title="Link to this heading">#</a></h3>
<p><a class="reference external" href="https://www.open-mpi.org/">Open MPI</a> defaults to building shared libraries for MPI. However, the binaries generated
by MPI compiler wrappers <code class="docutils notranslate"><span class="pre">mpicc</span></code>/<code class="docutils notranslate"><span class="pre">mpif90</span></code> etc. require <code class="docutils notranslate"><span class="pre">$LD_LIBRARY_PATH</span></code> to be set to the
location of these libraries.</p>
<p>Due to this <a class="reference external" href="https://www.open-mpi.org/">Open MPI</a> restriction one has to set <code class="docutils notranslate"><span class="pre">$LD_LIBRARY_PATH</span></code> correctly (per <a class="reference external" href="https://www.open-mpi.org/">Open MPI</a> <a class="reference external" href="https://www.open-mpi.org/faq/?category=building">installation instructions</a>), before running PETSc <code class="docutils notranslate"><span class="pre">configure</span></code>. If you do not set this environmental variables you will get messages when running <code class="docutils notranslate"><span class="pre">configure</span></code> such as:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>UNABLE to EXECUTE BINARIES for config/configure.py
-------------------------------------------------------------------------------
Cannot run executables created with C. If this machine uses a batch system
to submit jobs you will need to configure using/configure.py with the additional option --with-batch.
Otherwise there is problem with the compilers. Can you compile and run code with your C/C++ (and maybe Fortran) compilers?
</pre></div>
</div>
<p>or when running a code compiled with <a class="reference external" href="https://www.open-mpi.org/">Open MPI</a>:</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>error while loading shared libraries: libmpi.so.0: cannot open shared object file: No such file or directory
</pre></div>
</div>
</section>
</section>
<section id="installing-on-macos">
<span id="doc-macos-install"></span><h2><a class="toc-backref" href="#id14" role="doc-backlink">Installing On macOS</a><a class="headerlink" href="#installing-on-macos" title="Link to this heading">#</a></h2>
<p>For development on macOS we recommend installing <strong>both</strong> the Apple Xcode GUI development system (install from the Apple macOS store) and the Xcode Command Line tools <a class="footnote-reference brackets" href="#id10" id="id2" role="doc-noteref"><span class="fn-bracket">[</span>2<span class="fn-bracket">]</span></a> install with</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>xcode-select<span class="w"> </span>--install
</pre></div>
</div>
<p>The Apple compilers are <code class="docutils notranslate"><span class="pre">clang</span></code> and <code class="docutils notranslate"><span class="pre">clang++</span></code> <a class="footnote-reference brackets" href="#id11" id="id3" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a>. Apple also provides <code class="docutils notranslate"><span class="pre">/usr/bin/gcc</span></code>, which is, confusingly, a link to the <code class="docutils notranslate"><span class="pre">clang</span></code> compiler, not the GNU compiler.</p>
<p>We also recommend installing the package manager <a class="reference external" href="https://brew.sh/">homebrew</a>. To install <code class="docutils notranslate"><span class="pre">gfortran</span></code> one can use</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>brew<span class="w"> </span>update
<span class="gp">$ </span>brew<span class="w"> </span>list<span class="w">            </span><span class="c1"># Show all packages installed through brew</span>
<span class="gp">$ </span>brew<span class="w"> </span>upgrade<span class="w">         </span><span class="c1"># Update packages already installed through brew</span>
<span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span>gcc
</pre></div>
</div>
<p>This installs gfortran, gcc, and g++ with the compiler names
<code class="docutils notranslate"><span class="pre">gfortran-version</span></code> (also available as <code class="docutils notranslate"><span class="pre">gfortran</span></code>), <code class="docutils notranslate"><span class="pre">gcc-version</span></code> and <code class="docutils notranslate"><span class="pre">g++-version</span></code>, for example <code class="docutils notranslate"><span class="pre">gfortran-12</span></code>, <code class="docutils notranslate"><span class="pre">gcc-12</span></code>, and <code class="docutils notranslate"><span class="pre">g++-12</span></code>.</p>
<p>After upgrading macOS, you generally need to update the Xcode GUI development system (using the standard Apple software update system),
and the Xcode Command Line tools (run <code class="docutils notranslate"><span class="pre">xcode-select</span> <span class="pre">--install</span></code> again).</p>
<p>Its best to update <code class="docutils notranslate"><span class="pre">brew</span></code> after all macOS or Xcode upgrades (use <code class="docutils notranslate"><span class="pre">brew</span> <span class="pre">upgrade</span></code>). Sometimes gfortran will not work correctly after an upgrade. If this happens
it is best to reinstall all <code class="docutils notranslate"><span class="pre">brew</span></code> packages using, for example,</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>brew<span class="w"> </span>leaves<span class="w"> </span>&gt;<span class="w"> </span>list.txt<span class="w">         </span><span class="c1"># save list of formulae to re-install</span>
<span class="gp">$ </span>brew<span class="w"> </span>list<span class="w"> </span>--casks<span class="w"> </span>&gt;&gt;<span class="w"> </span>list.txt<span class="w">  </span><span class="c1"># save list of casks to re-install</span>
<span class="gp">$ </span>emacs<span class="w"> </span>list.txt<span class="w">                 </span><span class="c1"># edit list.txt to remove any unneeded formulae or casks</span>
<span class="gp">$ </span>brew<span class="w"> </span>uninstall<span class="w"> </span><span class="sb">`</span>brew<span class="w"> </span>list<span class="sb">`</span><span class="w">     </span><span class="c1"># delete all installed formulae and casks</span>
<span class="gp">$ </span>brew<span class="w"> </span>cleanup
<span class="gp">$ </span>brew<span class="w"> </span>update
<span class="gp">$ </span>brew<span class="w"> </span>install<span class="w"> </span><span class="sb">`</span>cat<span class="w"> </span>list.txt<span class="sb">`</span><span class="w">    </span><span class="c1"># install needed formulae and casks</span>
</pre></div>
</div>
</section>
<section id="installation-location-in-place-or-out-of-place">
<span id="doc-config-install"></span><h2><a class="toc-backref" href="#id15" role="doc-backlink">Installation Location: In-place or Out-of-place</a><a class="headerlink" href="#installation-location-in-place-or-out-of-place" title="Link to this heading">#</a></h2>
<p>By default, PETSc does an in-place installation, meaning the libraries are kept in the
same directories used to compile PETSc. This is particularly useful for those application
developers who follow the PETSc git repository main or release branches since rebuilds
for updates are very quick and painless.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The libraries and include files are located in <code class="docutils notranslate"><span class="pre">$PETSC_DIR/$PETSC_ARCH/lib</span></code> and
<code class="docutils notranslate"><span class="pre">$PETSC_DIR/$PETSC_ARCH/include</span></code></p>
</div>
<section id="out-of-place-installation-with-prefix">
<h3>Out-of-place Installation With <code class="docutils notranslate"><span class="pre">--prefix</span></code><a class="headerlink" href="#out-of-place-installation-with-prefix" title="Link to this heading">#</a></h3>
<p>To install the libraries and include files in another location use the <code class="docutils notranslate"><span class="pre">--prefix</span></code> option</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--prefix<span class="o">=</span>/home/userid/my-petsc-install<span class="w"> </span>--some-other-options
</pre></div>
</div>
<p>The libraries and include files will be located in <code class="docutils notranslate"><span class="pre">/home/userid/my-petsc-install/lib</span></code>
and <code class="docutils notranslate"><span class="pre">/home/userid/my-petsc-install/include</span></code>.</p>
</section>
<section id="installation-in-root-location-not-recommended-uncommon">
<h3>Installation in Root Location, <strong>Not Recommended</strong> (Uncommon)<a class="headerlink" href="#installation-in-root-location-not-recommended-uncommon" title="Link to this heading">#</a></h3>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>One should never run <code class="docutils notranslate"><span class="pre">configure</span></code> or make on any package using root access. <strong>Do so at
your own risk</strong>.</p>
</div>
<p>If one wants to install PETSc in a common system location like <code class="docutils notranslate"><span class="pre">/usr/local</span></code> or <code class="docutils notranslate"><span class="pre">/opt</span></code>
that requires root access we suggest creating a directory for PETSc with user privileges,
and then do the PETSc install as a <strong>regular/non-root</strong> user:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>sudo<span class="w"> </span>mkdir<span class="w"> </span>/opt/petsc
<span class="gp">$ </span>sudo<span class="w"> </span>chown<span class="w"> </span>user:group<span class="w"> </span>/opt/petsc
<span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>/home/userid/petsc
<span class="gp">$ </span>./configure<span class="w"> </span>--prefix<span class="o">=</span>/opt/petsc/my-root-petsc-install<span class="w"> </span>--some-other-options
<span class="gp">$ </span>make
<span class="gp">$ </span>make<span class="w"> </span>install
</pre></div>
</div>
</section>
<section id="installs-for-package-managers-using-destdir-very-uncommon">
<h3>Installs For Package Managers: Using <code class="docutils notranslate"><span class="pre">DESTDIR</span></code> (Very uncommon)<a class="headerlink" href="#installs-for-package-managers-using-destdir-very-uncommon" title="Link to this heading">#</a></h3>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--prefix<span class="o">=</span>/opt/petsc/my-root-petsc-install
<span class="gp">$ </span>make
<span class="gp">$ </span>make<span class="w"> </span>install<span class="w"> </span><span class="nv">DESTDIR</span><span class="o">=</span>/tmp/petsc-pkg
</pre></div>
</div>
<p>Package up <code class="docutils notranslate"><span class="pre">/tmp/petsc-pkg</span></code>. The package should then be installed at
<code class="docutils notranslate"><span class="pre">/opt/petsc/my-root-petsc-install</span></code></p>
</section>
<section id="multiple-installs-using-prefix-see-destdir">
<h3>Multiple Installs Using <code class="docutils notranslate"><span class="pre">--prefix</span></code> (See <code class="docutils notranslate"><span class="pre">DESTDIR</span></code>)<a class="headerlink" href="#multiple-installs-using-prefix-see-destdir" title="Link to this heading">#</a></h3>
<p>Specify a different <code class="docutils notranslate"><span class="pre">--prefix</span></code> location for each configure of different options - at
configure time. For example:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span>--prefix<span class="o">=</span>/opt/petsc/petsc-3.23.0-mpich<span class="w"> </span>--with-mpi-dir<span class="o">=</span>/opt/mpich
<span class="gp">$ </span>make
<span class="gp">$ </span>make<span class="w"> </span>install<span class="w"> </span><span class="o">[</span><span class="nv">DESTDIR</span><span class="o">=</span>/tmp/petsc-pkg<span class="o">]</span>
<span class="gp">$ </span>./configure<span class="w"> </span>--prefix<span class="o">=</span>/opt/petsc/petsc-3.23.0-openmpi<span class="w"> </span>--with-mpi-dir<span class="o">=</span>/opt/openmpi
<span class="gp">$ </span>make
<span class="gp">$ </span>make<span class="w"> </span>install<span class="w"> </span><span class="o">[</span><span class="nv">DESTDIR</span><span class="o">=</span>/tmp/petsc-pkg<span class="o">]</span>
</pre></div>
</div>
</section>
<section id="in-place-installation">
<h3>In-place Installation<a class="headerlink" href="#in-place-installation" title="Link to this heading">#</a></h3>
<p>The PETSc libraries and generated included files are placed in the sub-directory off the
current directory <code class="docutils notranslate"><span class="pre">$PETSC_ARCH</span></code> which is either provided by the user with, for example:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">PETSC_ARCH</span><span class="o">=</span>arch-debug
<span class="gp">$ </span>./configure
<span class="gp">$ </span>make
<span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">PETSC_ARCH</span><span class="o">=</span>arch-opt
<span class="gp">$ </span>./configure<span class="w"> </span>--some-optimization-options
<span class="gp">$ </span>make
</pre></div>
</div>
<p>or</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure<span class="w"> </span><span class="nv">PETSC_ARCH</span><span class="o">=</span>arch-debug
<span class="gp">$ </span>make
<span class="gp">$ </span>./configure<span class="w"> </span>--some-optimization-options<span class="w"> </span><span class="nv">PETSC_ARCH</span><span class="o">=</span>arch-opt
<span class="gp">$ </span>make
</pre></div>
</div>
<p>If not provided <code class="docutils notranslate"><span class="pre">configure</span></code> will generate a unique value automatically (for in-place non
<code class="docutils notranslate"><span class="pre">--prefix</span></code> configurations only).</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span>./configure
<span class="gp">$ </span>make
<span class="gp">$ </span>./configure<span class="w"> </span>--with-debugging<span class="o">=</span><span class="m">0</span>
<span class="gp">$ </span>make
</pre></div>
</div>
<p>Produces the directories (on an Apple macOS machine) <code class="docutils notranslate"><span class="pre">$PETSC_DIR/arch-darwin-c-debug</span></code> and
<code class="docutils notranslate"><span class="pre">$PETSC_DIR/arch-darwin-c-opt</span></code>.</p>
</section>
</section>
<section id="installing-on-machine-requiring-cross-compiler-or-a-job-scheduler">
<h2><a class="toc-backref" href="#id16" role="doc-backlink">Installing On Machine Requiring Cross Compiler Or A Job Scheduler</a><a class="headerlink" href="#installing-on-machine-requiring-cross-compiler-or-a-job-scheduler" title="Link to this heading">#</a></h2>
<p>On systems where you need to use a job scheduler or batch submission to run jobs use the
<code class="docutils notranslate"><span class="pre">configure</span></code> option <code class="docutils notranslate"><span class="pre">--with-batch</span></code>. <strong>On such systems the make check option will not
work</strong>.</p>
<ul class="simple">
<li><p>You must first ensure you have loaded appropriate modules for the compilers etc that you
wish to use. Often the compilers are provided automatically for you and you do not need
to provide <code class="docutils notranslate"><span class="pre">--with-cc=XXX</span></code> etc. Consult with the documentation and local support for
such systems for information on these topics.</p></li>
<li><p>On such systems you generally should not use <code class="docutils notranslate"><span class="pre">--with-blaslapack-dir</span></code> or
<code class="docutils notranslate"><span class="pre">--download-fblaslapack</span></code> since the systems provide those automatically (sometimes
appropriate modules must be loaded first).</p></li>
<li><p>Some package’s <code class="docutils notranslate"><span class="pre">--download-package</span></code> options do not work on these systems, for example
<a class="reference external" href="https://www.hdfgroup.org/solutions/hdf5/">HDF5</a>. Thus you must use modules to load those packages and <code class="docutils notranslate"><span class="pre">--with-package</span></code> to
configure with the package.</p></li>
<li><p>Since building <a class="reference internal" href="external_software.html#doc-externalsoftware"><span class="std std-ref">external packages</span></a> on these systems is often
troublesome and slow we recommend only installing PETSc with those configuration
packages that you need for your work, not extras.</p></li>
</ul>
</section>
<section id="installing-with-tau-instrumentation-package">
<span id="doc-config-tau"></span><h2><a class="toc-backref" href="#id17" role="doc-backlink">Installing With TAU Instrumentation Package</a><a class="headerlink" href="#installing-with-tau-instrumentation-package" title="Link to this heading">#</a></h2>
<p><a class="reference external" href="https://www.cs.uoregon.edu/research/tau/home.php">TAU</a> package and the prerequisite <a class="reference external" href="https://www.cs.uoregon.edu/research/pdt/home.php">PDT</a> packages need to be installed separately (perhaps with MPI). Now use tau_cc.sh as compiler to PETSc configure:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">export</span><span class="w"> </span><span class="nv">TAU_MAKEFILE</span><span class="o">=</span>/home/balay/soft/linux64/tau-2.20.3/x86_64/lib/Makefile.tau-mpi-pdt
<span class="gp">$ </span>./configure<span class="w"> </span><span class="nv">CC</span><span class="o">=</span>/home/balay/soft/linux64/tau-2.20.3/x86_64/bin/tau_cc.sh<span class="w"> </span>--with-fc<span class="o">=</span><span class="m">0</span><span class="w"> </span><span class="nv">PETSC_ARCH</span><span class="o">=</span>arch-tau
</pre></div>
</div>
</section>
<section id="installing-petsc-to-use-gpus-and-accelerators">
<span id="doc-config-accel"></span><h2><a class="toc-backref" href="#id18" role="doc-backlink">Installing PETSc To Use GPUs And Accelerators</a><a class="headerlink" href="#installing-petsc-to-use-gpus-and-accelerators" title="Link to this heading">#</a></h2>
<p>PETSc is able to take advantage of GPU’s and certain accelerator libraries, however some require additional <code class="docutils notranslate"><span class="pre">configure</span></code> options.</p>
<section id="openmp">
<span id="doc-config-accel-cuda"></span><h3><code class="docutils notranslate"><span class="pre">OpenMP</span></code><a class="headerlink" href="#openmp" title="Link to this heading">#</a></h3>
<p>Use <code class="docutils notranslate"><span class="pre">--with-openmp</span></code> to allow PETSc to be used within an OpenMP application; this also turns on OpenMP for all the packages that
PETSc builds using <code class="docutils notranslate"><span class="pre">--download-xxx</span></code>. If your application calls PETSc from within OpenMP threads then also use <code class="docutils notranslate"><span class="pre">--with-threadsafety</span></code>.</p>
<p>Use <code class="docutils notranslate"><span class="pre">--with-openmp-kernels</span></code> to have some PETSc numerical routines use OpenMP to speed up their computations. This requires <code class="docutils notranslate"><span class="pre">--with-openmp</span></code>.</p>
<p>Note that using OpenMP within MPI code must be done carefully to prevent too many OpenMP threads that overload the number of cores.</p>
</section>
<section id="cuda">
<h3><a class="reference external" href="https://developer.nvidia.com/cuda-toolkit">CUDA</a><a class="headerlink" href="#cuda" title="Link to this heading">#</a></h3>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>An NVIDIA GPU is <strong>required</strong> to use <a class="reference external" href="https://developer.nvidia.com/cuda-toolkit">CUDA</a>-accelerated code. Check that your machine
has a <a class="reference external" href="https://developer.nvidia.com/cuda-toolkit">CUDA</a> enabled GPU by consulting <a class="reference external" href="https://developer.nvidia.com/cuda-gpus">https://developer.nvidia.com/cuda-gpus</a>.</p>
</div>
<p>On Linux - verify <a class="footnote-reference brackets" href="#id12" id="id4" role="doc-noteref"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></a> that CUDA compatible <a class="reference external" href="https://www.nvidia.com/en-us/drivers">NVIDIA driver</a> is installed.</p>
<p>On Microsoft Windows - Use either <a class="reference external" href="https://www.cygwin.com/">Cygwin</a> or <a class="reference external" href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">WSL</a> the latter of which is entirely untested right
now. If you have experience with <a class="reference external" href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">WSL</a> and/or have successfully built PETSc on Microsoft Windows
for use with <a class="reference external" href="https://developer.nvidia.com/cuda-toolkit">CUDA</a> we welcome your input at <a class="reference external" href="mailto:petsc-maint&#37;&#52;&#48;mcs&#46;anl&#46;gov">mailto:petsc-maint<span>&#64;</span>mcs<span>&#46;</span>anl<span>&#46;</span>gov</a>. See the
bug-reporting <a class="reference internal" href="../community/mailing.html#doc-creepycrawly"><span class="std std-ref">documentation</span></a> for more details.</p>
<p>In most cases you need only pass the configure option <code class="docutils notranslate"><span class="pre">--with-cuda</span></code>; check
<code class="docutils notranslate"><span class="pre">config/examples/arch-ci-linux-cuda-double.py</span></code> for example usage.</p>
<p>CUDA build of PETSc currently works on Mac OS X, Linux, Microsoft Windows with <a class="reference external" href="https://www.cygwin.com/">Cygwin</a>.</p>
<p>Examples that use CUDA have the suffix .cu; see <code class="docutils notranslate"><span class="pre">$PETSC_DIR/src/snes/tutorials/ex47cu.cu</span></code></p>
</section>
<section id="kokkos">
<span id="doc-config-accel-kokkos"></span><h3><a class="reference external" href="https://github.com/kokkos/kokkos">Kokkos</a><a class="headerlink" href="#kokkos" title="Link to this heading">#</a></h3>
<p>In most cases you need only pass the configure option <code class="docutils notranslate"><span class="pre">--download-kokkos</span></code> <code class="docutils notranslate"><span class="pre">--download-kokkos-kernels</span></code>
and one of <code class="docutils notranslate"><span class="pre">--with-cuda</span></code>, <code class="docutils notranslate"><span class="pre">--with-openmp</span></code>, or <code class="docutils notranslate"><span class="pre">--with-pthread</span></code> (or nothing to use sequential
<a class="reference external" href="https://github.com/kokkos/kokkos">Kokkos</a>). See the <a class="reference internal" href="#doc-config-accel-cuda"><span class="std std-ref">CUDA installation documentation</span></a>,
<a class="reference internal" href="#doc-config-mpi"><span class="std std-ref">Open MPI installation documentation</span></a> for further reference on their
respective requirements.</p>
<p>Examples that use <a class="reference external" href="https://github.com/kokkos/kokkos">Kokkos</a> at user-level have the suffix .kokkos.cxx; see
<code class="docutils notranslate"><span class="pre">src/snes/tutorials/ex3k.kokkos.cxx</span></code>. More examples use <a class="reference external" href="https://github.com/kokkos/kokkos">Kokkos</a> through options database;
search them with <code class="docutils notranslate"><span class="pre">grep</span> <span class="pre">-r</span> <span class="pre">-l</span> <span class="pre">&quot;requires:.*kokkos_kernels&quot;</span> <span class="pre">src/</span></code>.</p>
</section>
<section id="opencl-viennacl">
<span id="doc-config-accel-opencl"></span><h3><a class="reference external" href="https://www.khronos.org/opencl/">OpenCL</a>/<a class="reference external" href="http://viennacl.sourceforge.net/">ViennaCL</a><a class="headerlink" href="#opencl-viennacl" title="Link to this heading">#</a></h3>
<p>Requires the <a class="reference external" href="https://www.khronos.org/opencl/">OpenCL</a> shared library, which is shipped in the vendor graphics driver and
the <a class="reference external" href="https://www.khronos.org/opencl/">OpenCL</a> headers; if needed you can download them from the Khronos Group
directly. Package managers on Linux provide these headers through a package named
‘opencl-headers’ or similar. On Apple systems the <a class="reference external" href="https://www.khronos.org/opencl/">OpenCL</a> drivers and headers are always
available and do not need to be downloaded.</p>
<p>Always make sure you have the latest GPU driver installed. There are several known issues
with older driver versions.</p>
<p>Run <code class="docutils notranslate"><span class="pre">configure</span></code> with <code class="docutils notranslate"><span class="pre">--download-viennacl</span></code>; check
<code class="docutils notranslate"><span class="pre">config/examples/arch-ci-linux-viennacl.py</span></code> for example usage.</p>
<p><a class="reference external" href="https://www.khronos.org/opencl/">OpenCL</a>/<a class="reference external" href="http://viennacl.sourceforge.net/">ViennaCL</a> builds of PETSc currently work on Mac OS X, Linux, and Microsoft Windows.</p>
</section>
</section>
<section id="installing-to-run-in-browser-with-emscripten">
<span id="doc-emcc"></span><h2><a class="toc-backref" href="#id19" role="doc-backlink">Installing To Run in Browser with Emscripten</a><a class="headerlink" href="#installing-to-run-in-browser-with-emscripten" title="Link to this heading">#</a></h2>
<p>PETSc can be used to run applications in the browser using <a class="reference external" href="https://emscripten.org">https://emscripten.org</a>, see <a class="reference external" href="https://emscripten.org/docs/getting_started/downloads.html">https://emscripten.org/docs/getting_started/downloads.html</a>,
for instructions on installing Emscripten. Run</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$  </span>./configure<span class="w"> </span>--with-cc<span class="o">=</span>emcc<span class="w"> </span>--with-cxx<span class="o">=</span><span class="m">0</span><span class="w"> </span>--with-fc<span class="o">=</span><span class="m">0</span><span class="w"> </span>--with-ranlib<span class="o">=</span>emranlib<span class="w"> </span>--with-ar<span class="o">=</span>emar<span class="w"> </span>--with-shared-libraries<span class="o">=</span><span class="m">0</span><span class="w"> </span>--download-f2cblaslapack<span class="o">=</span><span class="m">1</span><span class="w"> </span>--with-mpi<span class="o">=</span><span class="m">0</span><span class="w"> </span>--with-batch
</pre></div>
</div>
<p>Applications may be compiled with, for example,</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$  </span>make<span class="w"> </span>ex19.html
</pre></div>
</div>
<p>The rule for linking may be found in <a href="../lib/petsc/conf/rules">lib/petsc/conf/rules&gt;</a></p>
</section>
<section id="installing-on-large-scale-doe-systems">
<span id="doc-config-hpc"></span><h2><a class="toc-backref" href="#id20" role="doc-backlink">Installing On Large Scale DOE Systems</a><a class="headerlink" href="#installing-on-large-scale-doe-systems" title="Link to this heading">#</a></h2>
<p>There are some notes on our <a class="reference external" href="https://gitlab.com/petsc/petsc/-/wikis/Installing-and-Running-on-Large-Scale-Systems">GitLab Wiki</a>
which may be helpful in installing and running PETSc on large scale
systems. Also note the configuration examples in <code class="docutils notranslate"><span class="pre">config/examples</span></code>.</p>
<p class="rubric">Footnotes</p>
</section>
</section>
<hr class="footnotes docutils" />
<aside class="footnote-list brackets">
<aside class="footnote brackets" id="id9" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id1">1</a><span class="fn-bracket">]</span></span>
<p>All MPI implementations provide convenience scripts for compiling MPI codes that internally call regular compilers, they are commonly named <code class="docutils notranslate"><span class="pre">mpicc</span></code>, <code class="docutils notranslate"><span class="pre">mpicxx</span></code>, and <code class="docutils notranslate"><span class="pre">mpif90</span></code>. We call these “MPI compiler wrappers”.</p>
</aside>
<aside class="footnote brackets" id="id10" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id2">2</a><span class="fn-bracket">]</span></span>
<p>The two packages provide slightly different (though largely overlapping) functionality which can only be fully used if both packages are installed.</p>
</aside>
<aside class="footnote brackets" id="id11" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id3">3</a><span class="fn-bracket">]</span></span>
<p>Apple provides customized <code class="docutils notranslate"><span class="pre">clang</span></code> and <code class="docutils notranslate"><span class="pre">clang++</span></code> for its system. To use the unmodified LLVM project <code class="docutils notranslate"><span class="pre">clang</span></code> and <code class="docutils notranslate"><span class="pre">clang++</span></code>
install them with brew.</p>
</aside>
<aside class="footnote brackets" id="id12" role="doc-footnote">
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id4">4</a><span class="fn-bracket">]</span></span>
<p>To verify CUDA compatible Nvidia driver on Linux - run the utility <code class="docutils notranslate"><span class="pre">nvidia-smi</span></code> - it should provide the version of the Nvidia driver currently installed, and the maximum CUDA version it supports.</p>
</aside>
</aside>


                </article>
              
              
              
              
              
                <footer class="prev-next-footer">
                  
<div class="prev-next-area">
    <a class="left-prev"
       href="install_tutorial.html"
       title="previous page">
      <i class="fa-solid fa-angle-left"></i>
      <div class="prev-next-info">
        <p class="prev-next-subtitle">previous</p>
        <p class="prev-next-title">Quick Start Tutorial</p>
      </div>
    </a>
    <a class="right-next"
       href="windows.html"
       title="next page">
      <div class="prev-next-info">
        <p class="prev-next-subtitle">next</p>
        <p class="prev-next-title">Installing PETSc On Microsoft Windows</p>
      </div>
      <i class="fa-solid fa-angle-right"></i>
    </a>
</div>
                </footer>
              
            </div>
            
            
              
                <div class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">


  <div class="sidebar-secondary-item">
<div
    id="pst-page-navigation-heading-2"
    class="page-toc tocsection onthispage">
    <i class="fa-solid fa-list"></i> On this page
  </div>
  <nav class="bd-toc-nav page-toc" aria-labelledby="pst-page-navigation-heading-2">
    <ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#common-example-usages">Common Example Usages</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#compilers">Compilers</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#external-packages">External Packages</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#blas-lapack">BLAS/LAPACK</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#intel-mkl">Intel MKL</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#ibm-essl">IBM ESSL</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#mpi">MPI</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#installing-with-open-mpi-with-shared-mpi-libraries">Installing With Open MPI With Shared MPI Libraries</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#installing-on-macos">Installing On macOS</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#installation-location-in-place-or-out-of-place">Installation Location: In-place or Out-of-place</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#out-of-place-installation-with-prefix">Out-of-place Installation With <code class="docutils notranslate"><span class="pre">--prefix</span></code></a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#installation-in-root-location-not-recommended-uncommon">Installation in Root Location, <strong>Not Recommended</strong> (Uncommon)</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#installs-for-package-managers-using-destdir-very-uncommon">Installs For Package Managers: Using <code class="docutils notranslate"><span class="pre">DESTDIR</span></code> (Very uncommon)</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#multiple-installs-using-prefix-see-destdir">Multiple Installs Using <code class="docutils notranslate"><span class="pre">--prefix</span></code> (See <code class="docutils notranslate"><span class="pre">DESTDIR</span></code>)</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#in-place-installation">In-place Installation</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#installing-on-machine-requiring-cross-compiler-or-a-job-scheduler">Installing On Machine Requiring Cross Compiler Or A Job Scheduler</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#installing-with-tau-instrumentation-package">Installing With TAU Instrumentation Package</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#installing-petsc-to-use-gpus-and-accelerators">Installing PETSc To Use GPUs And Accelerators</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#openmp"><code class="docutils notranslate"><span class="pre">OpenMP</span></code></a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#cuda">CUDA</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#kokkos">Kokkos</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#opencl-viennacl">OpenCL/ViennaCL</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#installing-to-run-in-browser-with-emscripten">Installing To Run in Browser with Emscripten</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#installing-on-large-scale-doe-systems">Installing On Large Scale DOE Systems</a></li>
</ul>
  </nav></div>

  <div class="sidebar-secondary-item">

  
  <div class="tocsection editthispage">
    <a href="https://gitlab.com/petsc/petsc/-/edit/release/doc/install/install.md">
      <i class="fa-solid fa-pencil"></i>
      
      
        
          Edit on GitLab
        
      
    </a>
  </div>
</div>

  <div class="sidebar-secondary-item">

  <div class="tocsection sourcelink">
    <a href="../_sources/install/install.md.txt">
      <i class="fa-solid fa-file-lines"></i> Show Source
    </a>
  </div>
</div>

</div></div>
              
            
          </div>
          <footer class="bd-footer-content">
            
          </footer>
        
      </main>
    </div>
  </div>
  
  <!-- Scripts loaded after <body> so the DOM is not blocked -->
  <script src="../_static/scripts/bootstrap.js?digest=bd9e20870c6007c4c509"></script>
<script src="../_static/scripts/pydata-sphinx-theme.js?digest=bd9e20870c6007c4c509"></script>

  <footer class="bd-footer">
<div class="bd-footer__inner bd-page-width">
  
    <div class="footer-items__start">
      
        <div class="footer-item">

  <p class="copyright">
    
      © Copyright 1991-2025, UChicago Argonne, LLC and the PETSc Development Team.
      <br/>
    
  </p>
</div>
      
        <div class="footer-item">

  <p class="sphinx-version">
    Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.3.7.
    <br/>
  </p>
</div>
      
    </div>
  
  
  
    <div class="footer-items__end">
      
        <div class="footer-item">
<p class="theme-version">
  Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.15.1.
</p></div>
      
        <div class="footer-item"><p class="last-updated">
  Last updated on 2025-04-30T13:10:40-0500 (v3.23.1).
  <br/>
</p></div>
      
    </div>
  
</div>

  </footer>
  </body>
</html>