Compiling and linking with Fortran


Up: Programming Tips Next: Compiling and linking with gcc or g77 Previous: Compiling with VC++ from the command line

To compile with Visual Fortran, follow the same steps as in the Visual C++ Section Compiling and linking with Microsoft Developer Studio (VC++ 6.x) . Visual Fortran uses the same linker as MS Visual C++.

The mpich dlls contain the following interfaces for Fortran:

    1. MPI_INIT@4 - example symbol in the mpich dll

    Uppercase externals using the standard calling convention with mixed string length parameters. This is the default for Visual Fortran. But, it doesn't allow passing strings to any of the message passing functions like MPI_SEND because strings cause the function signature to change. To use strings you must use the C calling convention.
    2. MPI_INIT

    Uppercase externals using the C calling convention with string length parameters at the end of the list. This is the default for the Intel Fortran compiler. You can also use this interface with Visual Fortran by adding the following compiler flags: /iface:cref /iface:nomixed_str_len_arg
    3. mpi_init__

    Lowercase double underscore externals using the C calling convention with string length parameters at the end of the argument list. This is the default for g77.

If your Fortran compiler is not compatible with any of these interfaces then you will have to re-build the mpich libraries from the source distribution, mpich.nt.1.2.5.src.exe, and change the linkage to match your compiler. See Section Rebuilding the mpich dlls from the source distribution for details on re-building the mpich libraries.



Up: Programming Tips Next: Compiling and linking with gcc or g77 Previous: Compiling with VC++ from the command line