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

📄 g77install.texi

📁 gcc-2.95.3 Linux下最常用的C编译器
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@xref{Building gcc}, for complete @code{g77}-specificinformation on this step.@item Step @value{compare-gcc}: @kbd{make compare}@xref{Bug Lists,,Where to Port Bugs}, for informationon where to report that you observed fileshaving different contents during thisphase.@xref{Bug Reporting,,How to Report Bugs}, forinformation on @emph{how} to report bugs like this.@item Step @value{rm-stage1}: @kbd{rm -fr stage1}You don't need to do this, but it frees up disk space.@item Step @value{install-g77}: @kbd{make -k install}If this doesn't seem to work, try:@examplemake -k install install-libf77@end exampleOr, make sure you're using GNU @code{make}.@xref{Installation of Binaries}, for more information.@xref{Updating Documentation,,Updating Your Info Directory},for information on entering this manual into yoursystem's list of texinfo manuals.@item Step @value{show-version}: @kbd{g77 -v}If this command prints approximately 25 lines of output,including the GNU Fortran Front End version number (whichshould be the same as the version number for the versionof @code{g77} you just built and installed) and theversion numbers for the three parts of the @code{libf2c}library (@code{libF77}, @code{libI77}, @code{libU77}), andthose version numbers are all in agreement, then there isa high likelihood that the installation has been successfullycompleted.You might consider doing further testing.For example, log in as a non-privileged user, then createa small Fortran program, such as:@example      PROGRAM SMTEST      DO 10 I=1, 10         PRINT *, 'Hello World #', I10    CONTINUE      END@end exampleCompile, link, and run the above program, and, assuming you namedthe source file @file{smtest.f}, the session should look like this:@examplesh# @kbd{g77 -o smtest smtest.f}sh# @kbd{./smtest} Hello World # 1 Hello World # 2 Hello World # 3 Hello World # 4 Hello World # 5 Hello World # 6 Hello World # 7 Hello World # 8 Hello World # 9 Hello World # 10sh#@end exampleIf invoking @code{g77} doesn't seem to work,the problem might be that you've installed it ina location that is not in your shell's search path.For example, if you specified @samp{--prefix=/gnu},and @file{/gnu/bin} is not in your @code{PATH}environment variable,you must explicitly specify the location of the compilervia @kbd{/gnu/bin/g77 -o smtest smtest.f}.After proper installation, you don'tneed to keep your gcc and g77 source and build directoriesaround anymore.Removing them can free up a lot of disk space.@end table@end ifclear@node Complete Installation@section Complete Installation@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-G77Here is the complete @code{g77}-specific information on howto configure, build, and install @code{g77}.@menu* Unpacking::* Merging Distributions::* Where to Install::* Configuring gcc::* Building gcc::* Pre-installation Checks::* Installation of Binaries::* Updating Documentation::* Missing tools?::@end menu@node Unpacking@subsection Unpacking@cindex unpacking distributions@cindex distributions, unpacking@cindex code, source@cindex source code@cindex source tree@cindex packagesThe @code{gcc} source distribution is a stand-alone distribution.It is designed to be unpacked (producing the @code{gcc}source tree) and built as is, assuming certainprerequisites are met (including the availability of compatibleUNIX programs such as @code{make}, @code{cc}, and so on).However, before building @code{gcc}, you will want to unpackand merge the @code{g77} distribution in with it, so that youbuild a Fortran-capable version of @code{gcc}, which includesthe @code{g77} command, the necessary run-time libraries,and this manual.Unlike @code{gcc}, the @code{g77} source distributionis @emph{not} a stand-alone distribution.It is designed to be unpacked and, afterwards, immediately mergedinto an applicable @code{gcc} source tree.That is, the @code{g77} distribution @emph{augments} a@code{gcc} distribution---without @code{gcc}, generallyonly the documentation is immediately usable.A sequence of commands typically used to unpack @code{gcc}and @code{g77} is:@examplesh# @kbd{cd /usr/src}sh# @kbd{gunzip -c /usr/FSF/gcc-@value{version-gcc}.tar.gz | tar xf -}sh# @kbd{gunzip -c /usr/FSF/g77-@value{version-g77}.tar.gz | tar xf -}sh# @kbd{ln -s gcc-@value{version-gcc} gcc}sh# @kbd{ln -s g77-@value{version-g77} g77}sh# @kbd{mv -i g77/* gcc}@end example@emph{Notes:} The commands beginning with @samp{gunzip@dots{}} mightprint @samp{Broken pipe@dots{}} as they complete.That is nothing to worry about, unless you actually@emph{hear} a pipe breaking.The @code{ln} commands are helpful in reducing typingand clutter in installation examples in this manual.Hereafter, the top level of @code{gcc} source tree is referred toas @file{gcc}, and the top level of just the @code{g77}source tree (prior to issuing the @code{mv} command, above)is referred to as @file{g77}.There are three top-level names in a @code{g77} distribution:@exampleg77/COPYING.g77g77/README.g77g77/f@end exampleAll three entries should be moved (or copied) into a @code{gcc}source tree (typically named after its version number andas it appears in the FSF distributions---e.g. @file{gcc-@value{version-gcc}}).@file{g77/f} is the subdirectory containing all of thecode, documentation, and other information that is specificto @code{g77}.The other two files exist to provide information on @code{g77}to someone encountering a @code{gcc} source tree with @code{g77}already present, who has not yet read these installationinstructions and thus needs help understanding that thesource tree they are looking at does not come from a singleFSF distribution.They also help people encountering an unmerged @code{g77} sourcetree for the first time.@cindex modifying @code{g77}@cindex code, modifying@cindex Pentium optimizations@cindex optimization, for Pentium@emph{Note:} Please use @strong{only} @code{gcc} and @code{g77}source trees as distributed by the FSF.Use of modified versions is likely to result in problems that appear to bein the @code{g77} code but, in fact, are not.Do not use such modified versionsunless you understand all the differences between them and the versionsthe FSF distributes---in which case you should be able to modify the@code{g77} (or @code{gcc}) source trees appropriately so @code{g77}and @code{gcc} can coexist as they do in the stock FSF distributions.@node Merging Distributions@subsection Merging Distributions@cindex merging distributions@cindex @code{gcc}, versions supported by @code{g77}@cindex versions, of @code{gcc}@cindex support, @code{gcc} versionsAfter merging the @code{g77} source tree into the @code{gcc} source tree,you have put together a complete @code{g77} source tree.@cindex @code{gcc}, version number@cindex version number@cindex @code{g77}, version number@cindex GNU version numberingAs of version 0.5.23, @code{g77} no longer modifiesthe version number of @code{gcc},nor does it patch @code{gcc} itself.@code{g77} still depends on being merged with anappropriate version of @code{gcc}.For version @value{version-g77} of @code{g77},the specific version of @code{gcc} supported is @value{version-gcc}.However, other versions of @code{gcc} might be suitable``hosts'' for this version of @code{g77}.GNU version numbers make it easy to figure out whether aparticular version of a distribution is newer or older thansome other version of that distribution.The format is,generally, @var{major}.@var{minor}.@var{patch}, witheach field being a decimal number.(You can safely ignoreleading zeros; for example, 1.5.3 is the same as 1.5.03.)The @var{major} field only increases with time.The other two fields are reset to 0 when the field totheir left is incremented; otherwise, they, too, onlyincrease with time.So, version 2.6.2 is newer than version 2.5.8, andversion 3.0 is newer than both.(Trailing @samp{.0} fields often are omitted inannouncements and in names for distributions andthe directories they create.)If your version of @code{gcc} is older than the oldest versionsupported by @code{g77}(as casually determined by listing the contents of @file{@value{path-g77}/INSTALL/},which contains these installation instructions in plain-text format),you should obtain a newer, supported version of @code{gcc}.(You could instead obtain an older version of @code{g77},or try and get your @code{g77} to work with the old@code{gcc}, but neither approach is recommended, andyou shouldn't bother reporting any bugs you find if youtake either approach, because they're probably alreadyfixed in the newer versions you're not using.)If your version of @code{gcc} is newer than the newest versionsupported by @code{g77}, it is possible that your @code{g77}will work with it anyway.If the version number for @code{gcc} differs only in the@var{patch} field, you might as well try that version of @code{gcc}.Since it has the same @var{major} and @var{minor} fields,the resulting combination is likely to work.So, for example, if a particular version of @code{g77} has support for@code{gcc} versions 2.8.0 and 2.8.1,it is likely that @file{gcc-2.8.2} would work well with @code{g77}.However, @file{gcc-2.9.0} would almost certainlynot work with that version of @code{g77}without appropriate modifications,so a new version of @code{g77} would be needed.@cindex distributions, why separate@cindex separate distributions@cindex why separate distributionsThis complexity is the result of @code{gcc} and @code{g77} beingseparate distributions.By keeping them separate, each product is able to be independentlyimproved and distributed to its user base more frequently.However, the GBE interface defined by @code{gcc} typicallyundergoes some incompatible changes at least every time the@var{minor} field of the version number is incremented,and such changes require corresponding changes tothe @code{g77} front end (FFE).@c @pindex config-lang.in@c @emph{Note:} @code{g77}'s configuration file @file{@value{path-g77}/config-lang.in}@c sometimes ensures that the source code for the version of @code{gcc}@c being configured has at least one indication of being an appropriate@c version as required specifically by @code{g77}.@c This configuration-time@c checking should catch failures to use the proper version of @code{gcc} and,@c if so caught, should abort the configuration with an explanation.@c @emph{Please} do not try to disable this check,@c otherwise @code{g77} might well appear to build@c and install correctly, and even appear to compile correctly,@c but could easily produce broken code.@node Where to Install@subsection Where in the World Does Fortran (and GNU CC) Go?@cindex language f77 not recognized@cindex @code{gcc}, will not compile Fortran programsBefore configuring, you should make sure you knowwhere you want the @code{g77} and @code{gcc}binaries to be installed after they're built,because this information is given to the configurationtool and used during the build itself.A @code{g77} installation normally includes installation ofa Fortran-aware version of @code{gcc}, so that the @code{gcc}command recognizes Fortran source files and knows how to compilethem.For this to work, the version of @code{gcc} that you will be buildingas part of @code{g77} @strong{must} be installed as the ``active''version of @code{gcc} on the system.Sometimes people make the mistake of installing @code{gcc} as@file{/usr/local/bin/gcc},leaving an older, non-Fortran-aware version in @file{/usr/bin/gcc}.(Or, the opposite happens.)This can result in @code{gcc} being unable to compile Fortransource files,because when the older version of @code{gcc} is invoked,it complains that it does notrecognize the language, or the file name suffix.So, determine whether @code{gcc} already is installed on your system,and, if so, @emph{where} it is installed, and prepare to configure thenew version of @code{gcc} you'll be building so that it installsover the existing version of @code{gcc}.You might want to back up your existing copy of @file{/usr/bin/gcc}, andthe entire @file{/usr/lib} directory, beforeyou perform the actual installation (as described in this manual).Existing @code{gcc} installations typically arefound in @file{/usr} or @file{/usr/local}.(This means the commands are installed in @file{/usr/bin} or@file{/usr/local/bin},the libraries in @file{/usr/lib} or @file{/usr/local/lib},and so on.)If you aren't certain where the currentlyinstalled version of @code{gcc} and itsrelated programs reside, look at the outputof this command:@examplegcc -v -o /tmp/delete-me -xc /dev/null -xnone@end exampleAll sorts of interesting information on the locations of various@code{gcc}-related programs and data files should be visiblein the output of the above command.

⌨️ 快捷键说明

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