Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v5 03/13] package/opencv: bump to version 3.0
Date: Sun, 7 Jun 2015 14:03:16 +0200	[thread overview]
Message-ID: <20150607120316.GD3545@free.fr> (raw)
In-Reply-To: <1433672799-21387-4-git-send-email-s.martin49@gmail.com>

Samuel, All,

On 2015-06-07 12:26 +0200, Samuel Martin spake thusly:
> This major version bump is in fact a bump from 2.4.10 to 2.4.11, then to
> 3.0.
> 
> OpenCV-2.4.11 improves a lot the Buildroot integration, including a
> couple of patches that no longer need to be carried in Buildroot tree:

...that are no longer needed:

> - x86 PIC code compilation fix in core module [1];
> - return type fix in superes module [2];
> - opencv.pc generation [3].
> 
> It also improves the gstreamer-0.10/1.x detection [4], that will needed

...that will be needed...

> in a follow-up patch.
> 
> The OpenCV-3.0 does some major changes, for which a transition guide
> has been published [5].
> 
> Among these changes coming with OpenCV-3.0, some new modules have been
> introduced and others got removed; leading to a bunch of configure
> option updates (to keep as much as possible an iso-functional-perimeter)
> and the legacy menu has been updated too.
> The worth noticing removal being:
> - the opencv_legacy and opencv_nonfree modules no longer exist;
> - the opencv_contrib module has moved out of the opencv base tree and
>   now has its own repository [6].
>   There is currently no plan to support it.
> 
> Some 3rd-party supports have been improved or added; their integrations
> in Buildroot will be addressed in follow-up patches.
> 
> [1] https://github.com/Itseez/opencv/commit/ea50be0529c248961e1b66293f8a9e4b807294a6
> [2] https://github.com/Itseez/opencv/commit/2e393ab83362743ba1825ad4b31d4a2925c606b4
> [3] https://github.com/Itseez/opencv/commit/eceada586bbf18fc267e437522ec4f1f23ddc656
> [4] https://github.com/Itseez/opencv/commit/38bb0db9dbec08666c8a64b3e4ead8fadf15c980
> [5] http://docs.opencv.org/master/db/dfa/tutorial_transition_guide.html
> [6] https://github.com/itseez/opencv_contrib
> 
> Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> 
> ---
> changes v4->v5:
> - new patch
> ---
>  Config.in.legacy                                   |  16 +++
>  .../0001-core-fix-x86-PIC-code-compilation.patch   |  49 -------
>  ...ix-return-type-value-VideoFrameSource_GPU.patch |  40 ------
>  ...VGenPkgconfig.cmake-rework-opencv.pc-gene.patch | 156 ---------------------
>  package/opencv/Config.in                           |  44 +++---
>  package/opencv/opencv.mk                           |  70 +++++++--
>  6 files changed, 96 insertions(+), 279 deletions(-)
>  delete mode 100644 package/opencv/0001-core-fix-x86-PIC-code-compilation.patch
>  delete mode 100644 package/opencv/0002-superres-Fix-return-type-value-VideoFrameSource_GPU.patch
>  delete mode 100644 package/opencv/0003-cmake-OpenCVGenPkgconfig.cmake-rework-opencv.pc-gene.patch
> 
> diff --git a/Config.in.legacy b/Config.in.legacy
> index 9b9fff0..e4a963b 100644
> --- a/Config.in.legacy
> +++ b/Config.in.legacy
> @@ -113,6 +113,22 @@ config BR2_TARGET_UBOOT_NETWORK
>  	help
>  	  U-Boot's custom network settings options have been removed.
>  
> +config BR2_PACKAGE_OPENCV_LIB_CONTRIB
> +	bool "opencv contrib module"
> +	select BR2_LEGACY

We're usually to be more explicit in the legacy option, either with a
longer prompt (e.g. "opencv contrib module no longer exists") or a help
entry (e.g. "help\nOpenCV contrib module no longer exists") or both.

> +config BR2_PACKAGE_OPENCV_LIB_GPU
> +	bool "opencv gpu module (splited in several 'cudaXXX' modules)"
> +	select BR2_LEGACY

'split' is an irregular verb, so its participle past is just 'split'.

Also, I did not see those new cudaXXX modules being added in that patch,
nor did I see a further patch adding them.

If we're not adding them, then no need to reference them in the legacy
prompt, or that would confuse the user.

> +config BR2_PACKAGE_OPENCV_LIB_LEGACY
> +	bool "opencv legacy module"
> +	select BR2_LEGACY

Ditto, we're usually trying to be more explicit about legacy options.

> +config BR2_PACKAGE_OPENCV_LIB_NONFREE
> +	bool "opencv nonfree module"
> +	select BR2_LEGACY

Ditto.

