Compiling an MPI Program

This topic describes the basic steps required to compile and link an MPI program, when using only the Intel® MPI Library Development Kit. To compile and link an MPI program with the Intel® MPI Library:

  1. Source the appropriate mpivars.[c]sh script to get the proper environment settings (using Bash* shell):

    $ . <installdir>/bin64/mpivars.sh

  2. Compile your MPI program using the appropriate mpixxx compiler command. For example, to compile a program written in C, use the mpiicc command as follows:

    $ mpiicc <installdir>/test/test.c -o testc

You’ll get an executable file testc in the current directory which can be started immediately. For description of how to launch your application, see Running Applications in this document.

Note

By default, the executable file testc is linked with the multi-threaded optimized Intel MPI Library. If you need to use other configuration, see Intel® MPI Library Configurations.

Other supported compilers have an equivalent command that uses the prefix mpi on the standard compiler command. For the full list of supported compilers, see the Compiler Commands topic in Intel® MPI Library Reference Manual for Linux* OS.