Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: Fortran compiler for Linux/Alpha
@ 1996-10-16 23:18 Michael J. Donahue
  0 siblings, 0 replies; 13+ messages in thread
From: Michael J. Donahue @ 1996-10-16 23:18 UTC (permalink / raw)


Scott Locklin ESG <slocklin@mira.lbl.gov> wrote:
>f2c (using it by itself and with the various drivers) gives me bad results
>with rather simple programs. I was using a simple, well known Runge-Kutta
>diff eq solver (rkf45.f at netlib) which works fine on my HP palmtop,
>various Suns, OSF/1 boxen and etc, but it won't work on Linux-AXP or
>Linux-x86 using f2c. This has nothing to do with math libraries, unless it is
>exception handling related, as RK algorithm doesn't use anything more
>complicated than /.

I don't know if this is related, but I have a double-precision FFT
fortran code that only seems to produce single-precision results (as
compared to output from SGI and Digital Unix f77 compilers) using f2c
on Linux-x86.  I haven't tried to track it down. (I also don't have a
Linux-AXP box yet. ;-( )

-mike
michael.donahue@nist.gov

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <199610180524.BAA08287@rrdjazz.nist.gov>]
* Re: Fortran compiler for Linux/Alpha
@ 1996-10-18  5:24 Przemek Klosowski
  0 siblings, 0 replies; 13+ messages in thread
From: Przemek Klosowski @ 1996-10-18  5:24 UTC (permalink / raw)


f2c (using it by itself and with the various drivers) gives me bad results
   with rather simple programs. I was using a simple, well known Runge-Kutta
   diff eq solver (rkf45.f at netlib) which works fine on my HP palmtop,
   various Suns, OSF/1 boxen and etc, but it won't work on Linux-AXP or

I have often seen Fortran code that fails on f2c because of the
missing SAVE's, i.e. the code assuming that subroutine local variables
are preserved across different calls to this subroutine. This
assumption is not only invalid as per Fortran 77, but is even
mentioned as invalid in DEC VAX FORTRAN manual (VAX fortran is the
prototypical compiler which didn't require SAVEs; other compilers
often fake SAVEs just to avoid revealing this particular deficiency in
code being compiled)

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: Fortran compiler for Linux/Alpha
@ 1996-10-17 18:25 Toon Moene
  0 siblings, 0 replies; 13+ messages in thread
From: Toon Moene @ 1996-10-17 18:25 UTC (permalink / raw)


>  Just a follow-up that may be of interest to f2c users.
>  The fortran code

>        IMPLICIT DOUBLE PRECISION (A - H)
>        c72=0.30901699437494742

>  yields the following C code under f2c:

>      static doublereal c72;
>      c72 =(float).30901699437494742;

>  Why "float"?  However, the following fortran source fixes
>  the problem:

>        c72=DBLE(0.30901699437494742)

Indeed - the whys of this are explained in the g77 docs :-)   
Chapter 14.5 "Certain Changes We Don't Want to Make" second item.

-mike
michael.donahue@nist.gov

		^^^^ National Institute of Standards and Technology
					   ^^^^^^^^^
Interesting ...

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com <  
/dev/null

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: Fortran compiler for Linux/Alpha
@ 1996-10-17 16:59 Craig Burley
  0 siblings, 0 replies; 13+ messages in thread
From: Craig Burley @ 1996-10-17 16:59 UTC (permalink / raw)


>Why "float"?  However, the following fortran source fixes the problem:
>
>      c72=DBLE(0.30901699437494742)

The constant is a single-precision floating-point constant.  If you
want double-precision, which looks to be the case given all the digits
you've specified, rewrite the above statement to:

      c72 = 0.30901699437494742d0

The "d0" says "this is a double-precision constant" just like the
appended "l" or "ll" tells C compilers that a constant is long or (for
gcc) long long.  The "d0" makes _all_ standard-conforming Fortran
compilers interpret the constant as double-precision -- without it,
some will interpret it as single-precision and convert it, resulting
in a double-precision value that is likely to differ beyond the precision
offered by single-precision numbers on that machine.

The g77 documentation has a lot more to say about constants, and the
reason g77 doesn't attempt to use context to determine the intended type
of the constant (as some compilers do, leading to inconsistent behavior
in all sorts of cases).

If, after reading that, you have some desire to learn more about the
issue, comp.lang.fortran is a good place.

        tq vm, (burley)

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: Fortran compiler for Linux/Alpha
@ 1996-10-17 15:44 Michael J. Donahue
  0 siblings, 0 replies; 13+ messages in thread
From: Michael J. Donahue @ 1996-10-17 15:44 UTC (permalink / raw)


I wrote earlier:
>I don't know if this is related, but I have a double-precision FFT
>fortran code that only seems to produce single-precision results (as
>compared to output from SGI and Digital Unix f77 compilers) using f2c
>on Linux-x86.  I haven't tried to track it down.

Just a follow-up that may be of interest to f2c users.  The fortran
code

      IMPLICIT DOUBLE PRECISION (A - H)
      c72=0.30901699437494742

yields the following C code under f2c:

    static doublereal c72;
    c72 =(float).30901699437494742;

Why "float"?  However, the following fortran source fixes the problem:

      c72=DBLE(0.30901699437494742)

-mike
michael.donahue@nist.gov

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <199610162150.OAA23968@topanga.arete.com>]
[parent not found: <Pine.LNX.3.91.961016103053.15626A-100000@zen.linpro.no>]
* Fortran compiler for Linux/Alpha
@ 1996-10-16  8:45 Robert Rødsten
  0 siblings, 0 replies; 13+ messages in thread
From: Robert Rødsten @ 1996-10-16  8:45 UTC (permalink / raw)


Hi, how is the performance of the gnu f2c and gnu g77 compiler using
linux/alpha? I was under the impression that you don't get the same 
performance as from a linux/i386 solution. I would like to hear some
advices from someone who has experience on those compilers.

Thanks in advance. 

Robert R|dsten

LinPro AS, Gaustadalleen 21 
Phone: +47-22958439 Fax: +47-22604427
robertr@linpro.no

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~1996-10-21  8:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-10-16 23:18 Fortran compiler for Linux/Alpha Michael J. Donahue
     [not found] <199610180524.BAA08287@rrdjazz.nist.gov>
1996-10-18 12:47 ` Ulf Griesmann
  -- strict thread matches above, loose matches on Subject: below --
1996-10-18  5:24 Przemek Klosowski
1996-10-17 18:25 Toon Moene
1996-10-17 16:59 Craig Burley
1996-10-17 15:44 Michael J. Donahue
     [not found] <199610162150.OAA23968@topanga.arete.com>
1996-10-17 12:15 ` Jim Nance
1996-10-17 17:41   ` Dwight Hogge
1996-10-17 18:39     ` Jim Nance
     [not found] <Pine.LNX.3.91.961016103053.15626A-100000@zen.linpro.no>
1996-10-16 21:50 ` Dwight Hogge
1996-10-16 22:56 ` Scott Locklin ESG
1996-10-21  8:16 ` Nigel Sale
1996-10-16  8:45 Robert Rødsten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox