首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为mavericks编译libtorrent Rasterbar

为mavericks编译libtorrent Rasterbar
EN

Stack Overflow用户
提问于 2015-06-13 20:10:07
回答 1查看 551关注 0票数 0

我只是使用以下命令从源代码编译和安装boost

$pwd

/Downloads/boost_1_58_0

./b2 threading=multi link=static runtime-link=static cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++"

并在构建完成后获得消息,

Boost C++库已成功构建!

应将以下目录添加到编译器包含路径:

代码语言:javascript
复制
/Downloads/boost_1_58_0

应将以下目录添加到链接器库路径中:

代码语言:javascript
复制
/Downloads/boost_1_58_0/stage/lib

现在,我正在尝试使用sudo pip install .安装lib torrent的python pending

我收到了错误消息b2: command not found,因为我知道b2命令在我构建boost的位置,所以我将setup.py更新为特定的路径。

但是,当我尝试对lib torrent的python绑定进行sudo pip install .时,我得到了下面的消息。

代码语言:javascript
复制
Complete output from command python setup.py egg_info:
    Unable to load Boost.Build: could not find "boost-build.jam"
    ---------------------------------------------------------------
    BOOST_ROOT must be set, either in the environment, or
    on the command-line with -sBOOST_ROOT=..., to the root
    of the boost installation.

    Attempted search from /private/tmp/pip-OWjwyj-build up to the root
    at /Downloads/share/boost-build
    and in these directories from BOOST_BUILD_PATH and BOOST_ROOT: /usr/share/boost-build.
    Please consult the documentation at 'http://www.boost.org'.
    /Downloads/boost_1_58_0/b2 boost=source link=static geoip=static boost-link=static release optimization=space stage_module --abbreviate-paths -j4
    build failed

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-OWjwyj-build

执行完第一个答案中提到的步骤后,我尝试运行make,但它给出了以下错误:

代码语言:javascript
复制
In file included from ../include/libtorrent/torrent_handle.hpp:55:
../include/libtorrent/storage.hpp:346:3: error: no template named 'scoped_ptr'
      in namespace 'boost'; did you mean 'boost::asio::detail::scoped_ptr'?
                boost::scoped_ptr<storage_interface> m_storage;
                ^~~~~~~~~~~~~~~~~
                boost::asio::detail::scoped_ptr
/opt/local/include/boost/asio/detail/scoped_ptr.hpp:27:7: note:
      'boost::asio::detail::scoped_ptr' declared here
class scoped_ptr
      ^
In file included from piece_picker.cpp:41:
In file included from ../include/libtorrent/aux_/session_impl.hpp:66:
In file included from ../include/libtorrent/torrent_handle.hpp:55:
../include/libtorrent/storage.hpp:279:53: error: no viable overloaded
      'operator->'
                error_code const& error() const { return m_storage->error(); }
                                                         ~~~~~~~~~^
/opt/local/include/boost/asio/detail/scoped_ptr.hpp:49:6: note: candidate
      function not viable: 'this' argument has type 'const
      boost::scoped_ptr<storage_interface>', but method is not marked const
  T* operator->()
     ^
In file included from piece_picker.cpp:41:
In file included from ../include/libtorrent/aux_/session_impl.hpp:66:
In file included from ../include/libtorrent/torrent_handle.hpp:55:
../include/libtorrent/storage.hpp:280:59: error: no viable overloaded
      'operator->'
  ...std::string const& error_file() const { return m_storage->error_file(); }
                                                    ~~~~~~~~~^
/opt/local/include/boost/asio/detail/scoped_ptr.hpp:49:6: note: candidate
      function not viable: 'this' argument has type 'const
      boost::scoped_ptr<storage_interface>', but method is not marked const
  T* operator->()
     ^
In file included from piece_picker.cpp:41:
../include/libtorrent/aux_/session_impl.hpp:624:4: error: no template named
      'scoped_ptr' in namespace 'boost'; did you mean
      'boost::asio::detail::scoped_ptr'?
                        boost::scoped_ptr<boost::thread> m_thread;
                        ^~~~~~~~~~~~~~~~~
                        boost::asio::detail::scoped_ptr
/opt/local/include/boost/asio/detail/scoped_ptr.hpp:27:7: note:
      'boost::asio::detail::scoped_ptr' declared here
class scoped_ptr
      ^
EN

回答 1

Stack Overflow用户

发布于 2015-06-14 02:42:30

由于您似乎不介意使用boost-build进行构建,因此最简单的方法是:

代码语言:javascript
复制
export BOOST_ROOT=/Downloads/boost_1_58_0
export BOOST_BUILD_PATH=$BOOST_ROOT/tools/build
export PATH=$PATH:$BOOST_BUILD_PATH/src/engine/bin.macosxx86_64
echo "using darwin ;" >~/user-config.jam

cd libtorrent/bindings/python
b2 boost=source

前4行基本上是安装boost-build (b2)。它假定您在构建b2时的输出目录是bin.macosxx86_64。

它将构建libtorrent python模块,但不会安装它。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30818508

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档