自制程序包之间的链接丢失

时间:2018-12-27 17:02:18

标签: boost package homebrew linker-errors boost-python

我在MacOS 10.12 Sierra上通过boost安装了boost-pythonbrew。但是,boost-python似乎并不认为它的依赖项boost已安装:

$ brew info boost
boost: stable 1.68.0 (bottled), HEAD
Collection of portable C++ source libraries
https://www.boost.org/
/usr/local/Cellar/boost/1.65.1 (12,679 files, 401.2MB)
  Poured from bottle on 2017-10-28 at 09:19:27
/usr/local/Cellar/boost/1.67.0_1 (13,506 files, 447.7MB) *
  Poured from bottle on 2018-05-18 at 03:58:16
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost.rb
==> Dependencies
Optional: icu4c ✔
==> Options
--with-icu4c
    Build regexp engine with icu support
--without-single
    Disable building single-threading variant
--without-static
    Disable building static library variant
--HEAD
    Install HEAD version
==> Caveats
Building of Boost.Log is disabled because it requires newer GCC or Clang.
==> Analytics
install: 51,109 (30 days), 167,563 (90 days), 648,244 (365 days)
install_on_request: 15,663 (30 days), 48,585 (90 days), 191,757 (365 days)
build_error: 0 (30 days)

$ brew info boost-python
boost-python: stable 1.68.0 (bottled), HEAD
C++ library for C++/Python2 interoperability
https://www.boost.org/
/usr/local/Cellar/boost-python/1.65.1 (457 files, 25MB)
  Built from source on 2017-10-28 at 09:23:57 with: --with-python3
/usr/local/Cellar/boost-python/1.67.0 (459 files, 17.3MB) *
  Poured from bottle on 2018-05-18 at 03:58:20
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/boost-python.rb
==> Dependencies
Required: boost ✘
==> Options
--HEAD
    Install HEAD version
==> Analytics
install: 5,214 (30 days), 16,979 (90 days), 76,707 (365 days)
install_on_request: 3,865 (30 days), 12,416 (90 days), 56,500 (365 days)
build_error: 0 (30 days)

如何获取boost-python来识别/链接及其依赖项boost的存在?

如果能避免卸载和重新安装,那将是很棒的,因为boost上还有很多其他软件包依赖项,这使我花了很长时间来工作。

之所以这样做是因为:编译caffe时,它显示为ld: library not found for -lboost_python。谢谢。

1 个答案:

答案 0 :(得分:4)

这就是我设法使boost-python识别其依赖项booth的存在的方法。 不卸载 Homebrew中任何现有的boostboost-python软件包,我运行以下行

brew install --build-from-source -vd boost boost-python

这似乎重新安装了两个软件包并干净地建立了该链接。

要解决Caffe编译问题,此命令在libboost_python27*中生成文件/usr/local/lib,我刚刚将其复制并重命名为libboost_python*

相关问题