Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] Fix Opencv4 bug found by a user in Mailing list
@ 2022-08-07 22:25 Giulio Benetti
  2022-08-07 22:25 ` [Buildroot] [PATCH 1/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf Giulio Benetti
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Giulio Benetti @ 2022-08-07 22:25 UTC (permalink / raw)
  To: buildroot; +Cc: Stefano Cottafavi, Giulio Benetti, Fabrice Fontaine

These patches fixes a bug Stefano Cottafavi found and asked help for in
Mailing List:
https://lists.buildroot.org/pipermail/buildroot/2022-August/648616.html

It turns out that opencv4 library objdetect requires library dnn and that
also dnn library requires protobuf. So this patchset select both options
accordingly.

@Stefano, if you can, please give a try to these 2 patches without
enabling the 2 options I've pointed you in Mailing List by hand and report
the result.

Thank you!

Giulio Benetti (2):
  package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf
  package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires
    BR2_PACKAGE_OPENCV4_LIB_DNN

 package/opencv4/Config.in | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 1/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf
  2022-08-07 22:25 [Buildroot] [PATCH 0/2] Fix Opencv4 bug found by a user in Mailing list Giulio Benetti
@ 2022-08-07 22:25 ` Giulio Benetti
  2022-08-15 12:35   ` Thomas Petazzoni via buildroot
  2022-09-16 12:22   ` Peter Korsgaard
  2022-08-07 22:25 ` [Buildroot] [PATCH 2/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires BR2_PACKAGE_OPENCV4_LIB_DNN Giulio Benetti
       [not found] ` <CAPn86JAWEZNtkMjdD-fMAyiiW1-vfmzM=79qV7wgmiy7XHbJ-A@mail.gmail.com>
  2 siblings, 2 replies; 9+ messages in thread
From: Giulio Benetti @ 2022-08-07 22:25 UTC (permalink / raw)
  To: buildroot; +Cc: Stefano Cottafavi, Giulio Benetti, Fabrice Fontaine

Opencv4 requires protobuf library otherwise it disables DNN:
```
if(NOT HAVE_PROTOBUF)
  ocv_module_disable(opencv_dnn)
endif()
```
https://github.com/opencv/opencv/blob/4.x/modules/dnn/CMakeLists.txt#L5-L7
So let's "select BR2_PACKAGE_OPENCV4_WITH_PROTOBUF" if
BR2_PACKAGE_OPENCV4_LIB_DNN is enabled.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/opencv4/Config.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/opencv4/Config.in b/package/opencv4/Config.in
index a61a106952..bdeddcc089 100644
--- a/package/opencv4/Config.in
+++ b/package/opencv4/Config.in
@@ -34,6 +34,7 @@ config BR2_PACKAGE_OPENCV4_LIB_DNN
 	bool "dnn"
 	# dnn needs fenv.h which is not provided by uclibc
 	depends on !BR2_TOOLCHAIN_USES_UCLIBC
