Forrest logo
back to the mpicc tool

mpicc:tldr:3c763

mpicc: Compile and link source code in a single command.
$ mpicc -o ${executable} ${filename-c}
try on your machine

This command is used to compile a C/C++ program using the MPI (Message Passing Interface) library.

Here's a breakdown of each component of the command:

  • mpicc: This is the command to invoke the MPI compiler. It is typically used to compile and link MPI programs.

  • -o: This option specifies the output file name for the executable file that will be generated after successful compilation. ${executable} is a placeholder for the desired name of the executable file.

  • ${filename-c}: This refers to the C/C++ source code file that you want to compile. ${filename-c} is a placeholder for the actual name of the source file.

To use this command, you need to replace ${executable} and ${filename-c} with the appropriate values according to your project. For example, if your C/C++ file is named program.c, and you want the executable file to be named myprogram, the command would be:

mpicc -o myprogram program.c

This would compile program.c using the MPI compiler and generate an executable file named myprogram.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mpicc tool