libg2c or libf2c
Dear Colleague:
I used to compile Fortran programs on Linux. With Linux, I have to link with either libf2c.a or libg2c.a to get the programs work. What library should I use if I port those codes from Linux to Solaris with Studio?
Thank you for your help.
# 2
Normally, code compiled with g77 only required linking in libg2c if you are directly invoking 'ld', or the code is mixed with C and you are linking with 'gcc'. Normal use of any Fortran compiler is to use it to link the code, which runs the linker with all of the appropriate libraries. If you want to see what they are for Sun, you can use the '-dryrun' flag to see what libraries are getting linked in.
If you were linking in libg2c because it is code mixed with C, then there may be other issues to consider as well. For example, you might need to use the '-mt' flag if there is multi-threaded C code.