What is libg2c library?

2019-04-18 10:54发布

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!

3条回答
女痞
2楼-- · 2019-04-18 11:36

What is GNU Fortran?

g77 consists of several components:

  • A modified version of the gcc command, which also might be installed as the system's cc command. (In many cases, cc refers to the system's “native” C compiler, which might be a non-GNU compiler, or an older version of gcc considered more stable or that is used to build the operating system kernel.)

  • The g77 command itself, which also might be installed as the system's f77 command.

  • The libg2c run-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 the g77 compilation phase.

    libg2c is just the unique name g77 gives to its version of libf2c to distinguish it from any copy of libf2c installed from f2c (or versions of g77 that built libf2c under 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.

查看更多
Animai°情兽
3楼-- · 2019-04-18 11:36

Installing compat-gcc-34-g77 solves this requirement.
(gcc-34 must be replaced by your gcc version)

查看更多
▲ chillily
4楼-- · 2019-04-18 11:47

"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

查看更多
登录 后发表回答