Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out which compiler was used: g77 or gfortran

Tags:

gfortran

g77

I'm compiling library for a private project, which depends on a number of libraries. Specifically one of the dependencies is compiled with Fortran. On some instances, I've seen the dependency compiled with g77, on others I've seen it compiled with gfortran. My project then is ./configure'd to link with either -lg2c or -lgfortran, but so far I've been doing it by hand.

If it is possible, how can I find out, from looking into the dependent library (via e.g. nm or some other utility?), whether the used compiler was g77 (and then I'll use -lg2c in my link options) or gfortran (and then I'll use -lgfortran)?

Thanks in advance!

like image 989
jbatista Avatar asked Nov 19 '08 15:11

jbatista


1 Answers

nm filename | fgrep ' __g77'

will give results if g77 was used, meanwhile

nm filename | fgrep '@@GFORTRAN'

will give results if gfortran is used.

like image 93
geocar Avatar answered Nov 27 '22 05:11

geocar