Skip to contentSkip to conversation

tbb and opencv

PATCH Superseded Bradford Barr 4 participants 9 messages Sep 26, 2017 – Sep 27, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover tbb and opencv

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

#1 lore raw

PATCH 1/2 tbb: new package

From: bradford barr <[email protected]>

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.

---
 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
package/Config.in +1 -0
index 6acd0c4..f71e781 100644
@@ -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"
package/tbb/0001-prevent-thumb.patch new file +15 -0
new file mode 100644
index 0000000..942f7f4
@@ -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.
+ #------------------------------------------------------------------------------
package/tbb/0002-cross-compiler.patch new file +14 -0
new file mode 100644
index 0000000..60a4eb3
@@ -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
package/tbb/Config.in new file +13 -0
new file mode 100644
index 0000000..d2c8c04
@@ -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
package/tbb/tbb.hash new file +3 -0
new file mode 100644
index 0000000..7e73cb4
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  c6462217d4ecef2b44fce63cfdf31f9db4f6ff493869899d497a5aef68b05fc5  tbb-2018_U1.tar.gz
+sha256  1b1357f280e750d42506212adad02f85ac07c9d3e3c0813104f9122ef350497f  tbb-2017_U8.tar.gz
package/tbb/tbb.mk new file +35 -0
new file mode 100644
index 0000000..d9ac4c8
@@ -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))
Signature · 1 line
2.9.3
#2 lore raw

PATCH 1/2 tbb: new package

Hi Bradford,

Quoted 7 lines · Bradford Barr

From: bradford barr <[email protected]>

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.

[snip]

package/tbb/0001-prevent-thumb.patch

Quoted 1 line
package/tbb/0001-prevent-thumb.patch +0 -0

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.

Quoted 27 lines

new file mode 100644
index 0000000..942f7f4

package/tbb/0001-prevent-thumb.patch new file +15 -0
@@ -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.
+ #------------------------------------------------------------------------------
package/tbb/0002-cross-compiler.patch new file +1 -0
new file mode 100644
index 0000000..60a4eb3
@@ -0,0 +1,14 @@
+diff -Naur tbb-2017_U8/build/linux.gcc.inc b/build/linux.gcc.inc

package/tbb/0002-cross-compiler.patch line 11

Quoted 10 lines
package/tbb/0002-cross-compiler.patch new file +10 -0
+--- 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.

Quoted 28 lines
package/tbb/0002-cross-compiler.patch new file +3 -0
+ LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
+ LIBS += -lpthread -lrt
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
package/tbb/Config.in new file +13 -0
new file mode 100644
index 0000000..d2c8c04
@@ -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
package/tbb/tbb.hash new file +0 -0
new file mode 100644
index 0000000..7e73cb4

package/tbb/tbb.hash line 2

Quoted 2 lines
package/tbb/tbb.hash new file +2 -0
@@ -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...).

Quoted 11 lines
package/tbb/tbb.hash new file +1 -0
+sha256  1b1357f280e750d42506212adad02f85ac07c9d3e3c0813104f9122ef350497f  tbb-2017_U8.tar.gz
package/tbb/tbb.mk new file +4 -0
new file mode 100644
index 0000000..d9ac4c8
@@ -0,0 +1,35 @@
+################################################################################
+#
+# tbb
+#

package/tbb/tbb.mk line 14

Quoted 10 lines
package/tbb/tbb.mk new file +10 -0
+################################################################################
+
+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?

package/tbb/tbb.mk line 20

Quoted 6 lines
package/tbb/tbb.mk new file +6 -0
+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.

package/tbb/tbb.mk line 21

Quoted 1 line
package/tbb/tbb.mk new file +1 -0
+		if grep -q -v INPUT $$f; then \

That grep requires some explanation...

package/tbb/tbb.mk line 22

Quoted 1 line
package/tbb/tbb.mk new file +1 -0
+			$(INSTALL) -D -m 0755 $$f $(STAGING_DIR)/usr/lib ; \

Aren't there symlinks to be installed?

package/tbb/tbb.mk line 24

Quoted 2 lines
package/tbb/tbb.mk new file +2 -0
+		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

Quoted 12 lines
package/tbb/tbb.mk new file +11 -0
+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))
Signature · 6 lines
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
#3 lore raw

PATCH 1/2 tbb: new package

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

Quoted 177 lines · Arnout Vandecappelle

Hi Bradford,

Quoted 7 lines · Bradford Barr

From: bradford barr <[email protected]>

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.

[snip]

package/tbb/0001-prevent-thumb.patch

Quoted 1 line
package/tbb/0001-prevent-thumb.patch +0 -0

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.

