Venturing out the bash
profile in https://repl.it/, their installation includes both gcc
as well as gfortran
:
gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
[...]
gfortran --version
GNU Fortran (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
[...]
I have no difficulty to compile a code compliant to Fortran95 with either one of the two. Yet, as gfortran
is part of gcc
(reference), where are functional advantages to use either the specialist (gfortran
), or the collection (gcc
)?
This is documented in the GNU Fortran manual:
A
gfortran
driver program is also provided, which is identical togcc
except that it automatically links the Fortran runtime libraries into the compiled program.
If your program does not depend on the Fortran run-time library, then you can link it successfully using gcc
. The situation is similar to that of C++ and g++
, except that C++ run-time library dependencies are perhaps more common.