* [Buildroot] [PATCH 0/2] tbb and opencv
@ 2017-09-26 20:35 Bradford Barr
2017-09-26 20:35 ` [Buildroot] [PATCH 1/2] tbb: new package Bradford Barr
2017-09-26 20:35 ` [Buildroot] [PATCH 2/2] opencv3: add support for tbb Bradford Barr
0 siblings, 2 replies; 9+ messages in thread
From: Bradford Barr @ 2017-09-26 20:35 UTC (permalink / raw)
To: buildroot
This patch set adds the tbb package, and enables it for opencv3.
[PATCH 1/2] tbb: new package
[PATCH 2/2] opencv3: add support for tbb
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/2] tbb: new package
2017-09-26 20:35 [Buildroot] [PATCH 0/2] tbb and opencv Bradford Barr
@ 2017-09-26 20:35 ` Bradford Barr
2017-09-26 21:31 ` Arnout Vandecappelle
2017-09-27 15:36 ` Samuel Martin
2017-09-26 20:35 ` [Buildroot] [PATCH 2/2] opencv3: add support for tbb Bradford Barr
1 sibling, 2 replies; 9+ messages in thread
From: Bradford Barr @ 2017-09-26 20:35 UTC (permalink / raw)
To: buildroot
From: bradford barr <bradford@density.io>
Intel Threading Building Blocks (TBB), is a C++ library to help developers
write highly parallelized applications. OpenCV uses it to accelerate some of
it's more heavy weight procedures.
Signed-off-by: bradford barr <bradford@density.io>
---
package/Config.in | 1 +
package/tbb/0001-prevent-thumb.patch | 15 +++++++++++++++
package/tbb/0002-cross-compiler.patch | 14 ++++++++++++++
package/tbb/Config.in | 13 +++++++++++++
package/tbb/tbb.hash | 3 +++
package/tbb/tbb.mk | 35 +++++++++++++++++++++++++++++++++++
6 files changed, 81 insertions(+)
create mode 100644 package/tbb/0001-prevent-thumb.patch
create mode 100644 package/tbb/0002-cross-compiler.patch
create mode 100644 package/tbb/Config.in
create mode 100644 package/tbb/tbb.hash
create mode 100644 package/tbb/tbb.mk
diff --git a/package/Config.in b/package/Config.in
index 6acd0c4..f71e781 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1503,6 +1503,7 @@ endif
source "package/skalibs/Config.in"
source "package/sphinxbase/Config.in"
source "package/startup-notification/Config.in"
+ source "package/tbb/Config.in"
source "package/tinycbor/Config.in"
source "package/tz/Config.in"
source "package/tzdata/Config.in"
diff --git a/package/tbb/0001-prevent-thumb.patch b/package/tbb/0001-prevent-thumb.patch
new file mode 100644
index 0000000..942f7f4
--- /dev/null
+++ b/package/tbb/0001-prevent-thumb.patch
@@ -0,0 +1,15 @@
+diff -Naur tbb-2017_U8/build/linux.gcc.inc b/build/linux.gcc.inc
+--- tbb-2017_U8/build/linux.gcc.inc 2017-09-22 15:57:33.000000000 -0400
++++ b/build/linux.gcc.inc 2017-09-25 14:46:39.584066690 -0400
+@@ -115,11 +115,6 @@
+ LIB_LINK_FLAGS += -mcpu=v9 -m64
+ endif
+
+-# automatically generate "IT" instructions when compiling for Thumb ISA
+-ifeq (armv7,$(arch))
+- CPLUS_FLAGS += -Wa,-mimplicit-it=thumb
+-endif
+-
+ #------------------------------------------------------------------------------
+ # Setting assembler data.
+ #------------------------------------------------------------------------------
diff --git a/package/tbb/0002-cross-compiler.patch b/package/tbb/0002-cross-compiler.patch
new file mode 100644
index 0000000..60a4eb3
--- /dev/null
+++ b/package/tbb/0002-cross-compiler.patch
@@ -0,0 +1,14 @@
+diff -Naur tbb-2017_U8/build/linux.gcc.inc b/build/linux.gcc.inc
+--- tbb-2017_U8/build/linux.gcc.inc 2017-09-25 14:58:24.593148831 -0400
++++ b/build/linux.gcc.inc 2017-09-25 15:08:17.032422555 -0400
+@@ -32,8 +32,8 @@
+ EXPORT_KEY = -Wl,--version-script,
+ LIBDL = -ldl
+
+-CPLUS = g++
+-CONLY = gcc
++CPLUS = arm-linux-gnueabihf-g++
++CONLY = arm-linux-gnueabihf-gcc
+ LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
+ LIBS += -lpthread -lrt
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
diff --git a/package/tbb/Config.in b/package/tbb/Config.in
new file mode 100644
index 0000000..d2c8c04
--- /dev/null
+++ b/package/tbb/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_TBB
+ bool "tbb"
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ help
+ Intel(R) Threading Building Blocks (Intel(R) TBB) lets you easily
+ write parallel C++ programs that take full advantage of multicore
+ performance, that are portable, composable and have future-proof
+ scalability.
+
+ https://www.threadingbuildingblocks.org/
+
+comment "tbb needs a toolchain w/ threads"
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/tbb/tbb.hash b/package/tbb/tbb.hash
new file mode 100644
index 0000000..7e73cb4
--- /dev/null
+++ b/package/tbb/tbb.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 c6462217d4ecef2b44fce63cfdf31f9db4f6ff493869899d497a5aef68b05fc5 tbb-2018_U1.tar.gz
+sha256 1b1357f280e750d42506212adad02f85ac07c9d3e3c0813104f9122ef350497f tbb-2017_U8.tar.gz
diff --git a/package/tbb/tbb.mk b/package/tbb/tbb.mk
new file mode 100644
index 0000000..d9ac4c8
--- /dev/null
+++ b/package/tbb/tbb.mk
@@ -0,0 +1,35 @@
+################################################################################
+#
+# tbb
+#
+################################################################################
+
+TBB_VERSION = 2017_U8
+TBB_SITE = $(call github,01org,tbb,$(TBB_VERSION))
+TBB_INSTALL_STAGING = YES
+TBB_LICENSE = Apache-2.0
+TBB_LICENSE_FILES = LICENSE
+
+define TBB_BUILD_CMDS
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) CPLUS=$(HOSTCXX) CONLY=$(HOSTCC) arch=$(BR2_ARCH) -C $(@D) tbb
+endef
+
+define TBB_INSTALL_STAGING_CMDS
+ mkdir -p $(STAGING_DIR)/usr/include/tbb
+ cp -a $(@D)/include/* $(STAGING_DIR)/usr/include/tbb
+ for f in $$(find $(@D)/build/linux_*_release -type f -iname "libtbb.so*"); do \
+ if grep -q -v INPUT $$f; then \
+ $(INSTALL) -D -m 0755 $$f $(STAGING_DIR)/usr/lib ; \
+ fi \
+ done
+endef
+
+define TBB_INSTALL_TARGET_CMDS
+ for f in $$(find $(@D)/build/linux_*_release -type f -iname "libtbb.so*"); do \
+ if grep -q -v INPUT $$f; then \
+ $(INSTALL) -D -m 0755 $$f $(TARGET_DIR)/usr/lib ; \
+ fi \
+ done
+endef
+
+$(eval $(generic-package))
--
2.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 2/2] opencv3: add support for tbb
2017-09-26 20:35 [Buildroot] [PATCH 0/2] tbb and opencv Bradford Barr
2017-09-26 20:35 ` [Buildroot] [PATCH 1/2] tbb: new package Bradford Barr
@ 2017-09-26 20:35 ` Bradford Barr
1 sibling, 0 replies; 9+ messages in thread
From: Bradford Barr @ 2017-09-26 20:35 UTC (permalink / raw)
To: buildroot
From: bradford barr <bradford@density.io>
This patchset adds support for tbb optimizations in opencv3.
Signed-off-by: bradford barr <bradford@density.io>
---
package/opencv3/Config.in | 6 ++++++
package/opencv3/opencv3.mk | 10 ++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/package/opencv3/Config.in b/package/opencv3/Config.in
index 2214ee8..07613e8 100644
--- a/package/opencv3/Config.in
+++ b/package/opencv3/Config.in
@@ -307,6 +307,12 @@ config BR2_PACKAGE_OPENCV3_WITH_PNG
help
Use shared libpng from the target system.
+config BR2_PACKAGE_OPENCV3_WITH_TBB
+ bool "tbb support"
+ select BR2_PACKAGE_TBB
+ help
+ Use build libtbb from OpenCV3.
+
config BR2_PACKAGE_OPENCV3_WITH_TIFF
bool "tiff support"
select BR2_PACKAGE_TIFF
diff --git a/package/opencv3/opencv3.mk b/package/opencv3/opencv3.mk
index 3a7c3f4..e031d7f 100644
--- a/package/opencv3/opencv3.mk
+++ b/package/opencv3/opencv3.mk
@@ -133,8 +133,7 @@ OPENCV3_CONF_OPTS += \
-DBUILD_WITH_DYNAMIC_IPP=OFF \
-DWITH_INTELPERC=OFF \
-DWITH_IPP=OFF \
- -DWITH_IPP_A=OFF \
- -DWITH_TBB=OFF
+ -DWITH_IPP_A=OFF
# Smartek stuff
OPENCV3_CONF_OPTS += -DWITH_GIGEAPI=OFF
@@ -288,6 +287,13 @@ OPENCV3_CONF_OPTS += -DWITH_QT=5
OPENCV3_DEPENDENCIES += qt5base
endif
+ifeq ($(BR2_PACKAGE_OPENCV3_WITH_TBB),y)
+OPENCV3_CONF_OPTS += -DWITH_TBB=ON
+OPENCV3_DEPENDENCIES += tbb
+else
+OPENCV3_CONF_OPTS += -DWITH_TBB=OFF
+endif
+
ifeq ($(BR2_PACKAGE_OPENCV3_WITH_TIFF),y)
OPENCV3_CONF_OPTS += -DWITH_TIFF=ON
OPENCV3_DEPENDENCIES += tiff
--
2.9.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/2] tbb: new package
2017-09-26 20:35 ` [Buildroot] [PATCH 1/2] tbb: new package Bradford Barr
@ 2017-09-26 21:31 ` Arnout Vandecappelle
2017-09-27 14:34 ` Bradford Barr
2017-09-27 15:36 ` Samuel Martin
1 sibling, 1 reply; 9+ messages in thread
From: Arnout Vandecappelle @ 2017-09-26 21:31 UTC (permalink / raw)
To: buildroot
Hi Bradford,
On 26-09-17 22:35, Bradford Barr wrote:
> From: bradford barr <bradford@density.io>
>
> Intel Threading Building Blocks (TBB), is a C++ library to help developers
> write highly parallelized applications. OpenCV uses it to accelerate some of
> it's more heavy weight procedures.
>
> Signed-off-by: bradford barr <bradford@density.io>
[snip]
> diff --git a/package/tbb/0001-prevent-thumb.patch b/package/tbb/0001-prevent-thumb.patch
Package patches need a description (basically a commit message) and another
signed-off-by. The latter is needed because both the license and the submission
path may be different for a package patch.
Ideally, you generate patches from the upstream git repository, with git
format-patch. Don't forget to add -N to format-patch to avoid getting [1/2] in
the Subject line.
> new file mode 100644
> index 0000000..942f7f4
> --- /dev/null
> +++ b/package/tbb/0001-prevent-thumb.patch
> @@ -0,0 +1,15 @@
> +diff -Naur tbb-2017_U8/build/linux.gcc.inc b/build/linux.gcc.inc
> +--- tbb-2017_U8/build/linux.gcc.inc 2017-09-22 15:57:33.000000000 -0400
> ++++ b/build/linux.gcc.inc 2017-09-25 14:46:39.584066690 -0400
> +@@ -115,11 +115,6 @@
> + LIB_LINK_FLAGS += -mcpu=v9 -m64
> + endif
> +
> +-# automatically generate "IT" instructions when compiling for Thumb ISA
> +-ifeq (armv7,$(arch))
> +- CPLUS_FLAGS += -Wa,-mimplicit-it=thumb
> +-endif
> +-
> + #------------------------------------------------------------------------------
> + # Setting assembler data.
> + #------------------------------------------------------------------------------
> diff --git a/package/tbb/0002-cross-compiler.patch b/package/tbb/0002-cross-compiler.patch
> new file mode 100644
> index 0000000..60a4eb3
> --- /dev/null
> +++ b/package/tbb/0002-cross-compiler.patch
> @@ -0,0 +1,14 @@
> +diff -Naur tbb-2017_U8/build/linux.gcc.inc b/build/linux.gcc.inc
> +--- tbb-2017_U8/build/linux.gcc.inc 2017-09-25 14:58:24.593148831 -0400
> ++++ b/build/linux.gcc.inc 2017-09-25 15:08:17.032422555 -0400
> +@@ -32,8 +32,8 @@
> + EXPORT_KEY = -Wl,--version-script,
> + LIBDL = -ldl
> +
> +-CPLUS = g++
> +-CONLY = gcc
> ++CPLUS = arm-linux-gnueabihf-g++
> ++CONLY = arm-linux-gnueabihf-gcc
That can't be right, it would only support ARM builds.
However, this patch shouldn't be needed, since you pass CPLUS and CONLY on the
command line explicitly.
> + LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
> + LIBS += -lpthread -lrt
> + LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
> diff --git a/package/tbb/Config.in b/package/tbb/Config.in
> new file mode 100644
> index 0000000..d2c8c04
> --- /dev/null
> +++ b/package/tbb/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_PACKAGE_TBB
> + bool "tbb"
> + depends on BR2_TOOLCHAIN_HAS_THREADS
> + help
> + Intel(R) Threading Building Blocks (Intel(R) TBB) lets you easily
> + write parallel C++ programs that take full advantage of multicore
> + performance, that are portable, composable and have future-proof
> + scalability.
> +
> + https://www.threadingbuildingblocks.org/
> +
> +comment "tbb needs a toolchain w/ threads"
> + depends on !BR2_TOOLCHAIN_HAS_THREADS
> diff --git a/package/tbb/tbb.hash b/package/tbb/tbb.hash
> new file mode 100644
> index 0000000..7e73cb4
> --- /dev/null
> +++ b/package/tbb/tbb.hash
> @@ -0,0 +1,3 @@
> +# Locally calculated
> +sha256 c6462217d4ecef2b44fce63cfdf31f9db4f6ff493869899d497a5aef68b05fc5 tbb-2018_U1.tar.gz
Only include the hash for the version we have.
Also, please add a hash for the LICENSE file. That allows us to detect when the
license changes (it sometimes happens...).
> +sha256 1b1357f280e750d42506212adad02f85ac07c9d3e3c0813104f9122ef350497f tbb-2017_U8.tar.gz
> diff --git a/package/tbb/tbb.mk b/package/tbb/tbb.mk
> new file mode 100644
> index 0000000..d9ac4c8
> --- /dev/null
> +++ b/package/tbb/tbb.mk
> @@ -0,0 +1,35 @@
> +################################################################################
> +#
> +# tbb
> +#
> +################################################################################
> +
> +TBB_VERSION = 2017_U8
> +TBB_SITE = $(call github,01org,tbb,$(TBB_VERSION))
> +TBB_INSTALL_STAGING = YES
> +TBB_LICENSE = Apache-2.0
> +TBB_LICENSE_FILES = LICENSE
> +
> +define TBB_BUILD_CMDS
> + $(MAKE) $(TARGET_CONFIGURE_OPTS) CPLUS=$(HOSTCXX) CONLY=$(HOSTCC) arch=$(BR2_ARCH) -C $(@D) tbb
Usually when the build system requires the target architecture to be specified,
there are limitations on which architectures are supported, or you may have to
translate BR2_ARCH to something that the build system understands. Have you used
test-pkg to explore all the different configurations we support?
> +endef
> +
> +define TBB_INSTALL_STAGING_CMDS
> + mkdir -p $(STAGING_DIR)/usr/include/tbb
> + cp -a $(@D)/include/* $(STAGING_DIR)/usr/include/tbb
> + for f in $$(find $(@D)/build/linux_*_release -type f -iname "libtbb.so*"); do \
Ideally, you would use _debug instead of _release if BR2_ENABLE_DEBUG=y, but
that's not so important.
> + if grep -q -v INPUT $$f; then \
That grep requires some explanation...
> + $(INSTALL) -D -m 0755 $$f $(STAGING_DIR)/usr/lib ; \
Aren't there symlinks to be installed?
> + fi \
> + done
You only install dynamic libraries. So either the package must depend on
!BR2_STATIC_LIBS, or you have to install static and/or dynamic libs depending on
the configuration chosen.
Regards,
Arnout
> +endef
> +
> +define TBB_INSTALL_TARGET_CMDS
> + for f in $$(find $(@D)/build/linux_*_release -type f -iname "libtbb.so*"); do \
> + if grep -q -v INPUT $$f; then \
> + $(INSTALL) -D -m 0755 $$f $(TARGET_DIR)/usr/lib ; \
> + fi \
> + done
> +endef
> +
> +$(eval $(generic-package))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/2] tbb: new package
2017-09-26 21:31 ` Arnout Vandecappelle
@ 2017-09-27 14:34 ` Bradford Barr
0 siblings, 0 replies; 9+ messages in thread
From: Bradford Barr @ 2017-09-27 14:34 UTC (permalink / raw)
To: buildroot
Bah, this is an old version of the patch. The newer one is still bad.
I'll rework and resubmit. I'll try to make sure my future patches are
cleaner.
Thanks,
B
On Tue, Sep 26, 2017 at 5:31 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
> Hi Bradford,
>
> On 26-09-17 22:35, Bradford Barr wrote:
>> From: bradford barr <bradford@density.io>
>>
>> Intel Threading Building Blocks (TBB), is a C++ library to help developers
>> write highly parallelized applications. OpenCV uses it to accelerate some of
>> it's more heavy weight procedures.
>>
>> Signed-off-by: bradford barr <bradford@density.io>
> [snip]
>> diff --git a/package/tbb/0001-prevent-thumb.patch b/package/tbb/0001-prevent-thumb.patch
>
> Package patches need a description (basically a commit message) and another
> signed-off-by. The latter is needed because both the license and the submission
> path may be different for a package patch.
>
> Ideally, you generate patches from the upstream git repository, with git
> format-patch. Don't forget to add -N to format-patch to avoid getting [1/2] in
> the Subject line.
>
>> new file mode 100644
>> index 0000000..942f7f4
>> --- /dev/null
>> +++ b/package/tbb/0001-prevent-thumb.patch
>> @@ -0,0 +1,15 @@
>> +diff -Naur tbb-2017_U8/build/linux.gcc.inc b/build/linux.gcc.inc
>> +--- tbb-2017_U8/build/linux.gcc.inc 2017-09-22 15:57:33.000000000 -0400
>> ++++ b/build/linux.gcc.inc 2017-09-25 14:46:39.584066690 -0400
>> +@@ -115,11 +115,6 @@
>> + LIB_LINK_FLAGS += -mcpu=v9 -m64
>> + endif
>> +
>> +-# automatically generate "IT" instructions when compiling for Thumb ISA
>> +-ifeq (armv7,$(arch))
>> +- CPLUS_FLAGS += -Wa,-mimplicit-it=thumb
>> +-endif
>> +-
>> + #------------------------------------------------------------------------------
>> + # Setting assembler data.
>> + #------------------------------------------------------------------------------
>> diff --git a/package/tbb/0002-cross-compiler.patch b/package/tbb/0002-cross-compiler.patch
>> new file mode 100644
>> index 0000000..60a4eb3
>> --- /dev/null
>> +++ b/package/tbb/0002-cross-compiler.patch
>> @@ -0,0 +1,14 @@
>> +diff -Naur tbb-2017_U8/build/linux.gcc.inc b/build/linux.gcc.inc
>> +--- tbb-2017_U8/build/linux.gcc.inc 2017-09-25 14:58:24.593148831 -0400
>> ++++ b/build/linux.gcc.inc 2017-09-25 15:08:17.032422555 -0400
>> +@@ -32,8 +32,8 @@
>> + EXPORT_KEY = -Wl,--version-script,
>> + LIBDL = -ldl
>> +
>> +-CPLUS = g++
>> +-CONLY = gcc
>> ++CPLUS = arm-linux-gnueabihf-g++
>> ++CONLY = arm-linux-gnueabihf-gcc
>
> That can't be right, it would only support ARM builds.
>
> However, this patch shouldn't be needed, since you pass CPLUS and CONLY on the
> command line explicitly.
>
>> + LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
>> + LIBS += -lpthread -lrt
>> + LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
>> diff --git a/package/tbb/Config.in b/package/tbb/Config.in
>> new file mode 100644
>> index 0000000..d2c8c04
>> --- /dev/null
>> +++ b/package/tbb/Config.in
>> @@ -0,0 +1,13 @@
>> +config BR2_PACKAGE_TBB
>> + bool "tbb"
>> + depends on BR2_TOOLCHAIN_HAS_THREADS
>> + help
>> + Intel(R) Threading Building Blocks (Intel(R) TBB) lets you easily
>> + write parallel C++ programs that take full advantage of multicore
>> + performance, that are portable, composable and have future-proof
>> + scalability.
>> +
>> + https://www.threadingbuildingblocks.org/
>> +
>> +comment "tbb needs a toolchain w/ threads"
>> + depends on !BR2_TOOLCHAIN_HAS_THREADS
>> diff --git a/package/tbb/tbb.hash b/package/tbb/tbb.hash
>> new file mode 100644
>> index 0000000..7e73cb4
>> --- /dev/null
>> +++ b/package/tbb/tbb.hash
>> @@ -0,0 +1,3 @@
>> +# Locally calculated
>> +sha256 c6462217d4ecef2b44fce63cfdf31f9db4f6ff493869899d497a5aef68b05fc5 tbb-2018_U1.tar.gz
>
> Only include the hash for the version we have.
>
> Also, please add a hash for the LICENSE file. That allows us to detect when the
> license changes (it sometimes happens...).
>
>
>
>> +sha256 1b1357f280e750d42506212adad02f85ac07c9d3e3c0813104f9122ef350497f tbb-2017_U8.tar.gz
>> diff --git a/package/tbb/tbb.mk b/package/tbb/tbb.mk
>> new file mode 100644
>> index 0000000..d9ac4c8
>> --- /dev/null
>> +++ b/package/tbb/tbb.mk
>> @@ -0,0 +1,35 @@
>> +################################################################################
>> +#
>> +# tbb
>> +#
>> +################################################################################
>> +
>> +TBB_VERSION = 2017_U8
>> +TBB_SITE = $(call github,01org,tbb,$(TBB_VERSION))
>> +TBB_INSTALL_STAGING = YES
>> +TBB_LICENSE = Apache-2.0
>> +TBB_LICENSE_FILES = LICENSE
>> +
>> +define TBB_BUILD_CMDS
>> + $(MAKE) $(TARGET_CONFIGURE_OPTS) CPLUS=$(HOSTCXX) CONLY=$(HOSTCC) arch=$(BR2_ARCH) -C $(@D) tbb
>
> Usually when the build system requires the target architecture to be specified,
> there are limitations on which architectures are supported, or you may have to
> translate BR2_ARCH to something that the build system understands. Have you used
> test-pkg to explore all the different configurations we support?
>
>> +endef
>> +
>> +define TBB_INSTALL_STAGING_CMDS
>> + mkdir -p $(STAGING_DIR)/usr/include/tbb
>> + cp -a $(@D)/include/* $(STAGING_DIR)/usr/include/tbb
>> + for f in $$(find $(@D)/build/linux_*_release -type f -iname "libtbb.so*"); do \
>
> Ideally, you would use _debug instead of _release if BR2_ENABLE_DEBUG=y, but
> that's not so important.
>
>> + if grep -q -v INPUT $$f; then \
>
> That grep requires some explanation...
>
>> + $(INSTALL) -D -m 0755 $$f $(STAGING_DIR)/usr/lib ; \
>
> Aren't there symlinks to be installed?
>
>> + fi \
>> + done
>
> You only install dynamic libraries. So either the package must depend on
> !BR2_STATIC_LIBS, or you have to install static and/or dynamic libs depending on
> the configuration chosen.
>
> Regards,
> Arnout
>
>> +endef
>> +
>> +define TBB_INSTALL_TARGET_CMDS
>> + for f in $$(find $(@D)/build/linux_*_release -type f -iname "libtbb.so*"); do \
>> + if grep -q -v INPUT $$f; then \
>> + $(INSTALL) -D -m 0755 $$f $(TARGET_DIR)/usr/lib ; \
>> + fi \
>> + done
>> +endef
>> +
>> +$(eval $(generic-package))
>>
>
> --
> Arnout Vandecappelle arnout at mind be
> Senior Embedded Software Architect +32-16-286500
> Essensium/Mind http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/2] tbb: new package
2017-09-26 20:35 ` [Buildroot] [PATCH 1/2] tbb: new package Bradford Barr
2017-09-26 21:31 ` Arnout Vandecappelle
@ 2017-09-27 15:36 ` Samuel Martin
2017-09-27 15:49 ` Bradford Barr
1 sibling, 1 reply; 9+ messages in thread
From: Samuel Martin @ 2017-09-27 15:36 UTC (permalink / raw)
To: buildroot
Hi,
On Tue, Sep 26, 2017 at 10:35 PM, Bradford Barr <bradford@density.io> wrote:
> From: bradford barr <bradford@density.io>
>
> Intel Threading Building Blocks (TBB), is a C++ library to help developers
> write highly parallelized applications. OpenCV uses it to accelerate some of
> it's more heavy weight procedures.
>
> Signed-off-by: bradford barr <bradford@density.io>
[...]
> --- /dev/null
> +++ b/package/tbb/Config.in
> @@ -0,0 +1,13 @@
> +config BR2_PACKAGE_TBB
> + bool "tbb"
> + depends on BR2_TOOLCHAIN_HAS_THREADS
> + help
> + Intel(R) Threading Building Blocks (Intel(R) TBB) lets you easily
> + write parallel C++ programs that take full advantage of multicore
> + performance, that are portable, composable and have future-proof
> + scalability.
> +
> + https://www.threadingbuildingblocks.org/
> +
> +comment "tbb needs a toolchain w/ threads"
> + depends on !BR2_TOOLCHAIN_HAS_THREADS
I wonder whether TBB is available for all architecture supported by BR.
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/2] tbb: new package
2017-09-27 15:36 ` Samuel Martin
@ 2017-09-27 15:49 ` Bradford Barr
2017-09-27 16:35 ` Bernd Kuhls
0 siblings, 1 reply; 9+ messages in thread
From: Bradford Barr @ 2017-09-27 15:49 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, Sep 27, 2017 at 11:36 AM, Samuel Martin <s.martin49@gmail.com> wrote:
> Hi,
>
> On Tue, Sep 26, 2017 at 10:35 PM, Bradford Barr <bradford@density.io> wrote:
>> From: bradford barr <bradford@density.io>
>>
>> Intel Threading Building Blocks (TBB), is a C++ library to help developers
>> write highly parallelized applications. OpenCV uses it to accelerate some of
>> it's more heavy weight procedures.
>>
>> Signed-off-by: bradford barr <bradford@density.io>
> [...]
>> --- /dev/null
>> +++ b/package/tbb/Config.in
>> @@ -0,0 +1,13 @@
>> +config BR2_PACKAGE_TBB
>> + bool "tbb"
>> + depends on BR2_TOOLCHAIN_HAS_THREADS
>> + help
>> + Intel(R) Threading Building Blocks (Intel(R) TBB) lets you easily
>> + write parallel C++ programs that take full advantage of multicore
>> + performance, that are portable, composable and have future-proof
>> + scalability.
>> +
>> + https://www.threadingbuildingblocks.org/
>> +
>> +comment "tbb needs a toolchain w/ threads"
>> + depends on !BR2_TOOLCHAIN_HAS_THREADS
>
> I wonder whether TBB is available for all architecture supported by BR.
I've only seen TBB used with ARMv{7,8}, x86 and x86-64. Maybe it would
compile for other architectures? I'm thinking that I might just
require x86/64 or ARM because those are the machines I can test with.
I guess I could try to compile TBB for every platform supported by
buildroot? Is there an easy way to do that?
>
> Regards,
>
> --
> Samuel
B
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/2] tbb: new package
2017-09-27 15:49 ` Bradford Barr
@ 2017-09-27 16:35 ` Bernd Kuhls
2017-09-27 17:15 ` Bradford Barr
0 siblings, 1 reply; 9+ messages in thread
From: Bernd Kuhls @ 2017-09-27 16:35 UTC (permalink / raw)
To: buildroot
Am Wed, 27 Sep 2017 11:49:46 -0400 schrieb Bradford Barr:
> I guess I could try to compile TBB for every platform supported by
> buildroot? Is there an easy way to do that?
Hi,
yes:
$ echo "BR2_PACKAGE_TBB=y" > test-tbb
$ utils/test-pkg -c test-tbb -d $HOME/buildroot/test-tbb
Doing so you will see that your package also
depends on BR2_INSTALL_LIBSTDCPP
because it contains c++ code.
Regards, Bernd
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] [PATCH 1/2] tbb: new package
2017-09-27 16:35 ` Bernd Kuhls
@ 2017-09-27 17:15 ` Bradford Barr
0 siblings, 0 replies; 9+ messages in thread
From: Bradford Barr @ 2017-09-27 17:15 UTC (permalink / raw)
To: buildroot
Oh awesome! I wasn't aware of that, but I see it's here[1] in the
Buildroot manual. I'll use that before I submit a v2.
[1]:https://buildroot.org/downloads/manual/manual.html#_tips_and_tricks
Thanks!
B
On Wed, Sep 27, 2017 at 12:35 PM, Bernd Kuhls <bernd.kuhls@t-online.de> wrote:
> Am Wed, 27 Sep 2017 11:49:46 -0400 schrieb Bradford Barr:
>
>> I guess I could try to compile TBB for every platform supported by
>> buildroot? Is there an easy way to do that?
>
> Hi,
>
> yes:
>
> $ echo "BR2_PACKAGE_TBB=y" > test-tbb
> $ utils/test-pkg -c test-tbb -d $HOME/buildroot/test-tbb
>
> Doing so you will see that your package also
>
> depends on BR2_INSTALL_LIBSTDCPP
>
> because it contains c++ code.
>
> Regards, Bernd
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-09-27 17:15 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-26 20:35 [Buildroot] [PATCH 0/2] tbb and opencv Bradford Barr
2017-09-26 20:35 ` [Buildroot] [PATCH 1/2] tbb: new package Bradford Barr
2017-09-26 21:31 ` Arnout Vandecappelle
2017-09-27 14:34 ` Bradford Barr
2017-09-27 15:36 ` Samuel Martin
2017-09-27 15:49 ` Bradford Barr
2017-09-27 16:35 ` Bernd Kuhls
2017-09-27 17:15 ` Bradford Barr
2017-09-26 20:35 ` [Buildroot] [PATCH 2/2] opencv3: add support for tbb Bradford Barr
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.