📄 g77install.texi
字号:
in your system's documentation.@node Always Flush Output@subsection Always Flush Output@cindex ALWAYS_FLUSH@cindex synchronous write errors@cindex disk full@cindex flushing output@cindex fflush()@cindex I/O, flushing@cindex output, flushing@cindex writes, flushing@cindex NFS@cindex network file systemSome Fortran programs require output(writes) to be flushed to the operating system (under UNIX,via the @code{fflush()} library call) so that errors,such as disk full, are immediately flagged via the relevant@code{ERR=} and @code{IOSTAT=} mechanism, instead of sucherrors being flagged later as subsequent writes occur, forcingthe previously written data to disk, or when the file isclosed.Essentially, the difference can be viewed as synchronous errorreporting (immediate flagging of errors during writes) versusasynchronous, or, more precisely, buffered error reporting(detection of errors might be delayed).@code{libg2c} supports flagging write errors immediately whenit is built with the @code{ALWAYS_FLUSH} macro defined.This results in a @code{libg2c} that runs slower, sometimesquite a bit slower, under certain circumstances---for example,accessing files via the networked file system NFS---but theeffect can be more reliable, robust file I/O.If you know that Fortran programs requiring this level of precisionof error reporting are to be compiled using theversion of @code{g77} you are building, you might wish tomodify the @code{g77} source tree so that the version of@code{libg2c} is built with the @code{ALWAYS_FLUSH} macrodefined, enabling this behavior.To do this, find this line in @file{@value{path-libf2c}/f2c.h} inyour @code{g77} source tree:@example/* #define ALWAYS_FLUSH */@end exampleRemove the leading @samp{/*@w{ }},so the line begins with @samp{#define},and the trailing @samp{@w{ }*/}.Then build or rebuild @code{g77} as appropriate.@node Maximum Stackable Size@subsection Maximum Stackable Size@vindex FFECOM_sizeMAXSTACKITEM@cindex code, stack variables@cindex maximum stackable size@cindex stack, allocation@cindex segmentation violation@code{g77}, on most machines, puts many variables and arrays on the stackwhere possible, and can be configured (by changing@code{FFECOM_sizeMAXSTACKITEM} in @file{@value{path-g77}/com.c}) to forcesmaller-sized entities into static storage (savingon stack space) or permit larger-sized entities to be put on thestack (which can improve run-time performance, as it presentsmore opportunities for the GBE to optimize the generated code).@emph{Note:} Putting more variables and arrays on the stackmight cause problems due to system-dependent limits on stack size.Also, the value of @code{FFECOM_sizeMAXSTACKITEM} has noeffect on automatic variables and arrays.@xref{But-bugs}, for more information.@node Floating-point Bit Patterns@subsection Floating-point Bit Patterns@cindex cross-compiler, building@cindex floating-point bit patterns@cindex bit patternsThe @code{g77} build will crash if an attempt is made to buildit as a cross-compilerfor a target when @code{g77} cannot reliably determine the bit pattern offloating-point constants for the target.Planned improvements for version 0.6 of @code{g77}will give it the capabilities it needs to not have to crash the buildbut rather generate correct code for the target.(Currently, @code{g77}would generate bad code under such circumstances if it didn't crashduring the build, e.g. when compiling a source file that doessomething like @samp{EQUIVALENCE (I,R)} and @samp{DATA R/9.43578/}.)@node Large Initialization@subsection Initialization of Large Aggregate Areas@cindex speed, of compiler@cindex slow compiler@cindex memory utilization@cindex large initialization@cindex aggregate initializationA warning message is issued when @code{g77} sees code that providesinitial values (e.g. via @code{DATA}) to an aggregate area (@code{COMMON}or @code{EQUIVALENCE}, or even a large enough array or @code{CHARACTER}variable)that is large enough to increase @code{g77}'s compile time by roughlya factor of 10.This size currently is quite small, since @code{g77}currently has a known bug requiring too much memoryand time to handle such cases.In @file{@value{path-g77}/data.c}, the macro@code{FFEDATA_sizeTOO_BIG_INIT_} is definedto the minimum size for the warning to appear.The size is specified in storage units,which can be bytes, words, or whatever, on a case-by-case basis.After changing this macro definition, you must(of course) rebuild and reinstall @code{g77} forthe change to take effect.Note that, as of version 0.5.18, improvements havereduced the scope of the problem for @emph{sparse}initialization of large arrays, especially thosewith large, contiguous uninitialized areas.However, the warning is issued at a point prior towhen @code{g77} knows whether the initialization is sparse,and delaying the warning could mean it is producedtoo late to be helpful.Therefore, the macro definition should not be adjusted toreflect sparse cases.Instead, adjust it to generate the warning when denselyinitialized arrays begin to cause responses noticeably slowerthan linear performance would suggest.@node Alpha Problems Fixed@subsection Alpha Problems Fixed@cindex Alpha, support@cindex 64-bit systems@code{g77} used to warn when it was used to compile Fortran codefor a target configuration that is not basically a 32-bitmachine (such as an Alpha, which is a 64-bit machine, especiallyif it has a 64-bit operating system running on it).That was because @code{g77} was known to not workproperly on such configurations.As of version 0.5.20, @code{g77} is believed to work wellenough on such systems.So, the warning is no longer needed or provided.However, support for 64-bit systems, especially inareas such as cross-compilation and handling ofintrinsics, is still incomplete.The symptomsare believed to be compile-time diagnostics ratherthan the generation of bad code.It is hoped that version 0.6 will completely support 64-bitsystems.@node Quick Start@section Quick Start@cindex quick start@ifset OMIT-FSF-G77For users of the @value{which-g77} version of @code{g77},this information is superceded by the@value{which-gcc} installation instructions.@end ifset@ifclear OMIT-FSF-G77This procedure configures, builds, and installs @code{g77}``out of the box'' and works on most UNIX systems.Each command is identified by a unique number,used in the explanatory text that follows.For the most part, the output of each command is not shown,though indications of the types of responses are given in afew cases.To perform this procedure, the installer must be loggedin as user @code{root}.Much of it can be done while not logged in as @code{root},and users experienced with UNIX administration should beable to modify the procedure properly to do so.Following traditional UNIX conventions, it is assumed thatthe source trees for @code{g77} and @code{gcc} will beplaced in @file{/usr/src}.It also is assumed that the source distributions themselvesalready reside in @file{/usr/FSF}, a naming conventionused by the author of @code{g77} on his own system:@example/usr/FSF/gcc-@value{version-gcc}.tar.gz/usr/FSF/g77-@value{version-g77}.tar.gz@end example@c (You can use @file{gcc-2.7.2.1.tar.gz} instead, or@c the equivalent of it obtained by applying the@c patch distributed as @file{gcc-2.7.2-2.7.2.1.diff.gz}@c to version 2.7.2 of @code{gcc},@c if you remember to make the appropriate adjustments in the@c instructions below.)@c @cindex SunOS4@c Users of the following systems should not blindly follow@c these quick-start instructions, because of problems their@c systems have coping with straightforward installation of@c @code{g77}:@c @c @itemize @bullet@c @item@c SunOS4@c @end itemize@c @c Instead, see @ref{Complete Installation}, for detailed information@c on how to configure, build, and install @code{g77} for your@c particular system.@c Also, see @ref{Trouble,,Known Causes of Trouble with GNU Fortran},@c for information on bugs and other problems known to afflict the@c installation process, and how to report newly discovered ones.@c @c If your system is @emph{not} on the above list, and @emph{is}@c a UNIX system or one of its variants, you should be able to@c follow the instructions below.If you vary @emph{any} of the steps below, you might run intotrouble, including possibly breaking existing programs forother users of your system.Before doing so, it is wise to review the explanations of someof the steps.These explanations follow this list of steps.@examplesh[ 1]# @kbd{cd /usr/src}@set source-dir 1sh[ 2]# @kbd{gunzip -c < /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -}[Might say "Broken pipe"...that is normal on some systems.]@set unpack-gcc 2sh[ 3]# @kbd{gunzip -c < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -}["Broken pipe" again possible.]@set unpack-g77 3sh[ 4]# @kbd{ln -s gcc-@value{version-gcc} gcc}@set link-gcc 4sh[ 5]# @kbd{ln -s g77-@value{version-g77} g77}@set link-g77 5sh[ 6]# @kbd{mv -i g77/* gcc}[No questions should be asked by mv here; or, you made a mistake.]@set merge-g77 6sh[ 7]# @kbd{cd gcc}sh[ 8]# @kbd{./configure --prefix=/usr}[Do not do the above if gcc is not installed in /usr/bin.You might need a different @kbd{--prefix=@dots{}}, asdescribed below.]@set configure-gcc 8sh[ 9]# @kbd{make bootstrap}[This takes a long time, and is where most problems occur.]@set build-gcc 9sh[10]# @kbd{make compare}[This verifies that the compiler is `sane'.If any files are printed, you have likely found a g77 bug.]@set compare-gcc 10sh[11]# @kbd{rm -fr stage1}@set rm-stage1 11sh[12]# @kbd{make -k install}[The actual installation.]@set install-g77 12sh[13]# @kbd{g77 -v}[Verify that g77 is installed, obtain version info.]@set show-version 13sh[14]#@set end-procedure 14@end example@xref{Updating Documentation,,Updating Your Info Directory}, forinformation on how to update your system's top-level @code{info}directory to contain a reference to this manual, so thatusers of @code{g77} can easily find documentation insteadof having to ask you for it.Elaborations of many of the above steps follows:@table @asis@item Step @value{source-dir}: @kbd{cd /usr/src}You can build @code{g77} pretty much anyplace.By convention, this manual assumes @file{/usr/src}.It might be helpful if other users on your systemknew where to look for the source code for theinstalled version of @code{g77} and @code{gcc} in any case.@c @item Step @value{unpack-gcc}: @kbd{gunzip -d @dots{}}@c Here, you might wish to use @file{gcc-2.7.2.1.tar.gz}@c instead, or apply @file{gcc-2.7.2-2.7.2.1.diff.gz} to achieve@c similar results.@item Step @value{unpack-g77}: @kbd{gunzip -d < /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -}It is not always necessary to obtain the latest version of@code{g77} as a complete @file{.tar.gz} file if you havea complete, earlier distribution of @code{g77}.If appropriate, you can unpack that earlierversion of @code{g77}, and then apply the appropriate patchesto achieve the same result---a source tree containing version@value{version-g77} of @code{g77}.@item Step @value{link-gcc}: @kbd{ln -s gcc-@value{version-gcc} gcc}@item Step @value{link-g77}: @kbd{ln -s g77-@value{version-g77} g77}These commands mainly help reduce typing,and help reduce visual clutter in examplesin this manual showing what to type to install @code{g77}.@c Of course, if appropriate, @kbd{ln -s gcc-2.7.2.1 gcc} or@c similar.@xref{Unpacking}, for information onusing distributions of @code{g77} made by organizationsother than the FSF.@item Step @value{merge-g77}: @kbd{mv -i g77/* gcc}After doing this, you can, if you like, type@samp{rm g77} and @samp{rmdir g77-@value{version-g77}} to removethe empty directory and the symbol link to it.But, it might be helpful to leave them around asquick reminders of which version(s) of @code{g77} areinstalled on your system.@xref{Unpacking}, for informationon the contents of the @file{g77} directory (as mergedinto the @file{gcc} directory).@item Step @value{configure-gcc}: @kbd{./configure --prefix=/usr}This is where you specify thatthe @file{g77} and @file{gcc} executables are to beinstalled in @file{/usr/bin/},the @code{g77} and @code{gcc} documentation isto be installed in @file{/usr/info/} and @file{/usr/man/},and so on.You should ensure that any existing installation of the @file{gcc}executable is in @file{/usr/bin/}.However, if that existing version of @code{gcc} is not @value{version-gcc},or if you simply wish to avoid risking overwriting it with anewly built copy of the same version,you can specify @samp{--prefix=/usr/local}(which is the default)or some other path,and invoke the newly installed versiondirectly from that path's @file{bin} directory.@xref{Where to Install,,Where in the World Does Fortran (and GNU CC) Go?},for more information on determining where to install @code{g77}.@xref{Configuring gcc}, for more information on theconfiguration process triggered by invoking the @file{./configure}script.@item Step @value{build-gcc}: @kbd{make bootstrap}@xref{Installation,,Installing GNU CC,gcc,Using and Porting GNU CC}, for informationon the kinds of diagnostics you should expect duringthis procedure.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -