-
-
Notifications
You must be signed in to change notification settings - Fork 439
add opencv android #7065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
add opencv android #7065
Conversation
69e064f
to
fdf7b63
Compare
fdf7b63
to
d94daed
Compare
current state: CMake Error at /home/kekopom/.xmake/cache/packages/2505/o/opencv/4.11.0/source/cmake/OpenCVGenPkgconfig.cmake:113 (cmake_minimum_required): Update the VERSION argument value. Or, use the ... syntax Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. ==> Looks like adding |
If you update xmake by |
Looks like it didn't work :( FAILED: unix-install/opencv4.pc /home/kekopom/.xmake/cache/packages/2505/o/opencv/4.11.0/source/bd/unix-install/opencv4.pc Update the VERSION argument value. Or, use the ... syntax Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. ==> Looks like the warning has became an error since CMake 4.0.0 which is pulled by XMake if I am not misleading |
https://github.com/xmake-io/xmake/blob/ea13d87b271fbfe6ec96b90cb6b315220f4c53e9/xmake/modules/package/tools/cmake.lua#L951-L953 This supposed to pass |
@luadebug indeed I can see that the flag is well propagated to cmake edit: I might have found an interesting link: opencv/opencv#27122 I would like also to avoid to pull a .patch from a non-opencv repo, if someone knows a better way to use a commit id maybe |
I suppose it leads to
Since |
Yep I fixed it by adding |
e81839e
to
abc7027
Compare
abc7027
to
6178b7f
Compare
I think I've been able to finally build it |
Co-authored-by: Saikari <lin@sz.cn.eu.org>
f96abba
to
6f90649
Compare
Both (shared / static) builds are OK |
seems related to #1228 |
I've been able to build and run this exemple https://docs.opencv.org/4.x/d9/d15/samples_2cpp_2cout_mat_8cpp-example.html On my Android phone! |
@luadebug thanks for helping fixing windows build :D Could it be linked with |
It looks like linkdir for windows |
@luadebug do you know what's happening? Only related topic I could find is https://developercommunity.visualstudio.com/t/wcharh-header-fails-compilation-on-ARM6/10868106?sort=newest Btw since we haven't changed anything for Windows ARM I would have expected it to work, I am a bit surprised |
Why is this being mentioned, is it some current Github CI failure? Looks like issue present for 2022 worker.
Maybe new version update broke something. |
So what do we do? |
It looks like this package has windows@arm64 introduced exactly for 4.10.0->4.11.0... exactly for 2022 worker... about 3 months ago 4.11.0 was pushed. if on_check then
on_check("windows|arm64", function (package)
if package:version() and package:version():lt("4.10.0") then
raise("current opencv version does not support windows/arm64!")
end
local vs = package:toolchain("msvc"):config("vs")
assert(tonumber(vs) >= 2022, "opencv requires Visual Studio 2022 and later for arm targets")
end)
end I wish we could limit Windows SDK that being used by 2022 worker to be newer version (on_check should assert newer Windows SDK version) and at same time keep mine workaround (resolve https://github.com/xmake-io/xmake-repo/actions/runs/14924396539/job/41926501716#step:5:1292), and find fix links (add_links, linkdirs) for Windows-11 arm worker at same time. This looks tough to limit arm64 ones. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to fix links for Windows-11 arm worker I guess so.
-- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/o/opencv/4.11.0/8de6f34073014aeda5283f5b8d6a5e84/x64/vc17/staticlib/opencv_objdetect4110.lib
Afaik -DARM in case of
I resolved this by os.trymv but now executable |
-DBUILD_ANDROID_EXAMPLES=OFF
as it causes issues. see CMake Error on Termux, Android SDK: specify path to Android SDK via ANDROID_SDK_ROOT / ANDROID_HOME / ANDROID_SDK variables opencv/opencv#15769 (comment)[Need to way a clean way to handle it] ==> done: setting the
DCMAKE_ANDROID_ARCH_ABI
instead ofDCMAKE_SYSTEM_PROCESSOR
for Android seems the right way to do it.Testing locally by running
xmake l scripts/test.lua -v -D --shallow -p android --ndk=~/android-ndk-r28b --ndk_sdkver=32 -a arm64-v8a opencv
and for shared:
xmake l scripts/test.lua -v -D --shallow -p android --ndk=~/android-ndk-r27c --ndk_sdkver=32 -a arm64-v8a -k shared opencv