> diff --git a/package/opencv/opencv.mk b/package/opencv/opencv.mk
> index 4d08481..0a1b94c 100644
> --- a/package/opencv/opencv.mk
> +++ b/package/opencv/opencv.mk
[--SNIP--]
> @@ -12,19 +12,28 @@ OPENCV_LICENSE_FILES = LICENSE
>  
>  # OpenCV component options
>  OPENCV_CONF_OPTS += \
> +	-DBUILD_DOCS=OFF \
>  	-DBUILD_PERF_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_PERF_TESTS),ON,OFF) \
>  	-DBUILD_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_TESTS),ON,OFF) \
>  	-DBUILD_WITH_DEBUG_INFO=OFF
>  
> +ifneq ($(BR2_PACKAGE_OPENCV_BUILD_TESTS)$(BR2_PACKAGE_OPENCV_BUILD_PERF_TESTS),)
> +OPENCV_CONF_OPTS += -DINSTALL_TEST=ON
> +else
> +OPENCV_CONF_OPTS += -DINSTALL_TEST=OFF
> +endif

We usually prefer positive logic, like so:

    ifeq ($(BR2_PACKAGE_OPENCV_BUILD_TESTS)$(BR2_PACKAGE_OPENCV_BUILD_PERF_TESTS),)
    OPENCV_CONF_OPTS += -DINSTALL_TEST=OFF
    else
    OPENCV_CONF_OPTS += -DINSTALL_TEST=ON
    endif

> @@ -39,40 +48,49 @@ OPENCV_CONF_OPTS += \
>  	-DINSTALL_CREATE_DISTRIB=OFF
>  
>  # OpenCV module selection
> +# - contrib modules are disabled.

'disabled' or 'no longer exist' ?

>  OPENCV_CONF_OPTS += \
>  	-DBUILD_opencv_androidcamera=OFF \
>  	-DBUILD_opencv_apps=OFF \
>  	-DBUILD_opencv_calib3d=$(if $(BR2_PACKAGE_OPENCV_LIB_CALIB3D),ON,OFF) \
> -	-DBUILD_opencv_contrib=$(if $(BR2_PACKAGE_OPENCV_LIB_CONTRIB),ON,OFF) \
>  	-DBUILD_opencv_core=ON \
> -	-DBUILD_opencv_dynamicuda=OFF \
>  	-DBUILD_opencv_features2d=$(if $(BR2_PACKAGE_OPENCV_LIB_FEATURES2D),ON,OFF) \
>  	-DBUILD_opencv_flann=$(if $(BR2_PACKAGE_OPENCV_LIB_FLANN),ON,OFF) \
> -	-DBUILD_opencv_gpu=$(if $(BR2_PACKAGE_OPENCV_LIB_GPU),ON,OFF) \
> +	-DBUILD_opencv_hal=ON \
>  	-DBUILD_opencv_highgui=$(if $(BR2_PACKAGE_OPENCV_LIB_HIGHGUI),ON,OFF) \
> +	-DBUILD_opencv_imgcodecs=$(if $(BR2_PACKAGE_OPENCV_LIB_IMGCODECS),ON,OFF) \
>  	-DBUILD_opencv_imgproc=$(if $(BR2_PACKAGE_OPENCV_LIB_IMGPROC),ON,OFF) \
>  	-DBUILD_opencv_java=OFF \
> -	-DBUILD_opencv_legacy=$(if $(BR2_PACKAGE_OPENCV_LIB_LEGACY),ON,OFF) \
>  	-DBUILD_opencv_ml=$(if $(BR2_PACKAGE_OPENCV_LIB_ML),ON,OFF) \
> -	-DBUILD_opencv_nonfree=$(if $(BR2_PACKAGE_OPENCV_LIB_NONFREE),ON,OFF) \
>  	-DBUILD_opencv_objdetect=$(if $(BR2_PACKAGE_OPENCV_LIB_OBJDETECT),ON,OFF) \
> -	-DBUILD_opencv_ocl=OFF \
>  	-DBUILD_opencv_photo=$(if $(BR2_PACKAGE_OPENCV_LIB_PHOTO),ON,OFF) \
> -	-DBUILD_opencv_python=OFF \
> +	-DBUILD_opencv_python2=OFF \
> +	-DBUILD_opencv_python3=OFF \
> +	-DBUILD_opencv_shape=$(if $(BR2_PACKAGE_OPENCV_LIB_SHAPE),ON,OFF) \
>  	-DBUILD_opencv_stitching=$(if $(BR2_PACKAGE_OPENCV_LIB_STITCHING),ON,OFF) \
>  	-DBUILD_opencv_superres=$(if $(BR2_PACKAGE_OPENCV_LIB_SUPERRES),ON,OFF) \
>  	-DBUILD_opencv_ts=$(if $(BR2_PACKAGE_OPENCV_LIB_TS),ON,OFF) \
>  	-DBUILD_opencv_video=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEO),ON,OFF) \
> +	-DBUILD_opencv_videoio=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEOIO),ON,OFF) \
>  	-DBUILD_opencv_videostab=$(if $(BR2_PACKAGE_OPENCV_LIB_VIDEOSTAB),ON,OFF) \
> +	-DBUILD_opencv_viz=OFF \

Any reason not to add a Config.in option for viz?

>  	-DBUILD_opencv_world=OFF
>  
>  # Hardware support options.
>  #
>  # * PowerPC support is turned off since its only effect is altering CFLAGS,
>  #   adding '-mcpu=G3 -mtune=G5' to them, which is already handled by Buildroot.
> +# * fma3 and popcnt support is disabled because according to gcc manual [1], it
> +#   is only available on x86_64 haswell, broadwell and knl architecture.
> +#
> +# [1] https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/x86-Options.html#x86-Options
>  OPENCV_CONF_OPTS += \
>  	-DENABLE_AVX2=$(if $(BR2_X86_CPU_HAS_AVX2),ON,OFF) \
> +	-DENABLE_AVX2=$(if $(BR2_X86_CPU_HAS_AVX2),ON,OFF) \
> +	-DENABLE_AVX=$(if $(BR2_X86_CPU_HAS_AVX),ON,OFF) \
>  	-DENABLE_AVX=$(if $(BR2_X86_CPU_HAS_AVX),ON,OFF) \

Uho... Duplicating avx and avx2.

And like I said for SSE/. SE2: AVX sorts before AVX2. Don't trust your
vim! ;-)

[--SNIP--]
> @@ -83,6 +101,19 @@ OPENCV_CONF_OPTS += \
>  
>  # Cuda stuff
>  OPENCV_CONF_OPTS += \
> +	-DBUILD_CUDA_STUBS=OFF \
> +	-DBUILD_opencv_cudaarithm=OFF \
> +	-DBUILD_opencv_cudabgsegm=OFF \
> +	-DBUILD_opencv_cudacodec=OFF \
> +	-DBUILD_opencv_cudafeatures2d=OFF \
> +	-DBUILD_opencv_cudafilters=OFF \
> +	-DBUILD_opencv_cudaimgproc=OFF \
> +	-DBUILD_opencv_cudalegacy=OFF \
> +	-DBUILD_opencv_cudaobjdetect=OFF \
> +	-DBUILD_opencv_cudaoptflow=OFF \
> +	-DBUILD_opencv_cudastereo=OFF \
> +	-DBUILD_opencv_cudawarping=OFF \
> +	-DBUILD_opencv_cudev=OFF \

Oh, we're adding all of the CUDA modules here, and they are forcibly
disabled. So, don't refer to them in the legacy prompt, or the user
would hunt for the corresponding options to enable/disable them, when
they are always disabled anyway, and that would be quite confusing
(He!, look how I was confused! ;-] ).

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2015-06-07 12:03 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-07 10:26 [Buildroot] [PATCH v5 00/13] OpenCV bump Samuel Martin
2015-06-07 10:26 ` [Buildroot] [PATCH v5 01/13] package/opencv: cleanup spaces at ends of line Samuel Martin
2015-06-07 11:31   ` Yann E. MORIN
2015-06-09 20:45   ` Thomas Petazzoni
2015-06-07 10:26 ` [Buildroot] [PATCH v5 02/13] package/opencv: alphabetically sorted each _CONF_OPTS group Samuel Martin
2015-06-07 11:35   ` Yann E. MORIN
2015-06-07 11:49     ` Samuel Martin
2015-06-07 10:26 ` [Buildroot] [PATCH v5 03/13] package/opencv: bump to version 3.0 Samuel Martin
2015-06-07 12:03   ` Yann E. MORIN [this message]
2015-06-14 14:05     ` Samuel Martin
2015-06-07 10:26 ` [Buildroot] [PATCH v5 04/13] package/opencv: define modules inter-dependencies Samuel Martin
2015-06-07 12:11   ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 05/13] package/opencv: reword modules' prompt and help text Samuel Martin
2015-06-07 12:12   ` Yann E. MORIN
2015-06-09 20:46     ` Thomas Petazzoni
2015-06-07 10:26 ` [Buildroot] [PATCH v5 06/13] package/opencv: add qt5 support Samuel Martin
2015-06-07 12:16   ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 07/13] package/opencv: add python support Samuel Martin
2015-06-07 12:22   ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 08/13] package/opencv: add gstreamer-1.x support Samuel Martin
2015-06-07 12:34   ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 09/13] package/opencv: add opengl support Samuel Martin
2015-06-07 12:41   ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 10/13] package/opencv: add openmp support Samuel Martin
2015-06-07 12:43   ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 11/13] package/opencv: add gtk3 support Samuel Martin
2015-06-07 13:00   ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 12/13] package/vlc: add opencv support Samuel Martin
2015-06-07 13:14   ` Yann E. MORIN
2015-06-07 10:26 ` [Buildroot] [PATCH v5 13/13] package/gstreamer1/gst1-plugins-bad: disable opencv plugin with opencv-3 Samuel Martin
2015-06-07 13:18   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150607120316.GD3545@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox