Fortran programs give errors about mismatched types


Up: Frequently Asked Questions Next: Missing Symbols When Linking Previous: C++ Builds Fail

Some Fortran compilers will complain if a subroutine is passed arguments of different types in the same parameter position. For example, if MPI_Bcast is used with an integer in one place and a double precision value in another, you may see

 Argument #1 of `mpi_bcast' is one type at (2) but is some other type at (1)  
This is a strict interpretation of the Fortran standard. To fix this, you will need to tell the compiler to allow this usage. For the GNU g77 compiler, add the command-line option -Wno-globals, as in
 mpif77 -Wno-globals mycode.f 
An alternative is to use a Fortran 90 or Fortran 95 compiler with the MPI module instead of the mpif.h header file.



Up: Frequently Asked Questions Next: Missing Symbols When Linking Previous: C++ Builds Fail