GNU-Fortran-and-GCC.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1999-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>The GNU Fortran Compiler: GNU Fortran and GCC</title>
  20. <meta name="description" content="The GNU Fortran Compiler: GNU Fortran and GCC">
  21. <meta name="keywords" content="The GNU Fortran Compiler: GNU Fortran and GCC">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Introduction.html#Introduction" rel="up" title="Introduction">
  30. <link href="Preprocessing-and-conditional-compilation.html#Preprocessing-and-conditional-compilation" rel="next" title="Preprocessing and conditional compilation">
  31. <link href="About-GNU-Fortran.html#About-GNU-Fortran" rel="prev" title="About GNU Fortran">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style:oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="GNU-Fortran-and-GCC"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="Preprocessing-and-conditional-compilation.html#Preprocessing-and-conditional-compilation" accesskey="n" rel="next">Preprocessing and conditional compilation</a>, Previous: <a href="About-GNU-Fortran.html#About-GNU-Fortran" accesskey="p" rel="prev">About GNU Fortran</a>, Up: <a href="Introduction.html#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="GNU-Fortran-and-GCC-1"></a>
  69. <h3 class="section">1.2 GNU Fortran and GCC</h3>
  70. <a name="index-GNU-Compiler-Collection"></a>
  71. <a name="index-GCC"></a>
  72. <p>GNU Fortran is a part of GCC, the <em>GNU Compiler Collection</em>. GCC
  73. consists of a collection of front ends for various languages, which
  74. translate the source code into a language-independent form called
  75. <em>GENERIC</em>. This is then processed by a common middle end which
  76. provides optimization, and then passed to one of a collection of back
  77. ends which generate code for different computer architectures and
  78. operating systems.
  79. </p>
  80. <p>Functionally, this is implemented with a driver program (<code>gcc</code>)
  81. which provides the command-line interface for the compiler. It calls
  82. the relevant compiler front-end program (e.g., <code>f951</code> for
  83. Fortran) for each file in the source code, and then calls the assembler
  84. and linker as appropriate to produce the compiled output. In a copy of
  85. GCC which has been compiled with Fortran language support enabled,
  86. <code>gcc</code> will recognize files with <samp>.f</samp>, <samp>.for</samp>, <samp>.ftn</samp>,
  87. <samp>.f90</samp>, <samp>.f95</samp>, <samp>.f03</samp> and <samp>.f08</samp> extensions as
  88. Fortran source code, and compile it accordingly. A <code>gfortran</code>
  89. driver program is also provided, which is identical to <code>gcc</code>
  90. except that it automatically links the Fortran runtime libraries into the
  91. compiled program.
  92. </p>
  93. <p>Source files with <samp>.f</samp>, <samp>.for</samp>, <samp>.fpp</samp>, <samp>.ftn</samp>, <samp>.F</samp>,
  94. <samp>.FOR</samp>, <samp>.FPP</samp>, and <samp>.FTN</samp> extensions are treated as fixed form.
  95. Source files with <samp>.f90</samp>, <samp>.f95</samp>, <samp>.f03</samp>, <samp>.f08</samp>,
  96. <samp>.F90</samp>, <samp>.F95</samp>, <samp>.F03</samp> and <samp>.F08</samp> extensions are
  97. treated as free form. The capitalized versions of either form are run
  98. through preprocessing. Source files with the lower case <samp>.fpp</samp>
  99. extension are also run through preprocessing.
  100. </p>
  101. <p>This manual specifically documents the Fortran front end, which handles
  102. the programming language&rsquo;s syntax and semantics. The aspects of GCC
  103. which relate to the optimization passes and the back-end code generation
  104. are documented in the GCC manual; see
  105. <a href="http://gcc.gnu.org/onlinedocs/gcc/index.html#Top">Introduction</a> in <cite>Using the GNU Compiler Collection (GCC)</cite>.
  106. The two manuals together provide a complete reference for the GNU
  107. Fortran compiler.
  108. </p>
  109. <hr>
  110. <div class="header">
  111. <p>
  112. Next: <a href="Preprocessing-and-conditional-compilation.html#Preprocessing-and-conditional-compilation" accesskey="n" rel="next">Preprocessing and conditional compilation</a>, Previous: <a href="About-GNU-Fortran.html#About-GNU-Fortran" accesskey="p" rel="prev">About GNU Fortran</a>, Up: <a href="Introduction.html#Introduction" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  113. </div>
  114. </body>
  115. </html>