+	select BR2_PACKAGE_OPENCV4_WITH_PROTOBUF
 	help
 	  Include opencv_dnn (Deep Neural Networks) module into the
 	  OpenCV build.
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [Buildroot] [PATCH 2/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires BR2_PACKAGE_OPENCV4_LIB_DNN
  2022-08-07 22:25 [Buildroot] [PATCH 0/2] Fix Opencv4 bug found by a user in Mailing list Giulio Benetti
  2022-08-07 22:25 ` [Buildroot] [PATCH 1/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf Giulio Benetti
@ 2022-08-07 22:25 ` Giulio Benetti
  2022-08-15 12:35   ` Thomas Petazzoni via buildroot
  2022-09-16 12:22   ` Peter Korsgaard
       [not found] ` <CAPn86JAWEZNtkMjdD-fMAyiiW1-vfmzM=79qV7wgmiy7XHbJ-A@mail.gmail.com>
  2 siblings, 2 replies; 9+ messages in thread
From: Giulio Benetti @ 2022-08-07 22:25 UTC (permalink / raw)
  To: buildroot; +Cc: Stefano Cottafavi, Giulio Benetti, Fabrice Fontaine

Opencv4 library objdetect needs library dnn, otherwise it throws:
```
-- Module opencv_objdetect disabled because opencv_dnn dependency can't be resolved!
```
So let's "select BR2_PACKAGE_OPENCV4_LIB_DNN" if
BR2_PACKAGE_OPENCV4_LIB_OBJDETECT is enabled.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/opencv4/Config.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/opencv4/Config.in b/package/opencv4/Config.in
index bdeddcc089..4991b4252b 100644
--- a/package/opencv4/Config.in
+++ b/package/opencv4/Config.in
@@ -155,6 +155,7 @@ config BR2_PACKAGE_OPENCV4_LIB_OBJDETECT
 	select BR2_PACKAGE_OPENCV4_LIB_CALIB3D
 	select BR2_PACKAGE_OPENCV4_LIB_IMGPROC
 	select BR2_PACKAGE_OPENCV4_LIB_ML
+	select BR2_PACKAGE_OPENCV4_LIB_DNN
 	help
 	  Include opencv_objdetect (object detection) module into the
 	  OpenCV build.
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 0/2] Fix Opencv4 bug found by a user in Mailing list
       [not found] ` <CAPn86JAWEZNtkMjdD-fMAyiiW1-vfmzM=79qV7wgmiy7XHbJ-A@mail.gmail.com>
@ 2022-08-13 14:15   ` Giulio Benetti
  0 siblings, 0 replies; 9+ messages in thread
From: Giulio Benetti @ 2022-08-13 14:15 UTC (permalink / raw)
  To: Stefano Cottafavi; +Cc: buildroot

Hi Stefano,

I add ML in Cc,

On 13/08/22 16:06, Stefano Cottafavi wrote:
> Hi Giulio,
> sorry for the late reply but have been distracted by more pressing issues.

No problem

> Today I manually applied the patches and they worked like a charm.
> In the menuconfig dependencies are selected automatically as expected
> and the modules are built fine and exported to the sdk.

Thank you for testing.

> Thanks a lot for the support.

You're welcome :-)

> ciao

Ciao

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

> Stefano
> 
> 
> On Mon, Aug 8, 2022 at 12:25 AM Giulio Benetti 
> <giulio.benetti@benettiengineering.com 
> <mailto:giulio.benetti@benettiengineering.com>> wrote:
> 
>     These patches fixes a bug Stefano Cottafavi found and asked help for in
>     Mailing List:
>     https://lists.buildroot.org/pipermail/buildroot/2022-August/648616.html <https://lists.buildroot.org/pipermail/buildroot/2022-August/648616.html>
> 
>     It turns out that opencv4 library objdetect requires library dnn and
>     that
>     also dnn library requires protobuf. So this patchset select both options
>     accordingly.
> 
>     @Stefano, if you can, please give a try to these 2 patches without
>     enabling the 2 options I've pointed you in Mailing List by hand and
>     report
>     the result.
> 
>     Thank you!
> 
>     Giulio Benetti (2):
>        package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf
>        package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires
>          BR2_PACKAGE_OPENCV4_LIB_DNN
> 
>       package/opencv4/Config.in | 2 ++
>       1 file changed, 2 insertions(+)
> 
>     -- 
>     2.34.1
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf
  2022-08-07 22:25 ` [Buildroot] [PATCH 1/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf Giulio Benetti
@ 2022-08-15 12:35   ` Thomas Petazzoni via buildroot
  2022-09-16 12:22   ` Peter Korsgaard
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-15 12:35 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Stefano Cottafavi, Fabrice Fontaine, buildroot

On Mon,  8 Aug 2022 00:25:28 +0200
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> Opencv4 requires protobuf library otherwise it disables DNN:
> ```
> if(NOT HAVE_PROTOBUF)
>   ocv_module_disable(opencv_dnn)
> endif()
> ```
> https://github.com/opencv/opencv/blob/4.x/modules/dnn/CMakeLists.txt#L5-L7
> So let's "select BR2_PACKAGE_OPENCV4_WITH_PROTOBUF" if
> BR2_PACKAGE_OPENCV4_LIB_DNN is enabled.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  package/opencv4/Config.in | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/opencv4/Config.in b/package/opencv4/Config.in
> index a61a106952..bdeddcc089 100644
> --- a/package/opencv4/Config.in
> +++ b/package/opencv4/Config.in
> @@ -34,6 +34,7 @@ config BR2_PACKAGE_OPENCV4_LIB_DNN
>  	bool "dnn"
>  	# dnn needs fenv.h which is not provided by uclibc
>  	depends on !BR2_TOOLCHAIN_USES_UCLIBC
> +	select BR2_PACKAGE_OPENCV4_WITH_PROTOBUF

This was missing the propagation of the "depends on" of
BR2_PACKAGE_OPENCV4_WITH_PROTOBUF, which also affected the Config.in
comment.

The final patch is at:

  https://git.buildroot.org/buildroot/commit/?id=b0d3c25cc8017e92dbdedf1a1dde6f4dc4408332

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires BR2_PACKAGE_OPENCV4_LIB_DNN
  2022-08-07 22:25 ` [Buildroot] [PATCH 2/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires BR2_PACKAGE_OPENCV4_LIB_DNN Giulio Benetti
@ 2022-08-15 12:35   ` Thomas Petazzoni via buildroot
  2022-08-15 12:45     ` Giulio Benetti
  2022-09-16 12:22   ` Peter Korsgaard
  1 sibling, 1 reply; 9+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-08-15 12:35 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Stefano Cottafavi, Fabrice Fontaine, buildroot

On Mon,  8 Aug 2022 00:25:29 +0200
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> Opencv4 library objdetect needs library dnn, otherwise it throws:
> ```
> -- Module opencv_objdetect disabled because opencv_dnn dependency can't be resolved!
> ```
> So let's "select BR2_PACKAGE_OPENCV4_LIB_DNN" if
> BR2_PACKAGE_OPENCV4_LIB_OBJDETECT is enabled.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  package/opencv4/Config.in | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/opencv4/Config.in b/package/opencv4/Config.in
> index bdeddcc089..4991b4252b 100644
> --- a/package/opencv4/Config.in
> +++ b/package/opencv4/Config.in
> @@ -155,6 +155,7 @@ config BR2_PACKAGE_OPENCV4_LIB_OBJDETECT
>  	select BR2_PACKAGE_OPENCV4_LIB_CALIB3D
>  	select BR2_PACKAGE_OPENCV4_LIB_IMGPROC
>  	select BR2_PACKAGE_OPENCV4_LIB_ML
> +	select BR2_PACKAGE_OPENCV4_LIB_DNN

Alphabetic ordering was not correct, and it also lacked the propagation
of the "depends on" of select BR2_PACKAGE_OPENCV4_LIB_DNN.

The final patch is at:

  https://git.buildroot.org/buildroot/commit/?id=e229943785534e0884c62c7346a8c6df8d565e1e

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires BR2_PACKAGE_OPENCV4_LIB_DNN
  2022-08-15 12:35   ` Thomas Petazzoni via buildroot
@ 2022-08-15 12:45     ` Giulio Benetti
  0 siblings, 0 replies; 9+ messages in thread
From: Giulio Benetti @ 2022-08-15 12:45 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Stefano Cottafavi, Fabrice Fontaine, buildroot


> Il giorno 15 ago 2022, alle ore 14:35, Thomas Petazzoni <thomas.petazzoni@bootlin.com> ha scritto:
> 
> On Mon,  8 Aug 2022 00:25:29 +0200
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>> Opencv4 library objdetect needs library dnn, otherwise it throws:
>> ```
>> -- Module opencv_objdetect disabled because opencv_dnn dependency can't be resolved!
>> ```
>> So let's "select BR2_PACKAGE_OPENCV4_LIB_DNN" if
>> BR2_PACKAGE_OPENCV4_LIB_OBJDETECT is enabled.
>> 
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>> package/opencv4/Config.in | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git a/package/opencv4/Config.in b/package/opencv4/Config.in
>> index bdeddcc089..4991b4252b 100644
>> --- a/package/opencv4/Config.in
>> +++ b/package/opencv4/Config.in
>> @@ -155,6 +155,7 @@ config BR2_PACKAGE_OPENCV4_LIB_OBJDETECT
>>    select BR2_PACKAGE_OPENCV4_LIB_CALIB3D
>>    select BR2_PACKAGE_OPENCV4_LIB_IMGPROC
>>    select BR2_PACKAGE_OPENCV4_LIB_ML
>> +    select BR2_PACKAGE_OPENCV4_LIB_DNN
> 
> Alphabetic ordering was not correct, and it also lacked the propagation
> of the "depends on" of select BR2_PACKAGE_OPENCV4_LIB_DNN.

Oh no, again the dependencies in Config.in!
I still keep forgetting them :-/

> 
> The final patch is at:
> 
>  https://git.buildroot.org/buildroot/commit/?id=e229943785534e0884c62c7346a8c6df8d565e1e

Thank you Thomas, you’re too kind.

Best regards
Giulio

> 
> Best regards,
> 
> Thomas
> -- 
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf
  2022-08-07 22:25 ` [Buildroot] [PATCH 1/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf Giulio Benetti
  2022-08-15 12:35   ` Thomas Petazzoni via buildroot
@ 2022-09-16 12:22   ` Peter Korsgaard
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2022-09-16 12:22 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Stefano Cottafavi, Fabrice Fontaine, buildroot

>>>>> "Giulio" == Giulio Benetti <giulio.benetti@benettiengineering.com> writes:

 > Opencv4 requires protobuf library otherwise it disables DNN:
 > ```
 > if(NOT HAVE_PROTOBUF)
 >   ocv_module_disable(opencv_dnn)
 > endif()
 > ```
 > https://github.com/opencv/opencv/blob/4.x/modules/dnn/CMakeLists.txt#L5-L7
 > So let's "select BR2_PACKAGE_OPENCV4_WITH_PROTOBUF" if
 > BR2_PACKAGE_OPENCV4_LIB_DNN is enabled.

 > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

Committed to 2022.05.x and 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires BR2_PACKAGE_OPENCV4_LIB_DNN
  2022-08-07 22:25 ` [Buildroot] [PATCH 2/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires BR2_PACKAGE_OPENCV4_LIB_DNN Giulio Benetti
  2022-08-15 12:35   ` Thomas Petazzoni via buildroot
@ 2022-09-16 12:22   ` Peter Korsgaard
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Korsgaard @ 2022-09-16 12:22 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Stefano Cottafavi, Fabrice Fontaine, buildroot

>>>>> "Giulio" == Giulio Benetti <giulio.benetti@benettiengineering.com> writes:

 > Opencv4 library objdetect needs library dnn, otherwise it throws:
 > ```
 > -- Module opencv_objdetect disabled because opencv_dnn dependency can't be resolved!
 > ```
 > So let's "select BR2_PACKAGE_OPENCV4_LIB_DNN" if
 > BR2_PACKAGE_OPENCV4_LIB_OBJDETECT is enabled.

 > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

Committed to 2022.05.x and 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-09-16 12:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-07 22:25 [Buildroot] [PATCH 0/2] Fix Opencv4 bug found by a user in Mailing list Giulio Benetti
2022-08-07 22:25 ` [Buildroot] [PATCH 1/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_DNN requires protobuf Giulio Benetti
2022-08-15 12:35   ` Thomas Petazzoni via buildroot
2022-09-16 12:22   ` Peter Korsgaard
2022-08-07 22:25 ` [Buildroot] [PATCH 2/2] package/opencv4: BR2_PACKAGE_OPENCV4_LIB_OBJDETECT requires BR2_PACKAGE_OPENCV4_LIB_DNN Giulio Benetti
2022-08-15 12:35   ` Thomas Petazzoni via buildroot
2022-08-15 12:45     ` Giulio Benetti
2022-09-16 12:22   ` Peter Korsgaard
     [not found] ` <CAPn86JAWEZNtkMjdD-fMAyiiW1-vfmzM=79qV7wgmiy7XHbJ-A@mail.gmail.com>
2022-08-13 14:15   ` [Buildroot] [PATCH 0/2] Fix Opencv4 bug found by a user in Mailing list Giulio Benetti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox