Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: mpi.h: No such file or directory #114

Closed
Tracked by #1233
guotong1988 opened this issue Aug 24, 2017 · 8 comments
Closed
Tracked by #1233

fatal error: mpi.h: No such file or directory #114

guotong1988 opened this issue Aug 24, 2017 · 8 comments

Comments

@guotong1988
Copy link

_configtest.c:2:17: fatal error: mpi.h: No such file or directory
#include <mpi.h>
^
compilation terminated.
failure.
removing: _configtest.c _configtest.o
error: Cannot compile MPI programs. Check your configuration!!!

@nikoliazekter
Copy link

nikoliazekter commented Aug 24, 2017

Run sudo apt install libopenmpi-dev and then try again.

@JasonHanG
Copy link

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.

@kdldbq
Copy link

kdldbq commented Aug 25, 2017

mac brew install mpich ,I do this setup successfully

@joschu joschu closed this as completed Aug 28, 2017
@rasmh66
Copy link

rasmh66 commented Aug 31, 2017

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

@Xiangju
Copy link

Xiangju commented May 15, 2018

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

@mimoralea
Copy link

For RedHat and CentOS:

yum install openmpi-devel
export CC=/usr/lib64/openmpi/bin/mpicc
pip install mpi4py

Source: https://stackoverflow.com/a/51053324/786279

@straightjacket
Copy link

mac brew install mpich ,I do this setup successfully

Glad I found this thread this worked for me!

@milosjovanov
Copy link

milosjovanov commented Jul 19, 2024

On Amazon Linux 2023, try this:

sudo dnf install openmpi openmpi-develz
export PATH=$PATH:/usr/lib64/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/openmpi/lib
pip3 install mpi4py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants