📄 g77install.texi
字号:
@code{makeinfo} is part of the GNU @code{texinfo} package;@code{makeinfo} version @value{version-makeinfo}is distributed as part ofGNU @code{texinfo} version @value{version-texinfo}.@code{makeinfo} is not needed in the typical case ofinstalling @code{gcc} and @code{g77}.@xref{Missing tools?}, for information on when itmight be needed and how to work around not having it.An up-to-date version of GNU @code{makeinfo} is still convenientwhen obtaining a new version of a GNU distribution such as@code{gcc} or @code{g77},as it allows you to obtain the @file{.diff.gz} fileinstead of the entire @file{.tar.gz} distribution(assuming you have installed @code{patch}).@item @code{patch}The version of GNU @code{patch} used to develop this releaseis @value{version-patch}.Beginning with @code{g77} version 0.5.23, it is no longernecessary to patch the @code{gcc} back end to build @code{g77}.An up-to-date version of GNU @code{patch} is still convenientwhen obtaining a new version of a GNU distribution such as@code{gcc} or @code{g77},as it allows you to obtain the @file{.diff.gz} fileinstead of the entire @file{.tar.gz} distribution(assuming you have installed the tools neededto rebuild derived files, such as @code{makeinfo}).@end table@end ifclear@node Problems Installing@section Problems Installing@cindex problems installing@cindex installation problemsThis is a list of problems (and some apparent problems which don'treally mean anything is wrong) that show up when configuring,building, installing, or porting GNU Fortran.@xref{Installation Problems,,,gcc,Using and Porting GNU CC},for more information on installation problems that can afflicteither @code{gcc} or @code{g77}.@menu* General Problems:: Problems afflicting most or all systems.* System-specific Problems:: Problems afflicting particular systems.* Cross-compiler Problems:: Problems afflicting cross-compilation setups.@end menu@node General Problems@subsection General ProblemsThese problems can occur on most or all systems.@menu* GNU C Required:: Why even ANSI C is not enough.* Patching GNU CC:: Why @code{gcc} needn't be patched.* Building GNU CC Necessary:: Why you can't build @emph{just} Fortran.* Missing strtoul or bsearch:: When linking @code{f771} fails.* Cleanup Kills Stage Directories:: For @code{g77} developers.* LANGUAGES Macro Ignored:: Sometimes @code{LANGUAGES} is ignored.@end menu@node GNU C Required@subsubsection GNU C Required@cindex GNU C required@cindex requirements, GNU CCompiling @code{g77} requires GNU C, not just ANSI C.Fixing this wouldn'tbe very hard (just tedious), but the code using GNU extensions tothe C language is expected to be rewritten for 0.6 anyway,so there are no plans for an interim fix.This requirement does not mean you must already have @code{gcc}installed to build @code{g77}.As long as you have a working C compiler, you can use a``bootstrap'' build to automate the process of first building@code{gcc} using the working C compiler you have, then building@code{g77} and rebuilding @code{gcc} using that just-built @code{gcc},and so on.@node Patching GNU CC@subsubsection Patching GNU CC@cindex patch files@cindex GBE@code{g77} no longer requires application of a patch fileto the @code{gcc} compiler tree.In fact, no such patch file is distributed with @code{g77}.This is as of version 0.5.23and @code{egcs} version 1.0.@node Building GNU CC Necessary@subsubsection Building GNU CC Necessary@cindex @code{gcc}, building@cindex building gccIt should be possible to build the runtime without building @code{cc1}and other non-Fortran items, but, for now, an easy way to do thatis not yet established.@node Missing strtoul or bsearch@subsubsection Missing strtoul or bsearch@cindex bsearch@cindex _bsearch@cindex strtoul@cindex _strtoul@cindex undefined reference (_bsearch)@cindex undefined reference (_strtoul)@cindex f771, linking error for@cindex linking error for f771@cindex @code{ld}, error linking f771@cindex @code{ld}, can't find _bsearch@cindex @code{ld}, can't find _strtoul@cindex SunOS4@ifset OMIT-FSF-G77This information does not apply tothe @value{which-g77} version of @code{g77},@end ifset@ifclear OMIT-FSF-G77On SunOS4 systems, linking the @code{f771} program used toproduce an error message concerning an undefined symbol named@samp{_strtoul}, because the @code{strtoul} library functionis not provided on that system.Other systems have, in the past, been reported to not providetheir own @code{strtoul} or @code{bsearch} function.Some versions @code{g77} tried to default to providing bare-bonesversions of @code{bsearch} and @code{strtoul} automatically,but every attempt at this has failed for at least one kind of system.To limit the failures to those few systems actually missing therequired routines, the bare-bones versions are still provided,in @file{@value{path-g77}/proj.c},if the appropriate macros are defined.These are @code{NEED_BSEARCH} for @code{bsearch} and@code{NEED_STRTOUL} for @code{NEED_STRTOUL}.Therefore, if you are sure your system is missing@code{bsearch} or @code{strtoul} in its library,define the relevant macro(s) before building @code{g77}.This can be done by editing @file{@value{path-g77}/proj.c} and insertingeither or both of the following @samp{#define} statementsbefore the comment shown:@smallexample/* Insert #define statements here. */#define NEED_BSEARCH#define NEED_STRTOUL@end smallexampleThen, continue configuring and building @code{g77} as usual.Or, you can define these on the @code{make} command line.To build with the bundled @code{cc} on SunOS4, for example, try:@smallexamplemake bootstrap BOOT_CFLAGS='-O2 -g -DNEED_STRTOUL'@end smallexampleIf you then encounter problems compiling @file{@value{path-g77}/proj.c},it might be due to a discrepancy between how @code{bsearch}or @code{strtoul} are defined by that file and how they'redeclared by your system's header files.In that case, you'll have to use some basic knowledge of Cto work around the problem, perhaps by editing @file{@value{path-g77}/proj.c}somewhat.@end ifclear@node Cleanup Kills Stage Directories@subsubsection Cleanup Kills Stage Directories@cindex stage directories@cindex make cleanIt'd be helpful if @code{g77}'s @file{Makefile.in} or @file{Make-lang.in}would create the various @file{stage@var{n}} directories and theirsubdirectories, so developers and expert installers wouldn't have toreconfigure after cleaning up.That help has arrived as of version 0.5.23 of @code{g77}and version 1.1 of @code{egcs}.Configuration itself no longer creates any particular directoriesthat are unique to @code{g77}.The build procedures in @file{Make-lang.in} take care ofthat, on demand.@node LANGUAGES Macro Ignored@subsubsection LANGUAGES Macro Ignored@cindex @code{LANGUAGES} macro ignored@cindex ignoring @code{LANGUAGES} macroPrior to version 0.5.23 of @code{g77}and version 1.1 of @code{egcs},@code{g77} would sometimes ignorethe absence of @code{f77} and @code{F77} in the@code{LANGUAGES} macro definition used for the@code{make} command being processed.As of @code{g77} version 0.5.23and @code{egcs} version 1.1,@code{g77} now obeys this macroin all relevant situations.However, in versions of @code{gcc} through 2.8.1,non-@code{g77} portions of @code{gcc},such as @code{g++},are known to go ahead and perform variouslanguage-specific activities when theirrespective language strings do not appearin the @code{LANGUAGES} macro in effectduring that invocation of @code{make}.It is expected that these remaining problems willbe fixed in a future version of @code{gcc}.@node System-specific Problems@subsection System-specific Problems@cindex AIXA linker bug on some versions of AIX 4.1 might prevent buildingwhen @code{g77} is built within @code{gcc}.It might also occur when building within @code{egcs}.@ifset DOC-G77@xref{LINKFAIL}.@end ifset@node Cross-compiler Problems@subsection Cross-compiler Problems@cindex cross-compiler, problems@code{g77} has been in alpha testing since September of1992, and in public beta testing since February of 1995.Alpha testing was done by a small number of people worldwide on a fairlywide variety of machines, involving self-compilation in most orall cases.Beta testing has been done primarily via self-compilation,but in more and more cases, cross-compilation (and ``criss-crosscompilation'', where a version of a compiler is built on one machineto run on a second and generate code that runs on a third) hasbeen tried and has succeeded, to varying extents.Generally, @code{g77} can be ported to any configuration to which@code{gcc}, @code{f2c}, and @code{libf2c} can be ported and madeto work together, aside from the known problems described in thismanual.If you want to port @code{g77} to a particular configuration,you should first make sure @code{gcc} and @code{libf2c} can beported to that configuration before focusing on @code{g77}, because@code{g77} is so dependent on them.Even for cases where @code{gcc} and @code{libf2c} work,you might run into problems with cross-compilation on certain machines,for several reasons.@itemize @bullet@itemThere is one known bug(a design bug to be fixed in 0.6) that prevents configuration of@code{g77} as a cross-compiler in some cases,though there are assumptions made duringconfiguration that probably make doing non-self-hosting buildsa hassle, requiring manual intervention.@item@code{gcc} might still have some trouble being configuredfor certain combinations of machines.For example, it might not know how to handle floating-pointconstants.@itemImprovements to the way @code{libg2c} is built could makebuilding @code{g77} as a cross-compiler easier---for example,passing and using @samp{$(LD)} and @samp{$(AR)} in the appropriateways.(This is improved in the @code{egcs} version of @code{g77},especially as of version 1.1.)@itemThere are still some challenges putting together the rightrun-time libraries (needed by @code{libg2c}) for a targetsystem, depending on the systems involved in the configuration.(This is a general problem with cross-compilation, and with@code{gcc} in particular.)@end itemize@node Settings@section Changing Settings Before BuildingHere are some internal @code{g77} settings that can be changedby editing source files in @file{@value{path-g77}/} before building.This information, and perhaps even these settings, representstop-gap solutions to problems people doing various portsof @code{g77} have encountered.As such, none of the following information is expected tobe pertinent in future versions of @code{g77}.@menu* Larger File Unit Numbers:: Raising @code{MXUNIT}.* Always Flush Output:: Synchronizing write errors.* Maximum Stackable Size:: Large arrays forced off the stack.* Floating-point Bit Patterns:: Possible programs building @code{g77} as a cross-compiler.* Large Initialization:: Large arrays with @code{DATA} initialization.* Alpha Problems Fixed:: Problems with 64-bit systems like Alphas now fixed?@end menu@node Larger File Unit Numbers@subsection Larger File Unit Numbers@cindex MXUNIT@cindex unit numbers@cindex maximum unit number@cindex illegal unit number@cindex increasing maximum unit numberAs distributed, whether as part of @code{f2c} or @code{g77},@code{libf2c} accepts file unit numbers only in the range0 through 99.For example, a statement such as @samp{WRITE (UNIT=100)} causesa run-time crash in @code{libf2c}, because the unit number,100, is out of range.If you know that Fortran programs at your installation requirethe use of unit numbers higher than 99, you can change thevalue of the @code{MXUNIT} macro, which represents the maximum unitnumber, to an appropriately higher value.To do this, edit the file @file{@value{path-libf2c}/libI77/fio.h} in your@code{g77} source tree, changing the following line:@example#define MXUNIT 100@end exampleChange the line so that the value of @code{MXUNIT} is defined to beat least one @emph{greater} than the maximum unit number used bythe Fortran programs on your system.(For example, a program that does @samp{WRITE (UNIT=255)} would require@code{MXUNIT} set to at least 256 to avoid crashing.)Then build or rebuild @code{g77} as appropriate.@emph{Note:} Changing this macro has @emph{no} effect on other limitsyour system might place on the number of files open at the same time.That is, the macro might allow a program to do @samp{WRITE (UNIT=100)},but the library and operating system underlying @code{libf2c} mightdisallow it if many other files have already been opened (via @code{OPEN} orimplicitly via @code{READ}, @code{WRITE}, and so on).Information on how to increase these other limits should be found
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -