OpenMPI in Xcode 6.1
To debug OpenMPI programs in Xcode 6.1…
First build a recent version of OpenMPI. From the Terminal…
> curl -O http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.3.tar.gz
> tar -xvzf openmpi-1.8.3.tar.gz
> cd openmpi-1.8.3
> ./configure –prefix=/usr/local/lib/openmpi-1.8.3/ CFLAGS=-m64 CXXFLAGS=-m64 FFLAGS=-m64 FCFLAGS=-m64
> make
> make install
Start a new project. Select OS X -> Application -> Command Line Application
Select Project -> Build Settings -> Add /usr/local/lib/openmpi-1.8.3/include to User Header Search Paths
Under Build Phases, expand Link Binary with Libraries, then add
libmpi_cxx.1.dylib
libmpi.1.dylib
Add…
#include “mpi.h”
to main.cpp
And you should be able to build the project and use Open MPI functions.