First install MPI if it is not already installed.
Then:
Step 1 – Install GNU binutils
sudo apt install binutils-dev
Step 2 – Download and decompress the mpiP library
Download the mpiP library from the official site and run the following commands from the directory where you decompressed it:
./configure make
Step 3 – Configure your project
Run your project with the following flags:
mpicc -g -o main.c -L${mpiP_root}/lib -lmpiP -lm -lbfd -liberty -lunwind
or for c++:
mpic++ -g -o main.c -L${mpiP_root}/lib -lmpiP -lm -lbfd -liberty -lunwind
Optionally use -O3 etc