Re: g95 versus gfortran



Tim Springer wrote:
For me this has raised the following questions.
1) Why are two compilers being developed.
2) What are the differences between the compilers.

To add something to what others have said: There are two philosophies about how to build a Fortran compiler on top of the GCC middle- and back-end. One is to take a stable snapshot of the GCC parts, ideally from a well-debugged non-experimental branch, so that the Fortran parts are the only new things and one doesn't have to deal with updating the Fortran code to deal with changes in the other part of the compiler. The other philosophy is to base one's work on the current GCC development branch, which means that one gets all the recent GCC improvements, but also has to keep dealing with all of the changes those incur, and occasionally deal with new bugs that get introduced.

G95 is an example of the first philosophy. I believe it's currently based on GCC 4.0.4, which is at this point very stable and reasonably well debugged. This means that all the time that Andy puts into it gets spent on Fortran improvements and on fixing Fortran bugs, and his "development" version is essentially a finished product.

GFortran is an example of the second philosophy. It's even included as part of the official GCC source tree, which means that changes to GCC are immediately and automatically part of GFortran. For users, this means that if you want the latest GFortran front end, you also get the latest GCC back-end, with whatever improvements and/or bugs and unfinishedness it might have.

Note that this also means that there are effectively three current GFortran versions, just like there are three current GCC versions. Version 4.1.2 is the current release branch, which at this point is quite stable, but has a fairly incomplete Fortran compiler. Version 4.2.0 is the upcoming release branch (hopefully coming out within a few weeks), which should also be pretty stable once released, and has an essentially complete Fortran compiler. Version 4.3.0 is the development branch, which is essentially in an "alpha" state -- it isn't always stable but it has the latest Fortran bits on it.

- Brooks


--
The "bmoses-nospam" address is valid; no unmunging needed.
.



Relevant Pages

  • GCC / gfortran 4.3.0 approaches the regression-only freeze periode
    ... The GNU Compiler Collection (GCC) and thus also gfortran will soon ... (GAMMA and LOG_GAMMA are also part of the Fortran 2008 draft) ...
    (comp.lang.fortran)
  • GNU Fortran 95: Opinions?
    ... replace g77 in the forthcoming 4.0.0 version of the GNU Compiler ... Since gfortran is still in development, I know many people have not ... Snapshots are available from the GCC web site. ... programmer who wants to see GCC be more useful to the Fortran community. ...
    (comp.lang.fortran)
  • Re: Problem with log function - Intel fortran compiler under Linux
    ... but there were still a lot of omissions and bugs and several programs ... gfortran with 4.1.x, which compiled all my programs correctly, though ... The GCC 4.1.x should be generally usable although gfortran 4.2.x ... Detailed changes in the Fortran frontend: ...
    (comp.lang.fortran)
  • Re: [RFC] Removal of Fortran from the base system
    ... this gfortran will be the one that is bundled with GCC 4.1.1 ... I'm saddened to see FORTRAN ripped out of the base system - and I'd ... But 'ports/lang/gfortran' is an abomination. ... 'ports/lang/gfortran' not only installs a FORTRAN compiler ...
    (freebsd-current)
  • Re: C++ wrapper for a fortran77 program??
    ... If you want the Windows program to ... >fortran functions more easily. ... Now this is where your C++ wrapper might come in useful. ... will have to pass them in the form which your Fortran compiler expects, ...
    (comp.lang.fortran)