Google Groups Home
Help | Sign in
Message from discussion weird g77 and gfortran
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
K-9  
View profile
 More options May 5, 11:35 pm
Newsgroups: comp.lang.fortran
From: K-9 <rick.peng...@gmail.com>
Date: Mon, 5 May 2008 20:35:13 -0700 (PDT)
Local: Mon, May 5 2008 11:35 pm
Subject: Re: weird g77 and gfortran
Good question. I'm trying to use g77 because i'm trying to develop
some fortran77-only code. Of course yes i can go with gfortran. I was
just curious to see the reason.

Thanks.

On May 5, 11:26 pm, e p chandler <e...@juno.com> wrote:

> On May 5, 10:55 pm, K-9 <rick.peng...@gmail.com> wrote:

> > Hi guys....I've spent the whole night trying to figure out about this
> > question. Please help me if you have any clue. Thanks a lot.

> > The code is very easy. I'm trying to call a fortran function from C.

> > The code is as follow:

> > =========C code=========
> > #include "stdio.h"

> > extern float r_ (int * d, float *b);

> > main ()
> > {
> >      float a = 1.5, b = 1.05, c = 1;
> >      int d = 2;
> >      c = r_ (&d, &b);
> >      printf ("%f\n", c);

> > }

> > ==========Fortran Code===========
> >       real function r(m,t)
> >       integer m
> >       real t

> >       print *, m, t
> >       r = 0.1*t+46
> >       print *, r

> >       return
> >       end
> > ================================

> > It doesn't matter what the fortran code does...but when I compile it
> > with g77, the result can't be passed back to the C code, but with
> > gfortran, it can.
> > [du@brutus qr]$ g77 -v
> ...
> > gcc version 3.4.6 20060404 (Red Hat 3.4.6-4)
> > [du@brutus qr]$ gfortran -v
> ...
> > gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)

> > [du@brutus qr]$ gcc -v
> ...
> > gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)

> 1. Your g77 and gcc are of two different generations.
> 2. At some point g77 diverged from gfortran. They no longer (IIRC)
> have the same calling conventions.
> 3. Who cares? Is there a compelling reason to use g77, which is no
> longer actively maintained, instead of gfortran, which is under active
> development?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google