Link openmpi openmpi (or mpich2) with Homebrew gcc

I am new to Homebrew (I usually use Macports, but I try to run Homebrew on a second computer) and I want to install the openmpi package (or mpich2). The steps are as follows (performed on Mac OS X Yosemite with Xcode 6 installed):

brew install gcc
brew install openmpi

However, I suspect that the link may have been executed incorrectly for the following reasons:

  • The symbolic link for / usr / local / bin / gcc is missing:

    $ which gcc
    /usr/bin/gcc
    $ gcc --version
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1
    Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
    Target: x86_64-apple-darwin14.0.0
    Thread model: posix
    
    $ which gcc-4.9
    /usr/local/bin/gcc-4.9
    $ gcc-4.9 --version
    gcc-4.9 (Homebrew gcc 4.9.2) 4.9.2
    Copyright (C) 2014 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
  • mpicc could be related to Apple gcc:

    $ which mpicc
    /usr/local/bin/mpicc
    $ mpicc --version
    Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
    Target: x86_64-apple-darwin14.0.0
    Thread model: posix
    

My questions are as follows:

  • /usr/local/bin/gcc? Homebrew ? Homebrew Apple gcc, , gcc-4.9, , Homebrew gcc-4.9 ?

  • Openbrew Open MPI Apple gcc ( gbb)? , ( ) ?

  • , ? , ? , ln -s /usr/local/bin/gcc. (*)?

(*) , , . , (1), (2) (3) , , ( gcc-4.9, Apple gcc).

+4
2

:

1) ( ~\.bashrc):

$ export HOMEBREW_CC=gcc-4.9
$ export HOMEBREW_CXX=g++-4.9

2) openmpi

$ brew reinstall openmpi --build-from-source

3) :

==> Reinstalling open-mpi
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.
Already downloaded: /Library/Caches/Homebrew/open-mpi-1.8.4.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/open-mpi/1.8.4 --disable-silent-rules 
==> make all
==> make check
==> make install
Warning: open-mpi dependency gcc was built with a different C++ standard
library (libstdc++ from clang). This may cause problems at runtime.
🍺  /usr/local/Cellar/open-mpi/1.8.4: 785 files, 23M, built in 41.2 minutes

$ mpicc --showme 
gcc-4.9 -I/usr/local/Cellar/open-mpi/1.8.4/include -L/usr/local/opt/libevent/lib -L/usr/local/Cellar/open-mpi/1.8.4/lib -lmpi

MacBook XCode 6.2,

mpich

$ unlink openmpi
$ brew unlink gcc
$ brew install homebrew/versions/gcc5
$ brew install mpich --build-from-source   
$ mpicc -v
mpicc for MPICH version 3.2
Using built-in specs.
COLLECT_GCC=gcc-5
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc5/5.4.0/libexec/gcc/x86_64-apple-darwin14.5.0/5.4.0/lto-wrapper
Target: x86_64-apple-darwin14.5.0
Configured with: ../configure --build=x86_64-apple-darwin14.5.0 --prefix=/usr/local/Cellar/gcc5/5.4.0 --libdir=/usr/local/Cellar/gcc5/5.4.0/lib/gcc/5 --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-5 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl014 --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc5 5.4.0' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 5.4.0 (Homebrew gcc5 5.4.0) 
+4

, , Open MPI- gcc-4.9 gcc. , Homebrew Open MPI , :

$ find /usr/local -name mpicc-wrapper-data.txt

mpicc-wrapper-data.txt, , compiler=, :

compiler=gcc-4.9

, mpi*-wrapper-data.txt, compiler=.... g++-4.9 mpic++, mpicxx mpiCC. gfortran-4.9 ( ) mpif77 mpif90 ( Open MPI 1.8) mpifort ( >= 1.8).

, , , ABI, Clang GCC. , , OS X, Clang.

+2

All Articles