Porting F95 Code to Linux
I have found your Linux Fortran information page very useful, so I
thought I'd contribute my 2c worth. I have recently been working on
porting a sophisticated hydrodynamic and ecological model,
to Linux, and have
had a fair amount of trouble doing so. In part, this was because not
all of the code was strictly standard, but in part, it was because
it relies on Fortran 95, and of the few Fortran 95 compilers available
for Linux, all had bugs that our code showed up.
So, here is my experience:
- Portland Group Fortran and Absoft don't accept nested "where"
statements, which our code relies on heavily. (Fair enough;
they are f90 compilers and don't claim to be f95 compilers).
- NA Software's "Fortran Plus": Does claim to be an f95 compiler,
but doesn't accept nested "where" statements in all cases.
Disappointing. I emailed NA Software and they have acknowledged
this as a bug, but I haven't heard anything more from them.
- Fujitsu Fortran Compiler: This, too, had a bug which prevented
some more complicated variants of nested "where" statements from
compiling correctly. When I emailed Fujitsu, I received a
prompt reply and they released a new version, fixing the problem,
within two weeks. My next problem was a memory leak in our
code -- the DEC Alpha compiler that we had been using previously
must have had some automatic memory management, because the code
blew up very quickly due to pointers that were never dereferenced
when compiled under Fujitsu Fortran. This was our fault, rather
than Fujitsu's, but it would have been nice if the compiler had
offered some way to correct the problem -- in the end, we found
the memory leaks from the warnings given by the NAG compiler,
which we were testing at the same time.
- Lahey Fortran 95, as you've observed, is the same beast as the
Fujitsu compiler, packaged slightly differently. Fujitsu had
better response times directly.
- NAG f95: This had a similar bug. On being notified, NAG took
just a few weeks to get back with a patch that fixed the
problem. I have found this compiler to be very fussy, which
would be a good thing for developing new code, but which is a
pain when trying to port existing code. As mentioned aove,
NAG f95 is pretty good about warning messages. Even after
I managed to get NAG f95 to compile our code, though, it wouldn't
run: I'm getting unexplained run-time errors that don't
occur when the code is compiled with the Fujitsu compiler (or
the DEC Alpha compiler). I suspect that these are still bugs
in our code, as far as the NAG compiler is concerned, but if
so, they are not easy to track down. (I'll spend a little more
time trying to get our code working with this compiler so I can
compare execution speeds with Fujitsu -- if I do, I'll let you
know the results).
Centre for Water Research
University of Western Australia
Last modified: Wed Jan 19 14:52:49 EST 2000