When I try to execute code by using this command:
gcc ASD.c -o ASD.out*I get this:
ASD.c:2:10: fatal error: mpi.h: No such file or directory 2 | #include <mpi.h> | ^~~~~~~
compilation terminated.Any help to fix this, please?
22 Answers
This error message means that your system misses header file named mpi.h.
Depending on your use-case you need to install the following packages:
sudo apt-get install build-essential linux-generic libmpich-dev libopenmpi-dev 1 For compiling MPI codes you should use mpicc as the compiler. This is a script* around gcc (or whatever compiler you have) that sets the proper include and library paths.
If mpicc is an unknown command on your system, see the other answer for the missing packages.
*with OpenMPI it's actually a small executable.