[mpich-discuss] mpifort wrapper compiler?

Jeff Hammond jeff.science at gmail.com
Fri Dec 6 08:16:49 CST 2013


>> You said there haven't been F77 compilers for 30 years.  This assumes
>> backwards compatibility of Fortran completely non-conflicting
>> features.  I am asserting this is false.
>
> I think we're getting into finer points, and I think we're both (at least essentially) right: remember that F77 restricted symbols to ***6 characters in length***.  Hence, MPI has *never* been compliant with Fortran 77.  And if you can find a fortran compiler that runs on a system built within the last 10 years that rejects 7 character symbols without any extra CLI options, well, then, more power to you. :-)

I don't think you understand how serious IBM is about language
standards.  If you ask them for a Fortran 77 compile, they will give
you a Fortran 77 compiler:

[jhammond at vestalac1 FORTRAN]$ cat hello77.f
      program hello
      implicit none
      integer x
      double precision i
      integer JeffSquyresIsUnfortunatelyRightSometimes
      print*,'this is ',
     &       ' a Fortran 77 program'
      end program

[jhammond at vestalac1 FORTRAN]$ bgxlf -qlanglvl=77std hello77.f
"hello77.f", line 2.6: 1518-285 (L) The IMPLICIT NONE statement is not
permitted by the FORTRAN 77 standard.
"hello77.f", line 5.15: 1518-253 (L) The length of an identifier must
not exceed 6 characters in the FORTRAN 77 standard.
"hello77.f", line 8.6: 1518-285 (L) The END PROGRAM statement is not
permitted by the FORTRAN 77 standard.
"hello77.f", 1518-264 (L) Lowercase characters have been detected in
the source.  Lowercase characters are not permitted by the FORTRAN 77
standard.
"hello77.f", 1518-317 (L) The POSITION option can cause the compiler
to accept code that does not conform to the FORTRAN 77 standard.
** hello   === End of Compilation 1 ===
1501-510  Compilation successful for file hello77.f.

I recall that one can set the warning threshold such that this
compilation will fail.

Of course, by default, you will not see this strict behavior.

> However, your overall point may still stand:
>
>> I'm going to write some tests and get back to you.  But I know for a
>> fact that the IBM XLF compiler chokes on F77 comment style when it is
>> compiling in F90+ mode.
>
> If this is correct (and doesn't just rely on the .suffix), then yes, your overall point is correct -- a single "mpifort" wrapper compiler may not be sufficient on such platforms (without putting at least a little more knowledge in the wrapper -- which doesn't sound desirable).  In such cases, I would think that you either need 2 MPICH installations (because, at least in one light, you could look at those incompatible Fortran compilers as actually different compilers), or you need to make an exception on that platform for mpif77 to be different than mpifort.

The problem here is that one cannot rely upon filename suffixes to
detect language features.  First, this is not specified as something
one can rely upon in the Fortran standard (or if it is, it is stated
without using any of the words I thought to search for).  Second, it
is not even convention
[http://fortranwiki.org/fortran/show/source+conventions#filename_suffix].

The IBM XLF compiler can compile any valid Fortran code by specifying
the language requested explicitly with a flag.  I suppose I can just
do the following:

alias mpif77='mpifort -gimme-f77'
alias mpif90='mpifort -gimme-f90'
alias mpif95='mpifort -gimme-f95'
alias mpif03='mpifort -gimme-f03'
alias mpif08='mpifort -gimme-f08'

I just find this annoying since it adds a previously unnecessary step
to users' workflow and breaks backwards compatibility for anyone that
relies upon their MPI implementation to provide mpif77.

Jeff

-- 
Jeff Hammond
jeff.science at gmail.com



More information about the discuss mailing list