any recommendations for a fortran compiler for linux?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789
Rep:
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.