⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gfortran.texi

📁 理解和实践操作系统的一本好书
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
\input texinfo  @c -*-texinfo-*-@c %**start of header@setfilename gfortran.info@set copyrights-gfortran 1999-2007@include gcc-common.texi@settitle The GNU Fortran Compiler@c Create a separate index for command line options@defcodeindex op@c Merge the standard indexes into a single one.@syncodeindex fn cp@syncodeindex vr cp@syncodeindex ky cp@syncodeindex pg cp@syncodeindex tp cp@c TODO: The following "Part" definitions are included here temporarily@c until they are incorporated into the official Texinfo distribution.@c They borrow heavily from Texinfo's \unnchapentry definitions.@tex\gdef\part#1#2{%  \pchapsepmacro  \gdef\thischapter{}  \begingroup    \vglue\titlepagetopglue    \titlefonts \rm    \leftline{Part #1:@* #2}    \vskip4pt \hrule height 4pt width \hsize \vskip4pt  \endgroup  \writetocentry{part}{#2}{#1}}\gdef\blankpart{%  \writetocentry{blankpart}{}{}}% Part TOC-entry definition for summary contents.\gdef\dosmallpartentry#1#2#3#4{%  \vskip .5\baselineskip plus.2\baselineskip  \begingroup    \let\rm=\bf \rm    \tocentry{Part #2: #1}{\doshortpageno\bgroup#4\egroup}  \endgroup}\gdef\dosmallblankpartentry#1#2#3#4{%  \vskip .5\baselineskip plus.2\baselineskip}% Part TOC-entry definition for regular contents.  This has to be% equated to an existing entry to not cause problems when the PDF% outline is created.\gdef\dopartentry#1#2#3#4{%  \unnchapentry{Part #2: #1}{}{#3}{#4}}\gdef\doblankpartentry#1#2#3#4{}@end tex@c %**end of header@c Use with @@smallbook.@c %** start of document@c Cause even numbered pages to be printed on the left hand side of@c the page and odd numbered pages to be printed on the right hand@c side of the page.  Using this, you can print on both sides of a@c sheet of paper and have the text on the same part of the sheet.@c The text on right hand pages is pushed towards the right hand@c margin and the text on left hand pages is pushed toward the left@c hand margin.@c (To provide the reverse effect, set bindingoffset to -0.75in.)@c @tex@c \global\bindingoffset=0.75in@c \global\normaloffset =0.75in@c @end tex@copyingCopyright @copyright{} @value{copyrights-gfortran} Free Software Foundation, Inc.Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.1 orany later version published by the Free Software Foundation; with theInvariant Sections being ``GNU General Public License'' and ``FundingFree Software'', the Front-Covertexts being (a) (see below), and with the Back-Cover Texts being (b)(see below).  A copy of the license is included in the section entitled``GNU Free Documentation License''.(a) The FSF's Front-Cover Text is:     A GNU Manual(b) The FSF's Back-Cover Text is:     You have freedom to copy and modify this GNU Manual, like GNU     software.  Copies published by the Free Software Foundation raise     funds for GNU development.@end copying@ifinfo@dircategory Software development@direntry* gfortran: (gfortran).                  The GNU Fortran Compiler.@end direntryThis file documents the use and the internals ofthe GNU Fortran compiler, (@command{gfortran}).Published by the Free Software Foundation51 Franklin Street, Fifth FloorBoston, MA 02110-1301 USA@insertcopying@end ifinfo@setchapternewpage odd@titlepage@title Using GNU Fortran@versionsubtitle@author The @t{gfortran} team@page@vskip 0pt plus 1filllPublished by the Free Software Foundation@*51 Franklin Street, Fifth Floor@*Boston, MA 02110-1301, USA@*@c Last printed ??ber, 19??.@*@c Printed copies are available for $? each.@*@c ISBN ???@sp 1@insertcopying@end titlepage@c TODO: The following "Part" definitions are included here temporarily@c until they are incorporated into the official Texinfo distribution.@tex\global\let\partentry=\dosmallpartentry\global\let\blankpartentry=\dosmallblankpartentry@end tex@summarycontents@tex\global\let\partentry=\dopartentry\global\let\blankpartentry=\doblankpartentry@end tex@contents@page@c ---------------------------------------------------------------------@c TexInfo table of contents.@c ---------------------------------------------------------------------@ifnottex@node Top@top Introduction@cindex IntroductionThis manual documents the use of @command{gfortran}, the GNU Fortran compiler. You can find in this manual how to invoke@command{gfortran}, as well as its features and incompatibilities.@ifset DEVELOPMENT@emph{Warning:} This document, and the compiler it describes, are stillunder development.  While efforts are made to keep it up-to-date, it mightnot accurately reflect the status of the most recent GNU Fortran compiler.@end ifset@comment@comment  When you add a new menu item, please keep the right hand@comment  aligned to the same column.  Do not use tabs.  This provides@comment  better formatting.@comment@menu* Introduction::Part I: Invoking GNU Fortran* Invoking GNU Fortran:: Command options supported by @command{gfortran}.* Runtime::              Influencing runtime behavior with environment variables.Part II: Language Reference* Fortran 2003 status::  Fortran 2003 features supported by GNU Fortran.* Extensions::           Language extensions implemented by GNU Fortran.* Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran.* Intrinsic Modules::    Intrinsic modules supported by GNU Fortran.* Contributing::         How you can help.* Copying::              GNU General Public License says                         how you can copy and share GNU Fortran.* GNU Free Documentation License::		         How you can copy and share this manual.* Funding::              How to help assure continued work for free software.* Option Index::         Index of command line options* Keyword Index::        Index of concepts@end menu@end ifnottex@c ---------------------------------------------------------------------@c Introduction@c ---------------------------------------------------------------------@node Introduction@chapter Introduction@c The following duplicates the text on the TexInfo table of contents.@iftexThis manual documents the use of @command{gfortran}, the GNU Fortrancompiler. You can find in this manual how to invoke @command{gfortran},as well as its features and incompatibilities.@ifset DEVELOPMENT@emph{Warning:} This document, and the compiler it describes, are stillunder development.  While efforts are made to keep it up-to-date, itmight not accurately reflect the status of the most recent GNU Fortrancompiler.@end ifset@end iftexThe GNU Fortran compiler front end wasdesigned initially as a free replacement for,or alternative to, the unix @command{f95} command;@command{gfortran} is the command you'll use to invoke the compiler.@menu* About GNU Fortran::    What you should know about the GNU Fortran compiler.* GNU Fortran and GCC::  You can compile Fortran, C, or other programs.* Preprocessing and conditional compilation:: The Fortran preprocessor* GNU Fortran and G77::  Why we chose to start from scratch.* Project Status::       Status of GNU Fortran, roadmap, proposed extensions.* Standards::	         Standards supported by GNU Fortran.@end menu@c ---------------------------------------------------------------------@c About GNU Fortran@c ---------------------------------------------------------------------@node About GNU Fortran@section About GNU FortranThe GNU Fortran compiler is still in an early state of development.It can generate code for most constructs and expressions,but much work remains to be done.When the GNU Fortran compiler is finished,it will do everything you expect from any decent compiler: @itemize @bullet@itemRead a user's program,stored in a file and containing instructions writtenin Fortran 77, Fortran 90, Fortran 95 or Fortran 2003.This file contains @dfn{source code}.@itemTranslate the user's program into instructions a computercan carry out more quickly than it takes to translate theinstructions in the firstplace.  The result after compilation of a program is@dfn{machine code},code designed to be efficiently translated and processedby a machine such as your computer.Humans usually aren't as good writing machine codeas they are at writing Fortran (or C++, Ada, or Java),because is easy to make tiny mistakes writing machine code.@itemProvide the user with information about the reasons whythe compiler is unable to create a binary from the source code.Usually this will be the case if the source code is flawed.When writing Fortran, it is easy to make big mistakes.The Fortran 90 requires that the compiler can point outmistakes to the user.An incorrect usage of the language causes an @dfn{error message}.The compiler will also attempt to diagnose cases where theuser's program contains a correct usage of the language,but instructs the computer to do something questionable.This kind of diagnostics message is called a @dfn{warning message}.@itemProvide optional information about the translation passesfrom the source code to machine code.This can help a user of the compiler to find the cause ofcertain bugs which may not be obvious in the source code,but may be more easily found at a lower level compiler output.It also helps developers to find bugs in the compiler itself.@itemProvide information in the generated machine code that canmake it easier to find bugs in the program (using a debugging tool,called a @dfn{debugger}, such as the GNU Debugger @command{gdb}). @itemLocate and gather machine code already generated toperform actions requested by statements in the user's program.This machine code is organized into @dfn{modules} and is locatedand @dfn{linked} to the user program. @end itemizeThe GNU Fortran compiler consists of several components:@itemize @bullet@itemA version of the @command{gcc} command(which also might be installed as the system's @command{cc} command)that also understands and accepts Fortran source code.The @command{gcc} command is the @dfn{driver} program forall the languages in the GNU Compiler Collection (GCC);With @command{gcc},you can compile the source code of any language forwhich a front end is available in GCC.@itemThe @command{gfortran} command itself,which also might be installed as thesystem's @command{f95} command.@command{gfortran} is just another driver program,but specifically for the Fortran compiler only.The difference with @command{gcc} is that @command{gfortran}will automatically link the correct libraries to your program.@itemA collection of run-time libraries.These libraries contain the machine code needed to supportcapabilities of the Fortran language that are not directlyprovided by the machine code generated by the@command{gfortran} compilation phase,such as intrinsic functions and subroutines,and routines for interaction with files and the operating system.@c and mechanisms to spawn,@c unleash and pause threads in parallelized code.@itemThe Fortran compiler itself, (@command{f951}).This is the GNU Fortran parser and code generator,linked to and interfaced with the GCC backend library.@command{f951} ``translates'' the source code toassembler code.  You would typically not use thisprogram directly;instead, the @command{gcc} or @command{gfortran} driverprograms will call it for you.@end itemize@c ---------------------------------------------------------------------@c GNU Fortran and GCC@c ---------------------------------------------------------------------@node GNU Fortran and GCC@section GNU Fortran and GCC@cindex GNU Compiler Collection@cindex GCCGNU Fortran is a part of GCC, the @dfn{GNU Compiler Collection}.  GCCconsists of a collection of front ends for various languages, whichtranslate the source code into a language-independent form called@dfn{GENERIC}.  This is then processed by a common middle end whichprovides optimization, and then passed to one of a collection of backends which generate code for different computer architectures andoperating systems.Functionally, this is implemented with a driver program (@command{gcc})which provides the command-line interface for the compiler.  It callsthe relevant compiler front-end program (e.g., @command{f951} for

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -