MPI - symbols not found for architecture x86_64

Viewed 2314

I was trying to install mpi on my Mac (running Yosemite) and I ran the following:

brew update
brew install open-mpi

Everything seemed to go okay, but when I tried to compile my file mpi.cpp, I received:

 Undefined symbols for architecture x86_64:
  "_MPI_Allgatherv", referenced from:
      _main in mpi.o
  "_MPI_Comm_rank", referenced from:
      _main in mpi.o
  "_MPI_Comm_size", referenced from:
      _main in mpi.o
  "_MPI_Finalize", referenced from:
      _main in mpi.o
  "_MPI_Init", referenced from:
      _main in mpi.o
  "_MPI_Reduce", referenced from:
      _main in mpi.o
  "_MPI_Scatterv", referenced from:
      _main in mpi.o
  "_MPI_Type_commit", referenced from:
      _main in mpi.o
  "_MPI_Type_contiguous", referenced from:
      _main in mpi.o
  "_ompi_mpi_comm_world", referenced from:
      _main in mpi.o
  "_ompi_mpi_double", referenced from:
      _main in mpi.o
  "_ompi_mpi_int", referenced from:
      _main in mpi.o
  "_ompi_mpi_op_min", referenced from:
      _main in mpi.o
  "_ompi_mpi_op_sum", referenced from:
      _main in mpi.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mpi] Error 1

I'm not really sure what to make of this. Is there an additional step?

0 Answers
Related