Fortran on Raspbian/Raspberry Pi – compiler options
I’ve just done a quick and nasty comparison of runtimes using GNU Fortran and the recommended compiler flags from here. I used a CFD code mentioned earlier.
Compiling as before (gfortran euler.f
) gave a runtime (using time
) of:
CALCULATION CONVERGED IN 3490 ITERATIONS
TO A CONVERGENCE LIMIT OF 4.99999987E-06
real 1m6.156s
user 1m4.030s
sys 0m0.300s
Next, I compiled using gfortran -march=armv6 -mfpu=vfp -mfloat-abi=hard euler.f
with the following result:
CALCULATION CONVERGED IN 3490 ITERATIONS
TO A CONVERGENCE LIMIT OF 4.99999987E-06
real 1m5.127s
user 1m3.800s
sys 0m0.330s
So a slight speed increase is shown. This difference would probably be amplified when more complex code is compiled. I had none to hand, alas.