【发布时间】:2015-08-22 08:11:28
【问题描述】:
使用 brew 安装支持 mpi 的 boost 后,当我运行 clang++ -lboost_mpi 时,我仍然收到错误 ld: "library not found for -lboost_mpi"。我能做些什么来克服这个问题?我使用 brew 安装了 boost:
$ brew install boost --with-mpi --without-single
==> Downloading https://downloads.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/boost-1.58.0.tar.bz2
==> ./bootstrap.sh --prefix=/usr/local/Cellar/boost/1.58.0 --libdir=/usr/local/Cellar/boost/1.58.0/lib --without-icu --without-libraries=python
==> ./b2 --prefix=/usr/local/Cellar/boost/1.58.0 --libdir=/usr/local/Cellar/boost/1.58.0/lib -d2 -j4 --layout=tagged --user-config=user-config.jam install t
???? /usr/local/Cellar/boost/1.58.0: 10668 files, 300M, built in 10.9 minutes
如何才能成功使用clang++ -lboost_mpi?
$ mdfind -name libboost_mpi
/usr/local/Cellar/boost/1.58.0/lib/libboost_mpi-mt.dylib
/usr/local/Cellar/boost/1.58.0/lib/libboost_mpi-mt.a
$ clang++ -I/usr/local/Cellar/boost/1.58.0/lib -lboost_mpi
ld: library not found for -lboost_mpi
clang: error: linker command failed with exit code 1 (use -v to see invocation)
【问题讨论】:
标签: c++ macos boost homebrew boost-mpi