Intel oneAPI MacOS MPI install

NOTE: This process is for Intel CPU hardware only! While it may be possible to compile MPICH on Apple Silicon with Intel oneAPI, most programs will not compile or run.


Intel oneAPI for MacOS currently does NOT include MPI. MPICH can be compiled with Intel oneAPI for MPI programs on MacOS with Intel oneAPI. This process also produces “mpiexec” for running MPI programs.

We suggest using the “online installer” download, which is a small download. The “online” installer can be copied over SSH to an HPC user directory for example and installed from the Terminal. Install Xcode and Xcode Command Line Tools.

Install oneAPI Base Toolkit with options:

  • Math Kernel Library (oneMKL)
  • (optional) GDB debugger

Install oneAPI HPC toolkit with options:

  • Intel C++ compiler
  • Intel Fortran compiler

Each time to use Intel oneAPI:

source /opt/intel/oneapi/setvars.sh

MPICH

MPICH will work with Intel oneAPI to provide the MPI libraries and MPIexec with Intel CPU. Download and extract the stable MPICH source. Use commands like:

source /opt/intel/oneapi/setvars.sh

export FC=ifort CC=icc CXX=icpc

mkdir -p $HOME/lib_intel/mpich

./configure --prefix=$HOME/lib_intel/mpich
# the configure step may take tens of minutes

make -j4
# limit number of parallel to avoid crashing build

make install -j4

To use this MPICH with Intel oneAPI in general via CMake, make a file ~/oneapi.sh like:

source /opt/intel/oneapi/setvars.sh

export FC=ifort CC=icc CXX=icpc

export MPI_ROOT=$HOME/lib_intel/mpich

source that file to use oneAPI:

source ~/oneapi.sh

Troubleshooting

If upon compiling a C program stdio.h isn’t found or a C++ program wchar.h isn’t found, install Xcode Command Line Tools for the Xcode version currently installed. If the program persists, the problem may be that the Xcode include path may not be in Intel’s scripts. To workaround this issue, specify the Command Line Tools include directory and source setvars.sh:


If you try to use Apple Silicon with Intel oneAPI:

Intel MKL FATAL ERROR: This system does not meet the minimum requirements for use of the Intel(R) Math Kernel Library.
The processor must support the Intel(R) Supplemental Streaming SIMD Extensions 3 (Intel(R) SSSE3) instructions.
The processor must support the Intel(R) Streaming SIMD Extensions 4.2 (Intel(R) SSE4.2) instructions.
The processor must support the Intel(R) Advanced Vector Extensions (Intel(R) AVX) instructions.