PGF77, PGF90 and PGCC


I have a soft written in Fortran and usion MPICH distribution. I need to compile it using pgf90, ( presence of dynamic fortran allocation). Options ‘-i4 -r8’ are necessary to the compilation source.
But I try to use MPICH 1 distribution, so I guess that I need the same Fortran option.
If I’m not wrong, MPICH 1 seems to be written in C (the main part of the source). So I need to have equivalent option (which one?) for pgcc, no?

I have the same question for a compilation of MPICH 1 using ‘-i8’ Fortran option…? ( equivalent option of the C PGI compiler… ?)

thank for your help

Hi John john,

There is not an equivalent pgcc flag since the number of bytes to represent a particular data type in C is system dependent. In Fortran, the language itself regulates data type sizes. If you declare a variable as “REAL” then the default kind (data type size) is 4 bytes but changes to 8 bytes with “-r8”. However, if you declared a variable “REAL*4”, the compiler wont change the kind, even with “-r8”.

For help on building MPICH, please refer to our MPICH Tips and Techniques pages.

  • Mat

Hi Mat,

Thank you for these precisions… so the conclusion is to not use Fortran option that can control data size if my soft is written in C and Fortran with communications between these two languages, or if my soft uses librairies written in both C and Fortran with communications between these two languages… that’s it?

John John

Hi John john,

In my opinion, it’s better to use macros to define data type sizes especially when writting C and Fortran interfaces. Chapter 10 of the PGI User’s Guide gives a good introduction to Inter-language calling and might be helpful to you.

  • Mat