package/opencv3: use BR2_TOOLCHAIN_HAS_LIBATOMIC
PATCH 1/1 package/opencv3: use BR2_TOOLCHAIN_HAS_LIBATOMIC
It uses __atomic_fetch_add_4 so libatomic must be pulled in if necessary. Fixes
http://autobuild.buildroot.net/results/652/6521223b426c3cb4dfefab27bc6021900db6910e/
--- package/opencv3/Config.in | 2 ++ package/opencv3/opencv3.mk | 5 +++++ 2 files changed, 7 insertions(+)
package/opencv3/Config.in +2 -0
@@ -1,6 +1,7 @@ menuconfig BR2_PACKAGE_OPENCV3 bool "opencv3" select BR2_PACKAGE_ZLIB + depends on BR2_TOOLCHAIN_HAS_ATOMIC depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_WCHAR
@@ -335,6 +336,7 @@ config BR2_PACKAGE_OPENCV3_INSTALL_DATA endif # BR2_PACKAGE_OPENCV3 comment "opencv3 needs a toolchain w/ C++, NPTL, wchar, dynamic library" + depends on BR2_TOOLCHAIN_HAS_ATOMIC depends on !BR2_INSTALL_LIBSTDCPP || \ !BR2_USE_WCHAR || \ !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
package/opencv3/opencv3.mk +5 -0
@@ -10,6 +10,11 @@ OPENCV3_INSTALL_STAGING = YES OPENCV3_LICENSE = BSD-3c OPENCV3_LICENSE_FILES = LICENSE +# Uses __atomic_fetch_add_4 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +OPENCV3_CONF_OPTS += -DCMAKE_CXX_FLAGS="-latomic" +endif + # OpenCV component options OPENCV3_CONF_OPTS += \ -DBUILD_DOCS=OFF \
Signature · 1 line
2.9.3
PATCH 1/1 package/opencv3: use BR2_TOOLCHAIN_HAS_LIBATOMIC
Hi Bernd, all,
Quoted 35 lines · Bernd Kuhls
It uses
__atomic_fetch_add_4so libatomic must be pulled in if necessary. Fixes
http://autobuild.buildroot.net/results/652/6521223b426c3cb4dfefab27bc6021900db6910e/Signed-off-by Bernd Kuhls <[email protected]>--- package/opencv3/Config.in | 2 ++ package/opencv3/opencv3.mk | 5 +++++ 2 files changed, 7 insertions(+)package/opencv3/Config.in +2
-0@@ -1,6 +1,7 @@ menuconfig BR2_PACKAGE_OPENCV3 bool "opencv3" select BR2_PACKAGE_ZLIB + depends on BR2_TOOLCHAIN_HAS_ATOMIC depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL depends on BR2_INSTALL_LIBSTDCPP depends on BR2_USE_WCHAR@@ -335,6 +336,7 @@ config BR2_PACKAGE_OPENCV3_INSTALL_DATA endif # BR2_PACKAGE_OPENCV3 comment "opencv3 needs a toolchain w/ C++, NPTL, wchar, dynamic library" + depends on BR2_TOOLCHAIN_HAS_ATOMIC depends on !BR2_INSTALL_LIBSTDCPP || \ !BR2_USE_WCHAR || \ !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \package/opencv3/opencv3.mk +0
-0
package/opencv3/opencv3.mk OPENCV3_INSTALL_STAGING = YES · line 16
Quoted 7 lines
package/opencv3/opencv3.mk +4
-0@@ -10,6 +10,11 @@ OPENCV3_INSTALL_STAGING = YES OPENCV3_LICENSE = BSD-3c OPENCV3_LICENSE_FILES = LICENSE +# Uses __atomic_fetch_add_4 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +OPENCV3_CONF_OPTS += -DCMAKE_CXX_FLAGS="-latomic" +endif
Since you add the dependency on BR2_TOOLCHAIN_HAS_ATOMIC in the Config.in, I wonder whether nested conf. opts. update in a if-block that will always be true is really necessary...
Quoted 11 lines
package/opencv3/opencv3.mk +1
-1+ # OpenCV component options OPENCV3_CONF_OPTS += \ -DBUILD_DOCS=OFF \ --2.9.3
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Regards,
Signature · 1 line
Samuel
PATCH 1/1 package/opencv3: use BR2_TOOLCHAIN_HAS_LIBATOMIC
Hello,
Quoted 8 lines · Samuel Martin
package/opencv3/opencv3.mk OPENCV3_INSTALL_STAGING = YES · line 16
Quoted 4 lines
package/opencv3/opencv3.mk +4
-0+# Uses __atomic_fetch_add_4 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +OPENCV3_CONF_OPTS += -DCMAKE_CXX_FLAGS="-latomic" +endifSince you add the dependency on
BR2_TOOLCHAIN_HAS_ATOMICin the Config.in, I wonder whether nested conf. opts. update in a if-block that will always be true is really necessary...
You're confusing BR2_TOOLCHAIN_HAS_ATOMIC with BR2_TOOLCHAIN_HAS_LIBATOMIC. There's a subtle difference :)
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/1 package/opencv3: use BR2_TOOLCHAIN_HAS_LIBATOMIC
Quoted 13 lines · Thomas Petazzoni
Hello,
Quoted 8 lines · Samuel Martin
package/opencv3/opencv3.mk OPENCV3_INSTALL_STAGING = YES · line 16
Quoted 4 lines
package/opencv3/opencv3.mk +4
-0+# Uses __atomic_fetch_add_4 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +OPENCV3_CONF_OPTS += -DCMAKE_CXX_FLAGS="-latomic" +endifSince you add the dependency on
BR2_TOOLCHAIN_HAS_ATOMICin the Config.in, I wonder whether nested conf. opts. update in a if-block that will always be true is really necessary...
Quoted 3 lines
You're confusing
BR2_TOOLCHAIN_HAS_ATOMICwithBR2_TOOLCHAIN_HAS_LIBATOMIC. There's a subtle difference :)
gah! Right :-/
Quoted 5 lines
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Signature · 1 line
Samuel
PATCH 1/1 package/opencv3: use BR2_TOOLCHAIN_HAS_LIBATOMIC
In reply to Bernd KuhlsHello,
package/opencv3/opencv3.mk OPENCV3_INSTALL_STAGING = YES · line 16
Quoted 4 lines · Bernd Kuhls
package/opencv3/opencv3.mk +4
-0+# Uses __atomic_fetch_add_4 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +OPENCV3_CONF_OPTS += -DCMAKE_CXX_FLAGS="-latomic" +endif
Isn't this overriding the flags already passed? Shouldn't it be:
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -latomic"or something like that?
Samuel?
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 1/1 package/opencv3: use BR2_TOOLCHAIN_HAS_LIBATOMIC
Quoted 11 lines · Thomas Petazzoni
Hello,
package/opencv3/opencv3.mk OPENCV3_INSTALL_STAGING = YES · line 16
Quoted 4 lines · Bernd Kuhls
package/opencv3/opencv3.mk +4
-0+# Uses __atomic_fetch_add_4 +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) +OPENCV3_CONF_OPTS += -DCMAKE_CXX_FLAGS="-latomic" +endifIsn't this overriding the flags already passed? Shouldn't it be:
Quoted 3 lines
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -latomic"or something like that?
Nope, this is correct because, by default, CMAKE_CXX_FLAGS is not set by Buildroot (except for
host-package), and for the target ones, the toolchainfile.cmake allows defining package specificCMAKE_CXX_FLAGS (see [1]).
Besides, doing:
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -latomic"
may allow take into account the CMAKE_CXX_FLAGS variable set in the Buildroot environment; I'm
not sure we want this...
So, the original code from Bernd should behave as expected.
[1] https://github.com/buildroot/buildroot/blob/master/support/misc/toolchainfile.cmake.in#L17
Regards,
Signature · 1 line
Samuel
Thomas Petazzoni
AppliedPATCH 1/1 package/opencv3: use BR2_TOOLCHAIN_HAS_LIBATOMIC
In reply to Bernd KuhlsHello,
Quoted 9 lines · Bernd Kuhls
It uses
__atomic_fetch_add_4so libatomic must be pulled in if necessary. Fixes
http://autobuild.buildroot.net/results/652/6521223b426c3cb4dfefab27bc6021900db6910e/Signed-off-by Bernd Kuhls <[email protected]>--- package/opencv3/Config.in | 2 ++ package/opencv3/opencv3.mk | 5 +++++ 2 files changed, 7 insertions(+)
Applied to master, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com