LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-18-2003, 01:49 AM   #1
buddy_epson
LQ Newbie
 
Registered: Jun 2003
Distribution: RH
Posts: 8

Rep: Reputation: 0
any recommendations for a fortran compiler for linux?


Does anyone know of a good (FREE/CHEAP) fortran compiler for linux? the f77 and g77 compilers which came with redhat9 seem to have some sort of issue whereby they give less than accurate results with respect to the SunOS Unix compiler I'm using at work. For example, a bit of code I'm running which uses a chi-squared fitting technique will give a value of, say, 5000 for the chi-square fit for a given model on the SunOS/Unix compiler whereas the linux f77 gives a value of 20000 for the same data/parameters! This is entirely unacceptable.

Bud
 
Old 07-18-2003, 03:10 AM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
intel provides a free non-support version of its compiler for linux but i havnt used it, are you sure its not due to the size of data type on the different systems.

i dont have access to a fortran compiler for intel but on SunOS i tried numerical integration of sqrt(x) with both f77 and g77 and got the same answers with both so i doubt its a problem with g77. is it possible that your dividing by really small numbers or subtracting almost equal numbers which are the two major causes of numerical hell. i assume your using double precision instead of real.

also please dont double post

Last edited by kev82; 07-18-2003 at 04:10 PM.
 
Old 08-16-2006, 07:19 AM   #3
richardash1981
LQ Newbie
 
Registered: Aug 2006
Posts: 25
Blog Entries: 1

Rep: Reputation: 18
SunOS (certianly Solaris 1/2) used Integer * 2 as default integer, and possibly real *2 and so on. All the linux compilers use integer *4 (as in C code), real = real *4 = double precision (32bit float = double as in C). So if you have very small and large variables, or have code with hard coded in variable sizes, or have assumed variable storage sizes in common blocks you are likely to get problems.
Also if you don't have interface blocks for functions in the calling code you may have problems with argument type mis-matches which the compiler won't detect, let alone cope with.

If you still don't get the results you expect, then have a look at the intermediate values in both processes (e.g. using gdb). The results can be quite illuminating.
 
Old 08-18-2006, 02:00 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
I wouldn't argue about which one is the culprit (Sun fortran, GCC fortran or the chi-squared source code), but anyway, if you need the same behaviour as Sun's fortran compiler while targetting Linux, you can simply use Sun's fortran compiler which just happen to be available for this platform, and is free.
http://developers.sun.com/prodtech/c...ds/express.jsp
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error Linux Fortran compiler: libimf.so terrence Programming 6 06-15-2012 03:51 PM
does linux fortran compiler in fedora 4 support VAX FORTRAN? terrence Programming 17 08-31-2005 08:59 AM
fortran compiler and guide? spacetrooper Programming 4 03-23-2005 06:48 PM
Fortran Compiler in SuSE? Krater47 Linux - Software 4 09-09-2004 12:10 AM
Fortran Compiler bob10a Linux - Software 14 07-19-2003 04:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration