diff options
| -rw-r--r-- | meta-oe/recipes-support/opencv/opencv/0001-FROMLIST-Switch-to-static-instance-of-FastCV-on-Linux.patch | 87 | ||||
| -rw-r--r-- | meta-oe/recipes-support/opencv/opencv_4.11.0.bb | 8 |
2 files changed, 93 insertions, 2 deletions
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-FROMLIST-Switch-to-static-instance-of-FastCV-on-Linux.patch b/meta-oe/recipes-support/opencv/opencv/0001-FROMLIST-Switch-to-static-instance-of-FastCV-on-Linux.patch new file mode 100644 index 0000000000..dd3c9a7a82 --- /dev/null +++ b/meta-oe/recipes-support/opencv/opencv/0001-FROMLIST-Switch-to-static-instance-of-FastCV-on-Linux.patch | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | From e517347450636012e5f7a65a504e4ac9e1224c50 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexander Smorkalov <alexander.smorkalov@opencv.ai> | ||
| 3 | Date: Thu, 13 Feb 2025 09:17:08 +0300 | ||
| 4 | Subject: [PATCH] FROMLIST: Switch to static instance of FastCV on Linux. | ||
| 5 | |||
| 6 | Signed-off-by: Alexander Smorkalov <alexander.smorkalov@opencv.ai> | ||
| 7 | Upstream-Status: Submitted [https://github.com/opencv/opencv/pull/26917] | ||
| 8 | --- | ||
| 9 | 3rdparty/fastcv/fastcv.cmake | 7 ++++--- | ||
| 10 | cmake/OpenCVFindLibsPerf.cmake | 21 +++++++++++++++------ | ||
| 11 | 2 files changed, 19 insertions(+), 9 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/3rdparty/fastcv/fastcv.cmake b/3rdparty/fastcv/fastcv.cmake | ||
| 14 | index b8172705ca..5c81c11300 100644 | ||
| 15 | --- a/3rdparty/fastcv/fastcv.cmake | ||
| 16 | +++ b/3rdparty/fastcv/fastcv.cmake | ||
| 17 | @@ -1,7 +1,7 @@ | ||
| 18 | function(download_fastcv root_dir) | ||
| 19 | |||
| 20 | # Commit SHA in the opencv_3rdparty repo | ||
| 21 | - set(FASTCV_COMMIT "dc5d58018f3af915a8d209386d2c58c0501c0f2c") | ||
| 22 | + set(FASTCV_COMMIT "f4413cc2ab7233fdfc383a4cded402c072677fb0") | ||
| 23 | |||
| 24 | # Define actual FastCV versions | ||
| 25 | if(ANDROID) | ||
| 26 | @@ -16,14 +16,15 @@ function(download_fastcv root_dir) | ||
| 27 | endif() | ||
| 28 | elseif(UNIX AND NOT APPLE AND NOT IOS AND NOT XROS) | ||
| 29 | if(AARCH64) | ||
| 30 | - set(FCV_PACKAGE_NAME "fastcv_linux_aarch64_2024_12_11.tgz") | ||
| 31 | - set(FCV_PACKAGE_HASH "7b33ad833e6f15ab6d4ec64fa3c17acd") | ||
| 32 | + set(FCV_PACKAGE_NAME "fastcv_linux_aarch64_2025_02_12.tgz") | ||
| 33 | + set(FCV_PACKAGE_HASH "33ac2a59cf3e7d6402eee2e010de1202") | ||
| 34 | else() | ||
| 35 | message("FastCV: fastcv lib for 32-bit Linux is not supported for now!") | ||
| 36 | endif() | ||
| 37 | endif(ANDROID) | ||
| 38 | |||
| 39 | # Download Package | ||
| 40 | + | ||
| 41 | set(OPENCV_FASTCV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FASTCV_COMMIT}/fastcv/") | ||
| 42 | |||
| 43 | ocv_download( FILENAME ${FCV_PACKAGE_NAME} | ||
| 44 | diff --git a/cmake/OpenCVFindLibsPerf.cmake b/cmake/OpenCVFindLibsPerf.cmake | ||
| 45 | index c2380e6ce5..c5fb628c44 100644 | ||
| 46 | --- a/cmake/OpenCVFindLibsPerf.cmake | ||
| 47 | +++ b/cmake/OpenCVFindLibsPerf.cmake | ||
| 48 | @@ -181,7 +181,14 @@ endif(WITH_KLEIDICV) | ||
| 49 | if(WITH_FASTCV) | ||
| 50 | if((EXISTS ${FastCV_INCLUDE_PATH}) AND (EXISTS ${FastCV_LIB_PATH})) | ||
| 51 | message(STATUS "Use external FastCV ${FastCV_INCLUDE_PATH}, ${FastCV_LIB_PATH}") | ||
| 52 | - set(HAVE_FASTCV TRUE CACHE BOOL "FastCV status") | ||
| 53 | + find_library(FASTCV_LIBRARY NAMES "fastcv" | ||
| 54 | + PATHS "${FastCV_LIB_PATH}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) | ||
| 55 | + mark_as_advanced(FASTCV_LIBRARY) | ||
| 56 | + if (FASTCV_LIBRARY) | ||
| 57 | + set(HAVE_FASTCV TRUE CACHE BOOL "FastCV status") | ||
| 58 | + else() | ||
| 59 | + set(HAVE_FASTCV FALSE CACHE BOOL "FastCV status") | ||
| 60 | + endif() | ||
| 61 | else() | ||
| 62 | include("${OpenCV_SOURCE_DIR}/3rdparty/fastcv/fastcv.cmake") | ||
| 63 | set(FCV_ROOT_DIR "${OpenCV_BINARY_DIR}/3rdparty/fastcv") | ||
| 64 | @@ -190,13 +197,15 @@ if(WITH_FASTCV) | ||
| 65 | set(FastCV_INCLUDE_PATH "${FCV_ROOT_DIR}/inc" CACHE PATH "FastCV includes directory") | ||
| 66 | set(FastCV_LIB_PATH "${FCV_ROOT_DIR}/libs" CACHE PATH "FastCV library directory") | ||
| 67 | ocv_install_3rdparty_licenses(FastCV "${OpenCV_BINARY_DIR}/3rdparty/fastcv/LICENSE") | ||
| 68 | - install(FILES "${FastCV_LIB_PATH}/libfastcvopt.so" | ||
| 69 | - DESTINATION "${OPENCV_LIB_INSTALL_PATH}" COMPONENT "bin") | ||
| 70 | + if(ANDROID) | ||
| 71 | + set(FASTCV_LIBRARY "${FastCV_LIB_PATH}/libfastcvopt.so" CACHE PATH "FastCV library") | ||
| 72 | + install(FILES "${FASTCV_LIBRARY}" DESTINATION "${OPENCV_LIB_INSTALL_PATH}" COMPONENT "bin") | ||
| 73 | + else() | ||
| 74 | + set(FASTCV_LIBRARY "${FastCV_LIB_PATH}/libfastcv.a" CACHE PATH "FastCV library") | ||
| 75 | + install(FILES "${FASTCV_LIBRARY}" DESTINATION "${OPENCV_LIB_INSTALL_PATH}" COMPONENT "dev") | ||
| 76 | + endif() | ||
| 77 | else() | ||
| 78 | set(HAVE_FASTCV FALSE CACHE BOOL "FastCV status") | ||
| 79 | endif() | ||
| 80 | endif() | ||
| 81 | - if(HAVE_FASTCV) | ||
| 82 | - set(FASTCV_LIBRARY "${FastCV_LIB_PATH}/libfastcvopt.so" CACHE PATH "FastCV library") | ||
| 83 | - endif() | ||
| 84 | endif(WITH_FASTCV) | ||
| 85 | -- | ||
| 86 | 2.34.1 | ||
| 87 | |||
diff --git a/meta-oe/recipes-support/opencv/opencv_4.11.0.bb b/meta-oe/recipes-support/opencv/opencv_4.11.0.bb index 1613b6a3ed..61dc681a39 100644 --- a/meta-oe/recipes-support/opencv/opencv_4.11.0.bb +++ b/meta-oe/recipes-support/opencv/opencv_4.11.0.bb | |||
| @@ -16,15 +16,17 @@ SRCREV_boostdesc = "34e4206aef44d50e6bbcd0ab06354b52e7466d26" | |||
| 16 | SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d" | 16 | SRCREV_vgg = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d" |
| 17 | SRCREV_face = "8afa57abc8229d611c4937165d20e2a2d9fc5a12" | 17 | SRCREV_face = "8afa57abc8229d611c4937165d20e2a2d9fc5a12" |
| 18 | SRCREV_wechat-qrcode = "a8b69ccc738421293254aec5ddb38bd523503252" | 18 | SRCREV_wechat-qrcode = "a8b69ccc738421293254aec5ddb38bd523503252" |
| 19 | SRCREV_fastcv = "f4413cc2ab7233fdfc383a4cded402c072677fb0" | ||
| 19 | 20 | ||
| 20 | 21 | ||
| 21 | SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg" | 22 | SRCREV_FORMAT = "opencv_contrib_ipp_boostdesc_vgg_fastcv" |
| 22 | SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=4.x;protocol=https \ | 23 | SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=4.x;protocol=https \ |
| 23 | git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;name=contrib;branch=4.x;protocol=https \ | 24 | git://github.com/opencv/opencv_contrib.git;destsuffix=git/contrib;name=contrib;branch=4.x;protocol=https \ |
| 24 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=git/boostdesc;name=boostdesc;protocol=https \ | 25 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_boostdesc_20161012;destsuffix=git/boostdesc;name=boostdesc;protocol=https \ |
| 25 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=git/vgg;name=vgg;protocol=https \ | 26 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_xfeatures2d_vgg_20160317;destsuffix=git/vgg;name=vgg;protocol=https \ |
| 26 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=git/face;name=face;protocol=https \ | 27 | git://github.com/opencv/opencv_3rdparty.git;branch=contrib_face_alignment_20170818;destsuffix=git/face;name=face;protocol=https \ |
| 27 | git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=git/wechat_qrcode;name=wechat-qrcode;protocol=https \ | 28 | git://github.com/WeChatCV/opencv_3rdparty.git;branch=wechat_qrcode;destsuffix=git/wechat_qrcode;name=wechat-qrcode;protocol=https \ |
| 29 | git://github.com/opencv/opencv_3rdparty.git;branch=fastcv/4.x_20250212;destsuffix=git/fastcv;name=fastcv;protocol=https \ | ||
| 28 | file://0003-To-fix-errors-as-following.patch \ | 30 | file://0003-To-fix-errors-as-following.patch \ |
| 29 | file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ | 31 | file://0001-Temporarliy-work-around-deprecated-ffmpeg-RAW-functi.patch \ |
| 30 | file://0001-Dont-use-isystem.patch \ | 32 | file://0001-Dont-use-isystem.patch \ |
| @@ -32,6 +34,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv;branch=4.x;protocol=ht | |||
| 32 | file://0001-Make-ts-module-external.patch \ | 34 | file://0001-Make-ts-module-external.patch \ |
| 33 | file://0008-Do-not-embed-build-directory-in-binaries.patch \ | 35 | file://0008-Do-not-embed-build-directory-in-binaries.patch \ |
| 34 | file://0001-core-fixed-VSX-intrinsics-implementation.patch \ | 36 | file://0001-core-fixed-VSX-intrinsics-implementation.patch \ |
| 37 | file://0001-FROMLIST-Switch-to-static-instance-of-FastCV-on-Linux.patch \ | ||
| 35 | " | 38 | " |
| 36 | SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" | 39 | SRC_URI:append:riscv64 = " file://0001-Use-Os-to-compile-tinyxml2.cpp.patch;patchdir=contrib" |
| 37 | 40 | ||
| @@ -61,6 +64,7 @@ do_unpack_extra() { | |||
| 61 | cache data ${S}/face/*.dat | 64 | cache data ${S}/face/*.dat |
| 62 | cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel | 65 | cache wechat_qrcode ${S}/wechat_qrcode/*.caffemodel |
| 63 | cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt | 66 | cache wechat_qrcode ${S}/wechat_qrcode/*.prototxt |
| 67 | cache fastcv ${S}/fastcv/fastcv/*.tgz | ||
| 64 | } | 68 | } |
| 65 | addtask unpack_extra after do_unpack before do_patch | 69 | addtask unpack_extra after do_unpack before do_patch |
| 66 | 70 | ||
| @@ -71,7 +75,6 @@ EXTRA_OECMAKE = "-DOPENCV_EXTRA_MODULES_PATH=${S}/contrib/modules \ | |||
| 71 | -DENABLE_PRECOMPILED_HEADERS=OFF \ | 75 | -DENABLE_PRECOMPILED_HEADERS=OFF \ |
| 72 | -DCMAKE_SKIP_RPATH=ON \ | 76 | -DCMAKE_SKIP_RPATH=ON \ |
| 73 | -DWITH_IPP=OFF \ | 77 | -DWITH_IPP=OFF \ |
| 74 | -DWITH_FASTCV=OFF \ | ||
| 75 | -DOPENCV_GENERATE_PKGCONFIG=ON \ | 78 | -DOPENCV_GENERATE_PKGCONFIG=ON \ |
| 76 | -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \ | 79 | -DOPENCV_DOWNLOAD_PATH=${OPENCV_DLDIR} \ |
| 77 | -DOPENCV_ALLOW_DOWNLOADS=OFF \ | 80 | -DOPENCV_ALLOW_DOWNLOADS=OFF \ |
| @@ -122,6 +125,7 @@ PACKAGECONFIG[tests] = "-DBUILD_TESTS=ON,-DBUILD_TESTS=OFF,," | |||
| 122 | PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract," | 125 | PACKAGECONFIG[text] = "-DBUILD_opencv_text=ON,-DBUILD_opencv_text=OFF,tesseract," |
| 123 | PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff," | 126 | PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff," |
| 124 | PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils," | 127 | PACKAGECONFIG[v4l] = "-DWITH_V4L=ON,-DWITH_V4L=OFF,v4l-utils," |
| 128 | PACKAGECONFIG[fastcv] = "-DWITH_FASTCV=ON ,-DWITH_FASTCV=OFF,," | ||
| 125 | 129 | ||
| 126 | inherit pkgconfig cmake setuptools3-base python3native | 130 | inherit pkgconfig cmake setuptools3-base python3native |
| 127 | 131 | ||
