Re: compiling with cmake and xlf
- From: Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 13 Oct 2011 12:00:08 -0500
In article <1k92jbg.1bib5ld169fgaoN%nospam@xxxxxxxxxxxxx>,
nospam@xxxxxxxxxxxxx (Richard Maine) wrote:
Being unfamiliar with the xlf compiler, I'd
think you could look up the flag needed to
indicate fixed-form source and add that flag
to the others you already have, for that
source file only.
As has been said here over and over again,
F77 is (almost) a proper subset of F90 and
successors, it's only the treatment of the
source form that the compiler needs to know.
The question is whether xlf invokes a separate
executable for that case or not. It would
seem inefficient to me, but what do I know?
My (somewhat weak) understanding of xlf is that it does the opposite.
Although it might look to the user as though there are separate f77 and
f90 compiler executables because they are separate names, it turns out
that they are just links to the same executable, which sets some default
options differently depending what name it was invoked as.
Xlf handles the determination of fixed vs free source form differently
from many other compilers, but it certainly can be done. My memory of
the details is hazy enough that I couldn't give sufficiently accurate
directions for someone to get by without consulting the manual (or
another user) anyway.
I used xlf on MacOSX for several years, but it has been a while so
this info may be out of date.
Also, I don't know anything about CMake, but I did use standard make
and I used these options for fixed and free source:
This more or less made xlf work the same way as everyone else's
fortran compilers regarding source file names. I also used the
following flags for both source formats:
FFLAGS=-O -qextname -qmaxmem=-1
I forger what maxmem did, but I think it was something specific to
addressing modes for the PPC hardware.
I do remember wrestling with extname in various ways. The problem
was that for some unfathomable reason, IBM chose *NOT* to add a
trailing underscore to external names by fortran, even though they
used underscores in the fortran libraries. This means that fortran
libraries are continually in conflict with various other C and POSIX
libraries (e.g. call exit(1) did not work correctly without this
option). So the programmer had to either change the source (e.g.
call exit_(1)) or use this option to avoid the problem. I chose the
latter approach. The extname option forces the trailing underscore.
Most of the fortran libraries had both external names, but not all
of them. For example, their math library, which includes BLAS and
LAPACK, did not have every symbol both ways. So the programmer also
needed a long list of rename options in the loader to get things to
match up. Over time, most of these got fixed, but it took several
years. Then about the time IBM got this right, they decided to stop
supporting their PPC hardware on the Mac, and after a couple of
MacOSX updates, their old software quit working. At the time, the
whole thing seemed like a comedy of errors, they just couldn't get
out of their own way and write nice clean software.
All of this was five or six years ago, so things might have changed
since then. Hopefully for the better.
$.02 -Ron Shepard
- Re: compiling with cmake and xlf
- From: Richard Maine
- Re: compiling with cmake and xlf
- Prev by Date: Re: explicit naming of subroutine parameters in a call
- Next by Date: Re: compiling with cmake and xlf
- Previous by thread: Re: compiling with cmake and xlf
- Next by thread: Re: compiling with cmake and xlf