Quoted 27 lines

new file mode 100644
index 0000000..942f7f4

package/tbb/0001-prevent-thumb.patch new file +15 -0
@@ -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.
+ #------------------------------------------------------------------------------
package/tbb/0002-cross-compiler.patch new file +1 -0
new file mode 100644
index 0000000..60a4eb3
@@ -0,0 +1,14 @@
+diff -Naur tbb-2017_U8/build/linux.gcc.inc b/build/linux.gcc.inc

package/tbb/0002-cross-compiler.patch line 11

Quoted 10 lines
package/tbb/0002-cross-compiler.patch new file +10 -0
+--- 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.

Quoted 28 lines
package/tbb/0002-cross-compiler.patch new file +3 -0
+ LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
+ LIBS += -lpthread -lrt
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
package/tbb/Config.in new file +13 -0
new file mode 100644
index 0000000..d2c8c04
@@ -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
package/tbb/tbb.hash new file +0 -0
new file mode 100644
index 0000000..7e73cb4

package/tbb/tbb.hash line 2

Quoted 2 lines
package/tbb/tbb.hash new file +2 -0
@@ -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...).

Quoted 11 lines
package/tbb/tbb.hash new file +1 -0
+sha256  1b1357f280e750d42506212adad02f85ac07c9d3e3c0813104f9122ef350497f  tbb-2017_U8.tar.gz
package/tbb/tbb.mk new file +4 -0
new file mode 100644
index 0000000..d9ac4c8
@@ -0,0 +1,35 @@
+################################################################################
+#
+# tbb
+#

package/tbb/tbb.mk line 14

Quoted 10 lines
package/tbb/tbb.mk new file +10 -0
+################################################################################
+
+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?

package/tbb/tbb.mk line 20

Quoted 6 lines
package/tbb/tbb.mk new file +6 -0
+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.

package/tbb/tbb.mk line 21

Quoted 1 line
package/tbb/tbb.mk new file +1 -0
+             if grep -q -v INPUT $$f; then \

That grep requires some explanation...

package/tbb/tbb.mk line 22

Quoted 1 line
package/tbb/tbb.mk new file +1 -0
+                     $(INSTALL) -D -m 0755 $$f $(STAGING_DIR)/usr/lib ; \

Aren't there symlinks to be installed?

package/tbb/tbb.mk line 24

Quoted 2 lines
package/tbb/tbb.mk new file +2 -0
+             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

package/tbb/tbb.mk line 35

Quoted 12 lines
package/tbb/tbb.mk new file +11 -0
+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
#4 lore raw

PATCH 1/2 tbb: new package

In reply to Bradford Barr

Hi,

Quoted 7 lines · Bradford Barr

From: bradford barr <[email protected]>

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.

[...]

Quoted 6 lines
package/tbb/Config.in new file +3 -0
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_TBB
+       bool "tbb"
+       depends on BR2_TOOLCHAIN_HAS_THREADS

package/tbb/Config.in line 13

Quoted 10 lines
package/tbb/Config.in new file +10 -0
+       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,

Signature · 1 line
Samuel
#5 lore raw

PATCH 1/2 tbb: new package

Hello,

Quoted 21 lines · Samuel Martin

Hi,

Quoted 7 lines · Bradford Barr

From: bradford barr <[email protected]>

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.

[...]

Quoted 10 lines
package/tbb/Config.in new file +7 -0
@@ -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
Quoted 8 lines

package/tbb/Config.in line 13

Quoted 6 lines
package/tbb/Config.in new file +6 -0
+         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?

Quoted 5 lines

Regards,

--
Samuel

B

#6 lore raw

PATCH 1/2 tbb: new package

Am Wed, 27 Sep 2017 11:49:46 -0400 schrieb Bradford Barr:

Quoted 2 lines

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

#7 lore raw

PATCH 1/2 tbb: new package

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

Quoted 24 lines · Bernd Kuhls

Am Wed, 27 Sep 2017 11:49:46 -0400 schrieb Bradford Barr:

Quoted 2 lines

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

#8 lore raw

PATCH 2/2 opencv3: add support for tbb

In reply to Bradford Barr

From: bradford barr <[email protected]>

This patchset adds support for tbb optimizations in opencv3.

---
 package/opencv3/Config.in  |  6 ++++++
 package/opencv3/opencv3.mk | 10 ++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)
package/opencv3/Config.in +6 -0
index 2214ee8..07613e8 100644
@@ -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
package/opencv3/opencv3.mk +8 -2
index 3a7c3f4..e031d7f 100644
@@ -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
Signature · 1 line
2.9.3