LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Anthony J. Ciani (aciani1_at_[hidden])
Date: 2005-02-02 16:28:46


On Tue, 1 Feb 2005, Tim Prince wrote:
> At 12:56 PM 2/1/2005, Anthony J. Ciani wrote:
>> On Mon, 31 Jan 2005, Brian Barrett wrote:
>>> On Jan 31, 2005, at 5:15 PM, Jonathan Herriott wrote:
>> Umm, if you are using XLF, than just specify XLF as your FORTRAN compiler.
>> The command mpif77 will then be a wrapper for XLF, which will compile all
>> F77, F90, and F95 codes (possibly requiring some different flags for the
>> different types of sources).
>>
>> This is also true if you are on Intel or AMD machines using ifort (formally
>> ifc). I believe that even pgf90 will compile F77 code.
>>
>> If you want to have mixed compilers (g77 for F77 and something else for
>> F90), then use a Makefile which compiles all the F77 code, then sets
>> LAMHF77 to the F90 compiler and compiles those sources. You will almost
>> certainly need to link with the F90 compiler, as they will usually include
>> the GNU libraries, but GCC won't include the other compiler's stuff.
>>
>> I can't really think of any reason to do this, because g77 is worse for F77
>> than any of the F90 compilers, apart from pgf90 (which has
>> interroperability problems with g77, making one use pgf90 anyway).

> I don't get that part about pgf90 being the worst f77 compiler, and g77 the
> 2nd worst. Not that I want to discourage anyone from trying my employer's
> compilers.

Not to start a compiler debate, but this was from a couple different
comparisons between the available F77 compilers for x86 arch. It may also
be old by now. I am fairly certain that both g77 and pgf90 have improved,
but neither of them still holds much of a comparison to ifort.

Primarily, the entire point was that "most" of the F90 and F95 compilers
will also compile F77 code as well, so you could probably just use the
non-GNU compiler to make the FORTRAN interface for LAM, but it will also
work to use g77 to make the interface and set LAMHF77 when you want to use
the non-GNU compiler, because that way you can use g77 and/or non-GNU to
make MPI executables.

> All of the above compilers will have inter-operability problems with g77, due
> to the differences in defaults for number of appended underscores, and the
> incompatible run-time libraries. gfortran likewise. All of them (not sure
> of XLF) have a high degree of compatibility with g77 source code, more than
> just what is implied in the Fortran standards. One Fortran 95 compatible
> mpif77 is enough for one application. Would you attempt to build a lam
> application with a combination of pre-K&R C, a K&R C, a C89, a C99 version of
> mpicc, and likewise multiple C++ dialects?

Actually, ifort uses the same function naming (underscore) conventions as
g77, and is 100% compatible. Intel did realize that the compiler would be
used in a mixed environment. XLF is also highly compatible with g77.
Again, IBM realized that it would be used in a mixed environment. I link
ifort compiled stuff with g77 compiled libraries all the time without
special flags. XLF may need to be told to add the extra underscore. My
experiences with pgf90 and g77 have been very different though.

The "incompatible" run-time libraries are the reason to link with the
non-GNU compiler, as the GNU compiler doesn't know it should include the
non-GNU libraries (although you could always link with ld, which all of
them do anyway). I kinda miss your point about using multiple C
compilers, although someone may actually have to do that. It's a good
thing they all interroperate.

Or maybe you are saying systems should use one FORTRAN compiler
exclusively. That might be nice, and on IBM SP, Sparc, and HP machines
that is the case, but Linux and Mac machines have many system libraries
compiled for g77. I can see no reason to force people to recompile their
system libraries in order to use the non-GNU compiler, and neither can
IBM or Intel.

------------------------------------------------------------
               Anthony Ciani (aciani1_at_[hidden])
            Computational Condensed Matter Physics
    Department of Physics, University of Illinois, Chicago
               http://ciani.phy.uic.edu/~tony
------------------------------------------------------------