问题
I have found the code which links against of 'g2c' library. Why do I need it? Just would like to understand why it might be important and what it does in general.
Thanks!
回答1:
What is GNU Fortran?
g77consists of several components:
A modified version of the
gcccommand, which also might be installed as the system'scccommand. (In many cases,ccrefers to the system's “native” C compiler, which might be a non-GNU compiler, or an older version ofgccconsidered more stable or that is used to build the operating system kernel.)The
g77command itself, which also might be installed as the system'sf77command.The
libg2crun-time library. This library contains the machine code needed to support capabilities of the Fortran language that are not directly provided by the machine code generated by theg77compilation phase.
libg2cis just the unique nameg77gives to its version oflibf2cto distinguish it from any copy oflibf2cinstalled from f2c (or versions ofg77that builtlibf2cunder that same name) on the system.
You may think of it as, libg2c is to g77 as libc is to gcc.
Note that as of the GCC 4.x series, g77 has been discontinued, replaced by gfortran, which produces programs that do not require an extra libg2c runtime library.
回答2:
"This library contains the machine code needed to support capabilities of the Fortran language that are not directly provided by the machine code generated by the g77 compilation phase." from this link
回答3:
Installing compat-gcc-34-g77 solves this requirement.
(gcc-34 must be replaced by your gcc version)
来源:https://stackoverflow.com/questions/2406581/what-is-libg2c-library