_configtest.c:2:17: fatal error: mpi.h: No such file or directory
#include
^
compilation terminated.
failure.
removing: _configtest.c _configtest.o
error: Cannot compile MPI programs. Check your configuration!!!
Run sudo apt install libopenmpi-dev and then try again.
Same error and I'm using mac.
Try brew install openmpi
In case homebrew can't successfully download the files for you , use a vpn or manual brew Install it.
mac brew install mpich ,I do this setup successfully
On Ubuntu:
sudo apt install linuxbrew-wrapper
brew install openmpi
sudo apt-get install build-essential
PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
brew install openmpi
For those who needs to install software on remote/HPC server, to solve the error, you just need to load MPI library / package before installing the software.
For instance, installing mpi4py for python require MPI library, do the following before installing:
module avail MPI
module load name_of_MPI_library
pip install --user mpi4py # install mpi4py to user's own local directory
For RedHat and CentOS:
yum install openmpi-devel
export CC=/usr/lib64/openmpi/bin/mpicc
pip install mpi4py
Most helpful comment
Run
sudo apt install libopenmpi-devand then try again.