Does Fortran have too many compilers?

Diversity is good as long as all or most are kept up-to-date and competitive. But there needs to be at least one competitive open-source Fortran compiler, that could be used in benchmarks. I thought GFortran was quite competitive in optimizations until I realized otherwise in a recent benchmark against Julia (discussed on this forum).

1 Like

I use gfortran for all my computing. Intel is not that faster to bother the complications of having to recompile everything. What kind of Benchmark do you have in mind? Some specialized task or some comprehensive test?

I use it daily too. In most cases, I actually find gfortran to generate more optimized executables. But it seems like there is room for improvement in hardware-specific optimizations: Simple summation 8x slower than in Julia - #82 by StefanKarpinski
The discussion has become quite lengthy in this post, so I am not if anyone could eventually identify the root of the inferior performance of problem in the benchmark.

1 Like

That discussion is similar to the very classical one about Linux distributions, for example:
https://ask.fedoraproject.org/t/too-many-linux-distributions/8940/8
https://www.garron.me/en/go2linux/are-there-too-many-linux-distributions.html

Depending on the circumstances, a strength can be a weakness, and a weakness can be a strength.

That’s just the way it goes in the Fortran world. What we can do is just avoiding having too many scattered Fortran communities, and that’s why we are here.

3 Likes

A perception that Fortran compilers do not support the latest standards discourages some people from using features from the latest standards or perhaps the language entirely. A new Manning book Parallel and High Performance Computing by Robey and Zamora says in section 2.1.4, p50

Improving code portability

A last code preparation requirement improves code portability to a wider range of compilers and operating systems. Portability begins with the base HPC language, generally C, C++, or Fortran. Each of these languages maintains standards for compiler implementations, and new standard releases occur periodically. But this does not mean that compilers implement these readily. Often the lag time from release to full implementation by compiler vendors can be long. For example, the Polyhedron Solutions website (http://mng.bz/yYne) reports that no Linux Fortran compiler fully implements the 2008 standard, and less than half fully implement the 2003 standard. Of course, what matters is if the compilers have implemented the features that you want. C and C++ compilers are usually more up-to-date in their implementations of new standards, but the lag time can still cause problems for aggressive development teams. Also, even if the features are implemented, it does not mean these work in a wide variety of settings.

I think this information is outdated – there are compiler developers here who can comment.

I bought the electronic and print versions of the book. The Manning email said “This PDF is the final version, identical to the softbound edition, which is currently being printed and is expected to be in stock on 2021-05-21.”, so it is too late to fix the print version.

2 Likes

That text is definitely outdated. It WAS true 5-7 years ago, but since then the implementors have done a great job catching up. Intel is already at full F2018, there are others with full F2008. It gets a bit murky after that in that there are compilers with almost all of F2003 or F2008, but not quite there, some which have already implemented some F2018 features.

The excuse that compilers are lagging is no longer valid.

I’ll also comment that compiler writers are eschewing extensions and concentrating on standard features. This certainly was not the case in the 70s and 80s, but after that, portability and standard-conformance are the focus.

4 Likes

One of the authors Bob Robey is my colleague at LANL, I think he might have written this book a few years ago. As Steve said, I think the compilers have improved. Bob and I and our students worked on the do concurrent support in LFortran about a year ago.

As we do the work as a community to rejuvenate Fortran, the overall culture and perception will change (it is already changing), and as a downstream from that, CS departments might start teaching it again.

3 Likes

Looking at the courses at the Fortran Wiki, it’s my impression that courses with Fortran content are taught by scientists, engineers, or economists, not computer science professors, and that they often cover numerical methods and languages such as Matlab and Python/Numpy as well.

Walt Brainerd tried to sell F as a Java replacement for introductory programming classes in the late 1990s. That failed, although F did help some people like me to migrate to modern Fortran.

I’m surprised the consensus is that the compilers are no longer lagging behind the standard.

My own experience of using F2003 and F2008 features has been one of repeatedly crashing into compiler bugs. A lot of these have been patched in the last year or two, but when users require support for a range of slightly older compilers I have found that writing code that will run reliably is a nightmare.

(A couple of simpler examples: ifort does not support empty array constructors like foo = [String::], and gfortran has patchy support for finalisation, and tends to fall over when you chain function results and constructors e.g. foo = reshape([str('a')], [1,1]))

3 Likes

This is no place for commercial messaging, but.

There exist compilers where a user reported error is likely to be fixed in development overnight and a new download appear within a fortnight or so. You decide what is important to you: community source, cost, performance, feature completeness or fast response. I don’t think you can get everything in one compiler.

3 Likes

There was a time when Andy Vaught fielded g95 bug reports from time zones worldwide (U.S., Europe, Asia, Australia and New Zealand) and sometimes fixed the bugs overnight. But in general you are correct.

1 Like

That might be true, but those two compilers mentioned by veryreverie make for some 99% of all questions asked at Stack Overflow. I myself remember reporting a wrong code problem to Intel only to ask a year later to learn that no-one really cared. Wrong code when using OpenMP collapse - Intel Community No idea about the current status.

1 Like

The 99% is almost total sample selection bias. Compilers without a support email would feature heavily on online forums, compilers with proper support would be invisible because people report their problems to the person that is paid to fix them. Someone should estimate the amount of time (=money) people spend on online forums looking for answers about their “free” software.

1 Like

Might be the case, sometimes, but when I reported the linked problem back in 2014 I had the Premier support valid.

And remember, people normally ask at Stack Overflow there about general Fortran problem, not about problems with the compiler. They just mention their compiler.