Vladimir Vargas
Vladimir Vargas

Reputation: 1834

gfortran equivalent of the -native flag

I am trying to run the makefile of a program in Fortran 77 that I did not write.

It specifies the following flags:

FLT_FLAGS = -native -libmil

and then uses them to compile a Fortran 77 program:

f77 -O -native -libmil -c a2.f

but fails:

f77: error: unrecognized command line option ‘-native’
makefile:107: recipe for target 'vg.a(a2.o)' failed
make: *** [vg.a(a2.o)] Error 1

The only thing I have been able to find with respect to this issue is that -native is obsolete, and maybe that's why gfortran (f77) does not recognize it: https://docs.oracle.com/cd/E37069_01/html/E37076/aevft.html#scrolltoc

Upvotes: 0

Views: 848

Answers (1)

You are using gfortran version 5.4. I wouldn't call f77 but gfortran directly if I were you.

The correct gfortran option similar to -native in some other compilers is -march=native or -mtune=native. See the manual and GCC: how is march different from mtune?

Don't forget to use other optimization flags like -O2 or -O3. The native option alone is not too useful.

Upvotes: 2

Related Questions