[Discuss] fortran + gcc 4

pw p.willis at telus.net
Tue Nov 7 12:00:05 PST 2006


Alan W. Irwin wrote:
> On 2006-11-07 09:40-0800 pw wrote:
> 
>> Hello,
>>
>> Does anyone know if g77 works with gcc version 4?
> 
> No it does not.  Use one of the two (see below) free fortran 95 
> alternatives
> instead.
> 
>> The read me at the GNU mirror(s) says not to try anything
>> other than gcc 2.8 with the posted version g77-0.5.23.
>>
>> Alternately does g95 have any problems with g77 code?
> 
> There are actually two free fortran 95 projects.  g95 is independent of
> gcc-4.x but depends upon it while the gfortran project (which forked from
> g95) is part of gcc-4.x (see http://gcc.gnu.org/wiki/GFortran for details.)
> 
> I have no experience with g95, and for gfortran only have experience 
> with making the transition to it from g77 for one project (PLplot).  
> However,
> that transition required no code changes to our fortran 77 interface to
> PLplot and no changes in our fortran 77 examples. From this experience, and
> from reading it appears fortran 77 code is reasonably well supported by
> gfortran (and g95).
> 
> BTW, we have also recently prepared a fortran 95 interface to PLplot as 
> well
> as fortran 95 examples.  That was my first experience with fortran 95, 
> and I
> was most impressed (particularly by the power of the array handling and
> fortran module capabilities for having a well-defined API).  gfortran did
> well in this case also (although I believe there may be some exotic fortran
> 95 capabilities still missing).  From these initial good experiences, I 
> look
> forward to trying out some of my other fortran 77 research codes with
> gfortran and gradually modifying those codes to take advantage of some of
> the fortran 95 array and module features I have learned about.
> 
> Alan
> __________________________
> Alan W. Irwin

Hello,

I found the note, requiring gcc 2.8 for g77, surprising. I think the
compiler on my old machine is gcc 3.1(?). g77 compiled and worked fine
there. I guess I should have read the README file back then.

I bit the bullet and installed gfortran for gcc 4.1.1 .
Anyway, I upgraded to gfortran and now I'll deal with it.

Did you notice whether the command line flags for gfortran
changed much from g77 ? I guess I'll dump out the man pages
for g77 from the old machine and compare to the man pages for gfortran.

Let me know if you need any help porting stuff to fortran 95.
That might be good exercise for my f77 to f95 transition.

Thanks for the info,

Peter




More information about the Discuss mailing list