LoginSignup
4
4

More than 5 years have passed since last update.

Build TBB (Intel Threading Building Blocks) for RaspberryPi3

Posted at

TBBonARMv7 GitHub stars

1.はじめに

全体の作業含めて10分ぐらいで終了します。
まともに使えるかどうかは別として。。。
ちなみに私はOpenCVの自力ビルド前にTBBをインストールしておいてOpenCVへ組み込んでいます。

この世に必要とする人がいらっしゃるのかどうかは知りません。

2.ビルド手順

事前準備1
$ cd ~
$ wget https://github.com/01org/tbb/archive/2019_U5.tar.gz
$ tar xvf 2019_U5.tar.gz
$ rm 2019_U5.tar.gz
$ cd tbb-2019_U5

$ make tbb CXXFLAGS="-DTBB_USE_GCC_BUILTINS=1 -D__TBB_64BIT_ATOMICS=0"

$ cd ~
$ mkdir libtbb-dev_2019U5_armhf
$ cd libtbb-dev_2019U5_armhf
$ mkdir -p usr/local/lib/pkgconfig
$ mkdir -p usr/local/include
$ mkdir DEBIAN
$ cd ~/libtbb-dev_2019U5_armhf/DEBIAN

$ cat > control

#========== Input below ========================================
Package: libtbb-dev
Priority: extra
Section: universe/libdevel
Maintainer: <Your name>
Architecture: armhf
Version: 2019U5
Homepage: http://threadingbuildingblocks.org/
Description: parallelism library for C++ - development files
 TBB is a library that helps you leverage multi-core processor
 performance without having to be a threading expert. It represents a
 higher-level, task-based parallelism that abstracts platform details
 and threading mechanism for performance and scalability.
 .
 (Note: if you are a user of the i386 architecture, i.e., 32-bit Intel
 or compatible hardware, this package only supports Pentium4-compatible
 and higher processors.)
 .
 This package includes the TBB headers, libs and pkg-config
#========== Above input ========================================

Ctrl+D でCATコマンドを終了。

事前準備2
$ cd ~/libtbb-dev_2019U5_armhf/usr/local/lib
$ cp ~/tbb-2019_U5/build/*_release/libtbb.so.2 .

$ ln -s libtbb.so.2 libtbb.so
$ cd ~/tbb-2019_U5/include
$ cp -r serial tbb ~/libtbb-dev_2019U5_armhf/usr/local/include

$ cd ~/libtbb-dev_2019U5_armhf/usr/local/lib/pkgconfig
$ cat > tbb.pc

#========== Input below ========================================
# Manually added pkg-config file for tbb - START
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: tbb
Description: thread building block
Version: 2019U5
Cflags: -I${includedir} -DTBB_USE_GCC_BUILTINS=1 -D__TBB_64BIT_ATOMICS=0
Libs: -L${libdir} -ltbb
# Manually added pkg-config file for tbb - END
#========== Above input ========================================

Ctrl+D でCATコマンドを終了。

debパッケージのビルド
$ cd ~
$ sudo chown -R root:staff libtbb-dev_2019U5_armhf
$ sudo dpkg-deb --build libtbb-dev_2019U5_armhf

3.インストール

Install
$ sudo dpkg -i ~/libtbb-dev_2019U5_armhf.deb
$ sudo ldconfig
$ rm libtbb-dev_2019U5_armhf.deb
4
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4