0

When trying to install mpi4py on mac I get the error

ERROR: Failed building wheel for mpi4py
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects

and also

      #include <mpi.h>
               ^~~~~~~
      1 error generated.
      failure.
      removing: _configtest.c _configtest.o
      error: Cannot compile MPI programs. Check your configuration!!!

I have seen some answers to this but none of the answers seem to work on mac e.g. sudo apt-get install lipopenmpi-dev results in sudo: apt-get: command not found

15
  • You'll first want to install MPI. Try with Homebrew, one of the (non-Apple) macOS package managers. You'll also need a compatible compiler, which probably means installing gcc through Homebrew. Commented Jan 31, 2024 at 11:39
  • An alternative to try is with Conda. I'm not sure, but it is possible that Conda (or Mamba) will install gcc, MPI and mpi4py for you in one environment. Commented Jan 31, 2024 at 11:41
  • mpi4py is built on top of mpi, so you should have one library installed. that being said, make your life easy and use a package manager such as homebrew or a conda variant. Commented Jan 31, 2024 at 11:41
  • How do I install both mpi and a compiler with homebrew? Sorry I'm pretty new to this! Commented Jan 31, 2024 at 11:42
  • brew.sh for getting Homebrew to work. Commented Jan 31, 2024 at 11:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.