LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   any recommendations for a fortran compiler for linux? (https://www.linuxquestions.org/questions/programming-9/any-recommendations-for-a-fortran-compiler-for-linux-73750/)

buddy_epson 07-18-2003 01:49 AM

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

kev82 07-18-2003 03:10 AM

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

richardash1981 08-16-2006 07:19 AM

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.

jlliagre 08-18-2006 02:00 AM

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


All times are GMT -5. The time now is 04:45 AM.