为Open Street路由器安装线程构建块

时间:2015-11-06 12:52:38

标签: raspberry-pi openstreetmap raspbian raspberry-pi2 tbb

我正在尝试在运行Raspbian的RaspberryPi 2上构建开放式街道路由机。但是,它需要线程构建块库。我已经尝试了几个apt-get命令,但它一直告诉我它无法找到存储库。具体来说,它说:

Package libtbb-dev is not available,but is refered to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libtbb-dev' has no installation candidate. 

我终于崩溃并下载了TBB源并构建了它。据我所知,线程构建块成功构建,但尝试构建OSRM我仍然得到无法找到TBB库的错误。我已经尝试将构建的TBB目录复制到我认为OSRM正在寻找的位置(“/ opt / intel / tbb”,“/ usr / include”),但没有任何工作。

有没有人知道我可能做错了什么?

编辑:这是我在尝试构建OSRM时收到的错误:

ERROR: Intel TBB NOT found!
-- Looked for Threading Building Blocks in     /opt/intel/tbb;/usr/local/include;/usr/include
CMake Error at cmake/FindTBB.cmake:272 (message):
  Could NOT find TBB library.
Call Stack (most recent call first):
  CMakeLists.txt:191 (find_package)

1 个答案:

答案 0 :(得分:1)

TBB makefile不支持系统范围的安装。它既不会将文件放在/opt也不会放在/usr中。这通常由Intel Composer / Compiler / Parallel Studio安装程序(在/opt/intel中)或Linux发行版本(在/usr中)完成。但是你的发行版似乎没有为安装提供tbb包。

因此,如果您想使用自己编译的TBB二进制文件,请从那里转到$TBBROOT/build/linux*_release/目录和 tbbvars.sh脚本,以便在编译之前设置您的环境你的程序(你将能够编译TBB示例):

$ source ./tbbvars.sh

$ . ./tbbvars.sh

(注意:直接执行它不会给你任何东西,因为你的环境不会被修改)

尽管如此,CMake的FindTBB模块可能仍然愚蠢到仍然没有找到TBB,因为TBB没有正式支持CMake。在这种情况下,您可能需要修复FindTBB模块以查看TBB路径的env变量,或者通过将共享库和包含文件复制到CMake希望它们位于的位置来手动执行类似系统的安装

/opt/intel/tbb中的文件布局如下(修改/缩短ls -R输出):

/opt/intel/tbb/:
/opt/intel/tbb/include:
#copy tbb includes here
/opt/intel/tbb/include/tbb:
*.h
/opt/intel/tbb/include/tbb/compat:
*.h
/opt/intel/tbb/include/tbb/internal:
*.h
/opt/intel/tbb/include/tbb/machine:
*.h
/opt/intel/tbb/lib:
/opt/intel/tbb/lib/ia32_lin:
/opt/intel/tbb/lib/ia32_lin/gcc4.1:
/opt/intel/tbb/lib/ia32_lin/gcc4.1/irml:
/opt/intel/tbb/lib/ia32_lin/gcc4.4:
/opt/intel/tbb/lib/ia32_lin/gcc4.4/irml:
/opt/intel/tbb/lib/intel64_lin:
/opt/intel/tbb/lib/intel64_lin/gcc4.1:
/opt/intel/tbb/lib/intel64_lin/gcc4.1/irml:
/opt/intel/tbb/lib/intel64_lin/gcc4.4:
irml/                    libtbbmalloc_proxy_debug.so    libtbbmalloc.so.2          libtbb.so
libtbb_debug.so          libtbbmalloc_proxy_debug.so.2  libtbb_preview_debug.so    libtbb.so.2
libtbb_debug.so.2        libtbbmalloc_proxy.so          libtbb_preview_debug.so.2
libtbbmalloc_debug.so    libtbbmalloc_proxy.so.2        libtbb_preview.so
libtbbmalloc_debug.so.2  libtbbmalloc.so                libtbb_preview.so.2