1<!--===- docs/OptionComparison.md 2 3 Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 See https://llvm.org/LICENSE.txt for license information. 5 SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 7--> 8 9# Compiler options comparison 10 11This document catalogs the options processed by F18's peers/competitors. Much of the document is taken up by a set of tables that list the options categorized into different topics. Some of the table headings link to more information about the contents of the tables. For example, the table on **Standards conformance** options links to [notes on Standards conformance](#standards). 12 13**There's also important information in the ___[Appendix section](#appendix)___ near the end of the document on how this data was gathered and what ___is___ and ___is not___ included in this document.** 14 15Note that compilers may support language features without having an option for them. Such cases are frequently, but not always noted in this document. 16 17## Categorization of Options 18 19<table> 20 <tr> 21 <td colspan="7" ><strong><a href="#standards">Standards conformance</a></strong> 22 </td> 23 </tr> 24 <tr> 25 <td><strong>Option</strong> </td> 26 <td><strong>Cray</strong> </td> 27 <td><strong>GNU</strong> </td> 28 <td><strong>IBM</strong> </td> 29 <td><strong>Intel</strong> </td> 30 <td><strong>PGI</strong> </td> 31 <td><strong>Flang</strong> </td> 32 </tr> 33 <tr> 34 <td>Overall conformance </td> 35 <td>en, 36<p> 37eN 38 </td> 39 <td>std=<em>level</em> </td> 40 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=210">qlanglvl</a>, <a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=257">qsaa</a> 41 </td> 42 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-stand">stand level</a> 43 </td> 44 <td>Mstandard 45 </td> 46 <td>Mstandard 47 </td> 48 </tr> 49 <tr> 50 <td>Compatibility with previous standards or implementations 51 </td> 52 <td>N/A 53 </td> 54 <td>fdec, 55<p> 56fall-instrinsics 57 </td> 58 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=297">qxlf77</a>, 59<p> 60<a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=299">qxlf90</a>, 61<p> 62<a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=301">qxlf2003</a>, 63<p> 64<a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=305">qxfl2008</a>, 65<p> 66<a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=245">qport</a> 67 </td> 68 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-f66">f66</a>, 69<p> 70<a href="https://software.intel.com/node/a8bfa478-22d5-4000-b0ac-b881804a7611">f77rtl</a>, 71<p> 72<a href="https://software.intel.com/node/647820a0-fc53-4252-a858-46feb012a281">fpscomp</a>, 73<p> 74<a href="https://software.intel.com/node/e610682a-00fe-4881-9cf7-8eee08c5f2a2">Intconstant</a>, 75<p> 76<a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-standard-realloc-lhs">nostandard-realloc-lhs</a>, 77<p> 78<a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-standard-semantics">standard-semantics</a>, 79<p> 80<a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume nostd_intent_in</a>, 81<p> 82<a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume nostd_value</a>, 83<p> 84<a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume norealloc_lhs</a> 85 </td> 86 <td>Mallocatable=95|03 87 </td> 88 <td>Mallocatable=95|03 89 </td> 90 </tr> 91</table> 92 93 94 95 96 97<table> 98 <tr> 99 <td colspan="7" ><strong><a href="#source">Source format</a></strong> 100 </td> 101 </tr> 102 <tr> 103 <td><strong>Option</strong> 104 </td> 105 <td><strong>Cray</strong> 106 </td> 107 <td><strong>GNU</strong> 108 </td> 109 <td><strong>IBM</strong> 110 </td> 111 <td><strong>Intel</strong> 112 </td> 113 <td><strong>PGI</strong> 114 </td> 115 <td><strong>Flang</strong> 116 </td> 117 </tr> 118 <tr> 119 <td>Fixed or free source 120 </td> 121 <td>f free, 122<p> 123f fixed 124 </td> 125 <td>ffree-form, 126<p> 127ffixed-form 128 </td> 129 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=179">qfree</a>, 130<p> 131<a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=169">qfixed</a> 132 </td> 133 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-fixed">fixed</a>, 134<p> 135<a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-free">free</a> 136 </td> 137 <td>Mfree, 138<p> 139Mfixed 140 </td> 141 <td>Mfreeform, 142<p> 143Mfixed 144 </td> 145 </tr> 146 <tr> 147 <td>Source line length 148 </td> 149 <td>N <em>col</em> 150 </td> 151 <td>ffixed-line-length-n, 152<p> 153ffree-line-length-n 154 </td> 155 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=169">qfixed=n</a> 156 </td> 157 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-extend-source">extend-source [size]</a> 158 </td> 159 <td>Mextend 160 </td> 161 <td>Mextend 162 </td> 163 </tr> 164 <tr> 165 <td>Column 1 comment specifier 166 </td> 167 <td>ed 168 </td> 169 <td>fd-lines-as-code, 170<p> 171fd-lines-as-comments 172 </td> 173 <td>D, 174<p> 175<a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=161">qdlines</a>, 176<p> 177<a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=306">qxlines</a> 178 </td> 179 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-d-lines-qd-lines">d-lines</a> 180 </td> 181 <td>Mdlines 182 </td> 183 <td>N/A 184 </td> 185 </tr> 186 <tr> 187 <td>Don't treat CR character as a line terminator 188 </td> 189 <td>NA 190 </td> 191 <td>N/A 192 </td> 193 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=153">qnocr</a> 194 </td> 195 <td>N/A 196 </td> 197 <td>N/A 198 </td> 199 <td>N/A 200 </td> 201 </tr> 202 <tr> 203 <td>Source file naming 204 </td> 205 <td>N/A 206 </td> 207 <td>N/A 208 </td> 209 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=282">qsuffix</a> 210 </td> 211 <td><a href="https://software.intel.com/node/84174680-3c7d-4225-9611-6083f496aa9b">extfor</a>, 212<p> 213<a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-tf">Tf filename</a> 214 </td> 215 <td>N/A 216 </td> 217 <td>N/A 218 </td> 219 </tr> 220</table> 221 222 223 224 225 226<table> 227 <tr> 228 <td colspan="7" ><strong><a href="#names">Names, Literals, and other tokens</a></strong> 229 </td> 230 </tr> 231 <tr> 232 <td><strong>Option</strong> 233 </td> 234 <td><strong>Cray</strong> 235 </td> 236 <td><strong>GNU</strong> 237 </td> 238 <td><strong>IBM</strong> 239 </td> 240 <td><strong>Intel</strong> 241 </td> 242 <td><strong>PGI</strong> 243 </td> 244 <td><strong>Flang</strong> 245 </td> 246 </tr> 247 <tr> 248 <td>Max identifier length 249 </td> 250 <td>N/A 251 </td> 252 <td>fmax-identifier-length=<em>n</em> 253 </td> 254 <td>N/A 255 </td> 256 <td>N/A 257 </td> 258 <td>N/A 259 </td> 260 <td>N/A 261 </td> 262 </tr> 263 <tr> 264 <td>"$" in symbol names 265 </td> 266 <td>N/A 267 </td> 268 <td>fdollar-ok 269 </td> 270 <td>default 271 </td> 272 <td>default 273 </td> 274 <td>N/A 275 </td> 276 <td>N/A 277 </td> 278 </tr> 279 <tr> 280 <td>Allow names with leading "_" 281 </td> 282 <td>eQ 283 </td> 284 <td>N/A 285 </td> 286 <td>N/A 287 </td> 288 <td>N/A 289 </td> 290 <td>N/A 291 </td> 292 <td>N/A 293 </td> 294 </tr> 295 <tr> 296 <td>Specify name format 297 </td> 298 <td>N/A 299 </td> 300 <td>N/A 301 </td> 302 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=296">U</a> 303 </td> 304 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-names">names=keyword</a> 305 </td> 306 <td>Mupcase 307 </td> 308 <td>NA 309 </td> 310 </tr> 311 <tr> 312 <td>Escapes in literals 313 </td> 314 <td>N/A 315 </td> 316 <td>fbackslash 317 </td> 318 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=163">qescape</a> 319 </td> 320 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume bscc</a> 321 </td> 322 <td>Mbackslash 323 </td> 324 <td>Mbackslash 325 </td> 326 </tr> 327 <tr> 328 <td>Allow multibyte characters in strings 329 </td> 330 <td>N/A 331 </td> 332 <td>N/A 333 </td> 334 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=223">qmbcs</a> 335 </td> 336 <td>N/A 337 </td> 338 <td>N/A 339 </td> 340 <td>N/A 341 </td> 342 </tr> 343 <tr> 344 <td>Create null terminated strings 345 </td> 346 <td>N/A 347 </td> 348 <td>N/A 349 </td> 350 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=228">qnullterm</a> 351 </td> 352 <td>N/A 353 </td> 354 <td>N/A 355 </td> 356 <td>N/A 357 </td> 358 </tr> 359 <tr> 360 <td>Character to use for "$" 361 </td> 362 <td>N/A 363 </td> 364 <td>N/A 365 </td> 366 <td>N/A 367 </td> 368 <td>N/A 369 </td> 370 <td>Mdollar,<em>char</em> 371 </td> 372 <td> 373 </td> 374 </tr> 375 <tr> 376 <td>Allow PARAMETER statements without parentheses 377 </td> 378 <td>N/A 379 </td> 380 <td>N/A 381 </td> 382 <td>N/A 383 </td> 384 <td><a href="https://software.intel.com/node/42e8ec08-64cc-44ba-a636-20ed50c682cd">altparam</a> 385 </td> 386 <td>N?A 387 </td> 388 <td>N/A 389 </td> 390 </tr> 391</table> 392 393 394 395<table> 396 <tr> 397 <td colspan="7" ><strong><a href="#do">DO loop handling</a></strong> 398 </td> 399 </tr> 400 <tr> 401 <td><strong>Option</strong> 402 </td> 403 <td><strong>Cray</strong> 404 </td> 405 <td><strong>GNU</strong> 406 </td> 407 <td><strong>IBM</strong> 408 </td> 409 <td><strong>Intel</strong> 410 </td> 411 <td><strong>PGI</strong> 412 </td> 413 <td><strong>Flang</strong> 414 </td> 415 </tr> 416 <tr> 417 <td>One trip DO loops 418 </td> 419 <td>ej 420 </td> 421 <td>N/A 422 </td> 423 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=113">1</a>, 424<p> 425<a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=231">qonetrip</a> 426 </td> 427 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-f66">f66</a> 428 </td> 429 <td>Monetrip 430 </td> 431 <td>N/A 432 </td> 433 </tr> 434 <tr> 435 <td>Allow branching into loops 436 </td> 437 <td>eg 438 </td> 439 <td>N/A 440 </td> 441 <td>N/A 442 </td> 443 <td>N/A 444 </td> 445 <td>N/A 446 </td> 447 <td>N/A 448 </td> 449 </tr> 450</table> 451 452 453 454 455 456<table> 457 <tr> 458 <td colspan="7" ><strong><a href="#real">REAL, DOUBLE PRECISION, and COMPLEX Data</a></strong> 459 </td> 460 </tr> 461 <tr> 462 <td><strong>Option</strong> 463 </td> 464 <td><strong>Cray</strong> 465 </td> 466 <td><strong>GNU</strong> 467 </td> 468 <td><strong>IBM</strong> 469 </td> 470 <td><strong>Intel</strong> 471 </td> 472 <td><strong>PGI</strong> 473 </td> 474 <td><strong>Flang</strong> 475 </td> 476 </tr> 477 <tr> 478 <td>Default REAL size 479 </td> 480 <td>s real32, 481<p> 482s real64, 483<p> 484s default32, 485<p> 486s default64 487 </td> 488 <td>fdefault-real-[8|10|16] 489 </td> 490 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=252">qrealsize=[4|8]</a> 491 </td> 492 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-real-size">real-size [32|64|128]</a> 493 </td> 494 <td>r[4|8] 495 </td> 496 <td>r8, 497<p> 498fdefault-real-8 499 </td> 500 </tr> 501 <tr> 502 <td>Default DOUBLE PRECISION size 503 </td> 504 <td>ep 505 </td> 506 <td>fdefault-double-8 507 </td> 508 <td>N/A 509 </td> 510 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-double-size">double-size[64|128]</a> 511 </td> 512 <td>N/A 513 </td> 514 <td>N/A 515 </td> 516 </tr> 517 <tr> 518 <td>Make real constants DOUBLE PRECISION 519 </td> 520 <td>N/A 521 </td> 522 <td>N/A 523 </td> 524 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=161">qdpc</a> 525 </td> 526 <td>N/A 527 </td> 528 <td>N/A 529 </td> 530 <td>N/A 531 </td> 532 </tr> 533 <tr> 534 <td>Promote or demote REAL type sizes 535 </td> 536 <td>N/A 537 </td> 538 <td>freal-[4|8]-real[4|8|10|16] 539 </td> 540 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=144">qautodbl=size</a> 541 </td> 542 <td>N/A 543 </td> 544 <td>Mr8, 545<p> 546Mr8intrinsics 547 </td> 548 <td>N/A 549 </td> 550 </tr> 551 <tr> 552 <td>Rounding mode 553 </td> 554 <td>N/A 555 </td> 556 <td>N/A 557 </td> 558 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=190">qieee</a> 559 </td> 560 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume std_minus0_rounding</a> 561 </td> 562 <td>N/A 563 </td> 564 <td>N/A 565 </td> 566 </tr> 567 <tr> 568 <td>Treatment of -0.0 569 </td> 570 <td>N/A 571 </td> 572 <td>N/A 573 </td> 574 <td>N/A 575 </td> 576 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume minus0</a> 577 </td> 578 <td> 579 </td> 580 <td> 581 </td> 582 </tr> 583</table> 584 585 586 587 588 589<table> 590 <tr> 591 <td colspan="7" ><strong><a href="#integer">INTEGER and LOGICAL Data</a></strong> 592 </td> 593 </tr> 594 <tr> 595 <td><strong>Option</strong> 596 </td> 597 <td><strong>Cray</strong> 598 </td> 599 <td><strong>GNU</strong> 600 </td> 601 <td><strong>IBM</strong> 602 </td> 603 <td><strong>Intel</strong> 604 </td> 605 <td><strong>PGI</strong> 606 </td> 607 <td><strong>Flang</strong> 608 </td> 609 </tr> 610 <tr> 611 <td>Default INTEGER size 612 </td> 613 <td>s integer32, 614<p> 615s integer64, 616<p> 617s default32, 618<p> 619s default64 620 </td> 621 <td>fdefault-integer-8 622 </td> 623 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=202">qintsize=[2|4|8]</a> 624 </td> 625 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-integer-size">integer-size [32|64|128]</a> 626 </td> 627 <td>I[2|4|8], 628<p> 629Mi4, 630<p> 631Mnoi4 632 </td> 633 <td>i8, 634<p> 635fdefault-integer-8 636 </td> 637 </tr> 638 <tr> 639 <td>Promote INTEGER sizes 640 </td> 641 <td>N/A 642 </td> 643 <td>finteger-4-integer-8 644 </td> 645 <td>N/A 646 </td> 647 <td>N/A 648 </td> 649 <td>N/A 650 </td> 651 <td>N/A 652 </td> 653 </tr> 654 <tr> 655 <td>Enable 8 and 16 bit INTEGER and LOGICALS 656 </td> 657 <td>eh 658 </td> 659 <td>N/A 660 </td> 661 <td>N/A 662 </td> 663 <td>N/A 664 </td> 665 <td>N/A 666 </td> 667 <td>N/A 668 </td> 669 </tr> 670 <tr> 671 <td>Change how the compiler treats LOGICAL 672 </td> 673 <td>N/A 674 </td> 675 <td>N/A 676 </td> 677 <td>N/A 678 </td> 679 <td>N/A 680 </td> 681 <td>Munixlogical 682 </td> 683 <td> 684 </td> 685 </tr> 686 <tr> 687 <td>Treatment of numeric constants as arguments 688 </td> 689 <td>N/A 690 </td> 691 <td>N/A 692 </td> 693 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=297">qxlf77 oldboz</a> 694 </td> 695 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume old_boz</a> 696 </td> 697 <td>N/A 698 </td> 699 <td>N/A 700 </td> 701 </tr> 702 <tr> 703 <td>Treatment of assignment between numerics and logicals 704 </td> 705 <td>N/A 706 </td> 707 <td>N/A 708 </td> 709 <td>N/A 710 </td> 711 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume old_logical_assign</a> 712 </td> 713 <td>N/A 714 </td> 715 <td>N/A 716 </td> 717 </tr> 718</table> 719 720 721 722 723 724<table> 725 <tr> 726 <td colspan="7" ><strong>CHARACTER and Pointer Data</strong> 727 </td> 728 </tr> 729 <tr> 730 <td><strong>Option</strong> 731 </td> 732 <td><strong>Cray</strong> 733 </td> 734 <td><strong>GNU</strong> 735 </td> 736 <td><strong>IBM</strong> 737 </td> 738 <td><strong>Intel</strong> 739 </td> 740 <td><strong>PGI</strong> 741 </td> 742 <td><strong>Flang</strong> 743 </td> 744 </tr> 745 <tr> 746 <td>Use bytes for pointer arithmetic 747 </td> 748 <td>s byte_pointer 749 </td> 750 <td>N/A 751 </td> 752 <td>N/A 753 </td> 754 <td>N/A 755 </td> 756 <td>N/A 757 </td> 758 <td>N/A 759 </td> 760 </tr> 761 <tr> 762 <td>Use words for pointer arithmetic 763 </td> 764 <td>S word_pointer 765 </td> 766 <td>N/A 767 </td> 768 <td>N/A 769 </td> 770 <td>N/A 771 </td> 772 <td>N/A 773 </td> 774 <td>N/A 775 </td> 776 </tr> 777 <tr> 778 <td>Allow character constants for typeless constants 779 </td> 780 <td>N/A 781 </td> 782 <td>N/A 783 </td> 784 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=153">qctyplss</a> 785 </td> 786 <td>N/A 787 </td> 788 <td>N/A 789 </td> 790 <td>N/A 791 </td> 792 </tr> 793</table> 794 795<table> 796 <tr> 797 <td colspan="7" ><strong>Data types and allocation</strong> 798 </td> 799 </tr> 800 <tr> 801 <td><strong>Option</strong> 802 </td> 803 <td><strong>Cray</strong> 804 </td> 805 <td><strong>GNU</strong> 806 </td> 807 <td><strong>IBM</strong> 808 </td> 809 <td><strong>Intel</strong> 810 </td> 811 <td><strong>PGI</strong> 812 </td> 813 <td><strong>Flang</strong> 814 </td> 815 </tr> 816 <tr> 817 <td>Default to IMPLICIT NONE 818 </td> 819 <td>eI 820 </td> 821 <td>fimplicit-none 822 </td> 823 <td>u, <a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=291">qundef</a> 824 </td> 825 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-warn">warn declarations</a> 826 </td> 827 <td>Mdclchk 828 </td> 829 <td>N/A 830 </td> 831 </tr> 832 <tr> 833 <td>Enable DEC STRUCTURE extensions 834 </td> 835 <td>N/A 836 </td> 837 <td><a href="https://gcc.gnu.org/onlinedocs/gfortran/STRUCTURE-and-RECORD.html">fdec-structure</a> 838 </td> 839 <td>N/A 840 </td> 841 <td>N/A 842 </td> 843 <td><a href="https://www.pgroup.com/doc/pgi15fortref.pdf#page=86">default</a> 844 </td> 845 <td>N/A 846 </td> 847 </tr> 848 <tr> 849 <td>Enable <a href="https://pubs.cray.com/content/S-3901/8.7/cray-fortran-reference-manual/types">Cray pointers</a> 850 </td> 851 <td>default 852 </td> 853 <td>fcray-pointer 854 </td> 855 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024776&aid=1#page=432">Default (near equivalent)</a> 856 </td> 857 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-pointer-integer">Default (near equivalent)</a> 858 </td> 859 <td>Mcray 860 </td> 861 <td>N/A 862 </td> 863 </tr> 864 <tr> 865 <td>Allow bitwise logical operations on numeric 866 </td> 867 <td>ee 868 </td> 869 <td>N/A 870 </td> 871 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=201">qintlog</a> 872 </td> 873 <td>N/A 874 </td> 875 <td>N/A 876 </td> 877 <td>N/A 878 </td> 879 </tr> 880 <tr> 881 <td>Allow DEC STATIC and AUTOMATIC declarations 882 </td> 883 <td>default 884 </td> 885 <td>fdec-static 886 </td> 887 <td>Default, see <a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024776&aid=1#page=393">IMPLICIT STATIC</a> and <a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024776&aid=1#page=393">IMPLICIT AUTOMATIC</a> 888 </td> 889 <td>Default, see <a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-automatic">AUTOMATIC</a> and <a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-static-1#408BC4E6-7AA7-4475-A280-205D34AE2E4F">STATIC</a> 890 </td> 891 <td><a href="https://www.pgroup.com/doc/pgi15fortref.pdf#page=86">Default</a> 892 </td> 893 <td>N/A 894 </td> 895 </tr> 896 <tr> 897 <td>Allocate variables to static storage 898 </td> 899 <td>ev 900 </td> 901 <td>fno-automatic 902 </td> 903 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=258">qsave</a> 904 </td> 905 <td><a href="https://software.intel.com/node/3ed16417-6eed-4e09-9edd-4ae03e77c6cf">save</a>, 906<p> 907<a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-auto">noauto</a> 908 </td> 909 <td>Mnorecursive, 910<p> 911Msave 912 </td> 913 <td>N/A 914 </td> 915 </tr> 916 <tr> 917 <td>Compile procedures as if RECURSIVE 918 </td> 919 <td>eR 920 </td> 921 <td>frecursive 922 </td> 923 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=254">q recur</a> 924 </td> 925 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume recursion</a>, 926<p> 927<a href="https://software.intel.com/node/1c3820b4-42a1-48ea-887a-2cf39a41ce53">recursive</a> 928 </td> 929 <td>Mrecursive 930 </td> 931 <td>Mrecursive 932 </td> 933 </tr> 934</table> 935 936 937<table> 938 <tr> 939 <td colspan="7" ><strong><a href="#arrays">Arrays</strong> 940 </td> 941 </tr> 942 <tr> 943 <td><strong>Option</strong> 944 </td> 945 <td><strong>Cray</strong> 946 </td> 947 <td><strong>GNU</strong> 948 </td> 949 <td><strong>IBM</strong> 950 </td> 951 <td><strong>Intel</strong> 952 </td> 953 <td><strong>PGI</strong> 954 </td> 955 <td><strong>Flang</strong> 956 </td> 957 </tr> 958 <tr> 959 <tr> 960 <td>Enable coarrays 961 </td> 962 <td>h caf 963 </td> 964 <td>fcoarray=<em>key</em> 965 </td> 966 <td>N/A 967 </td> 968 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-coarray-qcoarray">coarray[=keyword]</a> 969 </td> 970 <td>N/A 971 </td> 972 <td>N/A 973 </td> 974 </tr> 975 <tr> 976 <td>Contiguous array pointers 977 </td> 978 <td>h contiguous 979 </td> 980 <td>N/A 981 </td> 982 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=142">qassert=contig</a> 983 </td> 984 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume contiguous_pointer</a> 985 </td> 986 <td>N/A 987 </td> 988 <td>N/A 989 </td> 990 </tr> 991 <tr> 992 <td>Contiguous assumed shape dummy arguments 993 </td> 994 <td>h contiguous_assumed_shape 995 </td> 996 <td>frepack-arrays 997 </td> 998 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=142">qassert=contig</a> 999 </td> 1000 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-assume">assume contiguous_assumed_shape</a> 1001 </td> 1002 <td>N/A 1003 </td> 1004 <td>N/A 1005 </td> 1006 </tr> 1007</table> 1008 1009 1010 1011 1012<table> 1013 <tr> 1014 <td colspan="7" ><strong>OpenACC, OpenMP, and CUDA</strong> 1015 </td> 1016 </tr> 1017 <tr> 1018 <td><strong>Option</strong> 1019 </td> 1020 <td><strong>Cray</strong> 1021 </td> 1022 <td><strong>GNU</strong> 1023 </td> 1024 <td><strong>IBM</strong> 1025 </td> 1026 <td><strong>Intel</strong> 1027 </td> 1028 <td><strong>PGI</strong> 1029 </td> 1030 <td><strong>Flang</strong> 1031 </td> 1032 </tr> 1033 <tr> 1034 <td>Enable OpenACC 1035 </td> 1036 <td> <a href="https://pubs.cray.com/content/S-3901/8.7/cray-fortran-reference-manual/program-model-specific-options">h acc</a> 1037 </td> 1038 <td>fopenacc 1039 </td> 1040 <td>N/A 1041 </td> 1042 <td>N/A 1043 </td> 1044 <td><a href="https://www.pgroup.com/resources/docs/19.1/x86/pgi-ref-guide/index.htm#acc">acc</a> 1045 </td> 1046 <td>N/A 1047 </td> 1048 </tr> 1049 <tr> 1050 <td>Enable OpenMP 1051 </td> 1052 <td> <a href="https://pubs.cray.com/content/S-3901/8.7/cray-fortran-reference-manual/program-model-specific-options">h omp</a> 1053 </td> 1054 <td>fopenmp 1055 </td> 1056 <td><a href="https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=285">qswapomp</a> 1057 </td> 1058 <td><a href="https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-qopenmp-qopenmp">qopenmp</a>, 1059<p> 1060<a href="https://software.intel.com/node/26d2aef3-9c68-4ef2-9241-bce168a48629">qopenmp-lib</a>, 1061<p> 1062<a href="https://software.intel.com/node/f8d22e40-7ed0-4ec6-8e80-d4d27010ca8b">qopenmp-link</a>, 1063<p> 1064<a href="https://software.intel.com/node/2cc99a64-9605-44e2-b40a-1409ba459a62">qopenmp-offload</a>, 1065<p> 1066<a href="https://software.intel.com/node/02ef8658-3e66-4634-8a11-68eec60322c1">qopenmp-simd</a>, 1067<p> 1068<a href="https://software.intel.com/node/088272f2-5eae-42c2-a053-20f42022343d">qopenmp-stubs</a>, 1069<p> 1070<a href="https://software.intel.com/node/0ed8bee0-62b4-4266-8cbb-f25b585d4800">qopenmp-threadprivate</a> 1071 </td> 1072 <td><a href="https://www.pgroup.com/resources/docs/19.1/x86/pgi-ref-guide/index.htm#mp">mp</a>, 1073<p> 1074Mcuda 1075 </td> 1076 <td>-mp 1077 </td> 1078 </tr> 1079</table> 1080 1081 1082 1083<table> 1084 <tr> 1085 <td colspan="7" ><strong><a href="#miscellaneous">Miscellaneous</a></strong> 1086 </td> 1087 </tr> 1088 <tr> 1089 <td><strong>Option</strong> 1090 </td> 1091 <td><strong>Cray</strong> 1092 </td> 1093 <td><strong>GNU</strong> 1094 </td> 1095 <td><strong>IBM</strong> 1096 </td> 1097 <td><strong>Intel</strong> 1098 </td> 1099 <td><strong>PGI</strong> 1100 </td> 1101 <td><strong>Flang</strong> 1102 </td> 1103 </tr> 1104 <tr> 1105 <td>Disable compile time range checking 1106 </td> 1107 <td> N/A 1108 </td> 1109 <td>fno-range-check 1110 </td> 1111 <td>N/A 1112 </td> 1113 <td>N/A 1114 </td> 1115 <td>N/A 1116 </td> 1117 <td>N/A 1118 </td> 1119 </tr> 1120 <tr> 1121 <td>Disable call site checking 1122 </td> 1123 <td>dC 1124 </td> 1125 <td>N/A 1126 </td> 1127 <td>N/A 1128 </td> 1129 <td>N/A 1130 </td> 1131 <td>N/A 1132 </td> 1133 <td>N/A 1134 </td> 1135 </tr> 1136 <tr> 1137 <td>Warn for bad call checking 1138 </td> 1139 <td>eb 1140 </td> 1141 <td>N/A 1142 </td> 1143 <td>N/A 1144 </td> 1145 <td>N/A 1146 </td> 1147 <td>N/A 1148 </td> 1149 <td>N/A 1150 </td> 1151 </tr> 1152 <tr> 1153 <td>Set default accessibility of module entities to PRIVATE 1154 </td> 1155 <td>N/A 1156 </td> 1157 <td>fmodule-private 1158 </td> 1159 <td>N/A 1160 </td> 1161 <td>N/A 1162 </td> 1163 <td>N/A 1164 </td> 1165 <td>N/A 1166 </td> 1167 </tr> 1168 <tr> 1169 <td>Force FORALL to use temp 1170 </td> 1171 <td>N/A 1172 </td> 1173 <td>ftest-forall-temp 1174 </td> 1175 <td>N/A 1176 </td> 1177 <td>N/A 1178 </td> 1179 <td>N/A 1180 </td> 1181 <td>N/A 1182 </td> 1183 </tr> 1184</table> 1185 1186 1187 1188## Notes 1189 1190**<a name="standards"></a>Standards conformance:** 1191 1192All conformance options are similar -- they issue warnings if non-standard features are used. All defaults are to allow extensions without warnings. The GNU, IBM, and Intel compilers allow multiple standard levels to be specified. 1193 1194 1195 1196* **Cray**: The capital "-eN" option specifies to issue error messages for non-compliance rather than warnings. 1197* **GNU:** The "std=_level_" option specifies the standard to which the program is expected to conform. The default value for std is 'gnu', which specifies a superset of the latest Fortran standard that includes all of the extensions supported by GNU Fortran, although warnings will be given for obsolete extensions not recommended for use in new code. The 'legacy' value is equivalent but without the warnings for obsolete extensions. The 'f95', 'f2003', 'f2008', and 'f2018' values specify strict conformance to the respective standards. Errors are given for all extensions beyond the relevant language standard, and warnings are given for the Fortran 77 features that are permitted but obsolescent in later standards. '-std=f2008ts' allows the Fortran 2008 standard including the additions of the Technical Specification (TS) 29113 on Further Interoperability of Fortran with C and TS 18508 on Additional Parallel Features in Fortran. Values for "_level_" are f_95, f2003, f2008, f2008ts, f2018, gnu,_ and _legacy._ 1198 1199**<a name="source"></a>Source format:** 1200 1201**Fixed or free source:** Cray, IBM, and Intel default the source format based on the source file suffix as follows: 1202 1203 1204 1205* **Cray** 1206 * **Free:** .f90, .F90, .f95, .F95, .f03, .F03, .f08, .F08, .ftn, .FTN 1207 * **Fixed:** .f, .F, .for, .FOR 1208* **Intel** 1209 * **Free:** .f90, .F90, .i90 1210 * **Fixed:** .f, .for, .FOR, .ftn, .FTN, .fpp, .FPP, .i 1211 1212IBM Fortran's options allow the source line length to be specified with the option, e.g., "-qfixed=72". IBM bases the default on the name of the command used to invoke the compiler. IBM has 16 different commands that invoke the Fortran compiler, and the default use of free or fixed format and the line length are based on the command name. -qfixed=72 is the default for the xlf, xlf_r, f77, and fort77 commands. -qfree=f90is the default for the f90, xlf90, xlf90_r, f95, xlf95, xlf95_r, f2003, xlf2003, xlf2003_r, f2008, xlf2008, and xlf2008_r commands. The maximum line length for either source format is 132 characters. 1213 1214**Column 1 comment specifier:** All compilers allow "D" in column 1 to specify that the line contains a comment and have this as the default for fixed format source. IBM also supports an "X" in column 1 with the option "-qxlines". 1215 1216**Source line length:** 1217 1218 1219* **Cray:** The "-N _col_" option specifies the line width for fixed- and free-format source lines. The value used for col specifies the maximum number of columns per line. For free form sources, col can be set to 132, 255, or 1023. For fixed form sources, col can be set to 72, 80, 132, 255, or 1023. Characters in columns beyond the col specification are ignored. By default, lines are 72 characters wide for fixed-format sources and 255 characters wide for free-form sources. 1220* **GNU:** For both "ffixed-line-length-_n_" and "ffree-line-length-_n_" options, characters are ignored after the specified length. The default for fixed is 72. The default for free is 132. For free, you can specify 'none' as the length, which means that all characters in the line are meaningful. 1221* **IBM:** For **fixed**, the default is 72. For **free**, there's no default, but the maximum length for either form is 132. 1222* **Intel:** The default is 72 for **fixed** and 132 for **free**. 1223* **PGI, Flang:** 1224 * in free form, it is an error if the line is longer than 1000 characters 1225 * in fixed form by default, characters after column 72 are ignored 1226 * in fixed form with -Mextend, characters after column 132 are ignored 1227 1228**<a name="names"></a>Names, Literals, and other tokens** 1229 1230**Escapes in literals:** 1231 1232 1233* **GNU:** The "-fbackslash" option the interpretation of backslashes in string literals from a single backslash character to "C-style" escape characters. The following combinations are expanded \a, \b, \f, \n, \r, \t, \v, \\, and \0 to the ASCII characters alert, backspace, form feed, newline, carriage return, horizontal tab, vertical tab, backslash, and NUL, respectively. Additionally, \xnn, \unnnn and \Unnnnnnnn (where each n is a hexadecimal digit) are translated into the Unicode characters corresponding to the specified code points. All other combinations of a character preceded by \ are unexpanded. 1234* **Intel:** The option "-assume bscc" tells the compiler to treat the backslash character (\) as a C-style control (escape) character syntax in character literals. "nobscc" specifies that the backslash character is treated as a normal character in character literals. This is the default. 1235 1236**"$" in symbol names:** Allowing "$" in names is controlled by an option in GNU and is the default behavior in IBM and Intel. Presumably, these compilers issue warnings when standard conformance options are enabled. Dollar signs in names don't seem to be allowed in Cray, PGI, or Flang. 1237 1238**<a name="do"></a>DO loop handling** 1239 1240**One trip:** 1241 1242 1243 1244* **IBM:** IBM has two options that do the same thing: "-1" and "-qonetrip". 1245* **Intel:** Intel used to support a "-onetrip" option, but it has been removed. Intel now supports a "-f66" option that ensures that DO loops are executed at least once in addition to [several other Fortran 66 semantic features](https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-f66#320D769C-7C41-4A84-AE0E-50A72296A838). 1246 1247**<a name="real"></a>REAL, DOUBLE PRECISION, and COMPLEX Data** 1248 1249These size options affect the sizes of variables, literals, and intrinsic function results. 1250 1251**Default REAL sizes:** These options do not affect the size of explicitly declared data (for example, REAL(KIND=4). 1252 1253 1254 1255* **Cray:** The "-s default32" and "-s default64" options affect both REAL, INTEGER, and LOGICAL types. 1256 1257**Default DOUBLE PRECISION:** These options allow control of the size of DOUBLE PRECISION types in conjunction with controlling REAL types. 1258 1259 1260 1261* **Cray:** The "-ep" option controls DOUBLE PRECISION. This option can only be enabled when the default data size is 64 bits ("-s default64" or "-s real64"). When "-s default64" or "-s real64" is specified, and double precision arithmetic is disabled, DOUBLE PRECISION variables and constants specified with the D exponent are converted to default real type (64-bit). If double precision is enabled ("-ep"), they are handled as a double precision type (128-bit). Similarly when the "-s default64" or" -s real64" option is used, variables declared on a DOUBLE COMPLEX statement and complex constants specified with the D exponent are mapped to the complex type in which each part has a default real type, so the complex variable is 128-bit. If double precision is enabled ("-ep"), each part has double precision type, so the double complex variable is 256-bit. 1262* **GNU:** The "-fdefault-double-8" option sets the DOUBLE PRECISION type to an 8 byte wide type. Do nothing if this is already the default. If "-fdefault-real-8" is given, DOUBLE PRECISION would instead be promoted to 16 bytes if possible, and "-fdefault-double-8" can be used to prevent this. The kind of real constants like 1.d0 will not be changed by "-fdefault-real-8" though, so also "-fdefault-double-8" does not affect it. 1263 1264**Promote or demote REAL type sizes:** These options change the meaning of data types specified by declarations of the form REAL(KIND=_N_), except, perhaps for PGI. 1265 1266* **GNU:** The allowable combinations are "-freal-4-real-8", "-freal-4-real-10", "-freal-4-real-16", "-freal-8-real-4", "-freal-8-real-10", and "-freal-8-real-16". 1267* **IBM:** The "-qautodbl" option is documented [here](https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=144). 1268* **PGI:** The "-Mr8" option promotes REAL variables and constants to DOUBLE PRECISION variables and constants, respectively. DOUBLE PRECISION elements are 8 bytes in length. The "-Mr8intrinsics" option promotes the intrinsics CMPLX and REAL as DCMPLX and DBLE, respectively. 1269 1270**<a name="integer"></a>INTEGER and LOGICAL Data** 1271 1272These size options affect the sizes of variables, literals, and intrinsic function results. 1273 1274**Default INTEGER sizes:** For all compilers, these options affect both INTEGER and LOGICAL types. 1275 1276**Enable 8 and 16 bit INTEGER and LOGICAL:** This Cray option ("-eh") enables support for 8-bit and 16-bit INTEGER and LOGICAL types that use explicit kind or star values. By default ("-eh"), data objects declared as INTEGER(kind=1) or LOGICAL(kind=1) are 8 bits long, and objects declared as INTEGER(kind=2) or LOGICAL(kind=2) are 16 bits long. When this option is disabled ("-dh"), data objects declared as INTEGER(kind=1), INTEGER(kind=2), LOGICAL(kind=1), or LOGICAL(kind=2) are 32 bits long. 1277 1278**Intrinsic functions** 1279 1280GNU is the only compiler with options governing the use of non-standard intrinsics. For more information on the GNU options, see [here](https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gfortran/Fortran-Dialect-Options.html#Fortran-Dialect-Options). All compilers implement non-standard intrinsics but don't have options that affect access to them. 1281 1282**<a name="arrays"></a>Arrays** 1283 1284**Contiguous array pointers:** All vendors that implement this option (Cray, IBM, and Intel) seem to have apply to all pointer targets. Assuming that the arrays that are targeted by the pointers allows greater optimization. 1285 1286**Contiguous assumed shape dummy arguments:** Cray and Intel have a separate argument that's specific to assumed shape dummy arguments. 1287 1288**<a name="miscellaneous"></a>Miscellaneous** 1289 1290**Disable call site checking:** This Cray option ("-dC") disables some types of standard call site checking. The current Fortran standard requires that the number and types of arguments must agree between the caller and callee. These constraints are enforced in cases where the compiler can detect them, however, specifying "-dC" disables some of this error checking, which may be necessary in order to get some older Fortran codes to compile. If error checking is disabled, unexpected compile-time or run time results may occur. The compiler by default attempts to detect situations in which an interface block should be specified but is not. Specifying "-dC" disables this type of checking as well. 1291 1292**Warn for bad call checking**: This Cray option ("-eb") issues a warning message rather than an error message when the compiler detects a call to a procedure with one or more dummy arguments having the TARGET, VOLATILE or ASYNCHRONOUS attribute and there is not an explicit interface definition. 1293 1294 1295## Appendix 1296 1297 1298### What is and is not included 1299 1300This document focuses on options relevant to the Fortran language definition. This includes some features (such as recursion) that are only indirectly related to the Fortran language definition. Options related to the following areas are not included: 1301 1302* Input/Output 1303* Optimization 1304* Preprocessing 1305* Inlining 1306* Alternate library definition or linking 1307* Choosing file locations for compiler input or output 1308* Modules 1309* Warning and error messages and listing output 1310* Data initialization 1311* Run time checks 1312* Debugging 1313* Specification of operating system 1314* Target architecture 1315* Assembler generation 1316* Threads or parallelization 1317* Profiling and code coverage 1318 1319### Data sources 1320 1321Here's the list of compilers surveyed, hot linked to the source of data on it. Note that this is the only mention of the Oracle and NAG compilers in this document. 1322 1323 1324* [Cray Fortran Reference Manual version 8.7](https://pubs.cray.com/content/S-3901/8.7/cray-fortran-reference-manual/compiler-command-line-options) 1325* IBM (XLF) version 14.1 -- [Compiler Referenc](https://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1#page=93)e, [Language Reference](https://www-01.ibm.com/support/docview.wss?uid=swg27024776&aid=1) 1326* [Intel Fortran version 19.0](https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-alphabetical-list-of-compiler-options) 1327* [GNU Fortran Compiler version 8.3.0](https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gfortran/Option-Summary.html) 1328* [NAG Fortran Release 6.2](https://www.nag.co.uk/nagware/np/r62_doc/manual/compiler_2_4.html) 1329* [Oracle Fortran version 819-0492-10](https://docs.oracle.com/cd/E19059-01/stud.10/819-0492/3_options.html) 1330* PGI -- [Compiler Reference version 19.1](https://www.pgroup.com/resources/docs/19.1/x86/pgi-ref-guide/index.htm#cmdln-options-ref), [Fortran Reference Guide version 17](https://www.pgroup.com/doc/pgi17fortref.pdf) 1331* [Flang](https://github.com/flang-compiler/flang/wiki/Using-Flang) -- information from GitHub 1332 1333This document has been kept relatively small by providing links to much of the information about options rather than duplicating that information. For IBM, Intel, and some PGI options, there are direct links. But direct links were not possible for Cray, GNU and some PGI options. 1334 1335Many compilers have options that can either be enabled or disabled. Some compilers indicate this by the presence or absence of the letters "no" in the option name (IBM, Intel, and PGI) while Cray precedes many options with either "e" for enabled or "d" for disabled. This document only includes the enabled version of the option specification. 1336 1337Deprecated options were generally ignored, even though they were documented. 1338