build: prepare to build for ARM64 on Windows with Visual Studio#24698
build: prepare to build for ARM64 on Windows with Visual Studio#24698asmorkalov merged 1 commit intoopencv:4.xfrom
Conversation
|
Hmm, I think I have to give up re-working the
|
|
@tomoaki0705 I merged the first your patch. Please rebase and fix conflicts. |
ae6850e to
5d4c507
Compare
|
I pushed the resolved version. Will end up as an compile error and we have to remember that it's a known issue. I also had to update the |
5d4c507 to
b6ec9b9
Compare
Sorry to post many PRs, but I came across with building for Windows on ARM64.
I faced several errors that assuming GCC/Clang on Aarch64.
opencv/cmake/OpenCVCompilerOptimizations.cmake
Lines 352 to 356 in 3d1f646
CMake will go through, but let's keep things correct.
try_compiledue to missing pragmasThis is a typical pragma for Arm
try_compileopencv/cmake/checks/cpu_neon_fp16.cpp
Line 3 in 3d1f646
and it ends up here
opencv/cmake/checks/cpu_neon_fp16.cpp
Lines 38 to 40 in 3d1f646
As far as I checked on Visual Studio 2022, ARM64 can handle
NEON,FP16,NEON_FP16andNEON_DOTPROD.I couldn't make it compile on
NEON_BF16.CV_FP16The compiler can compile
NEONandFP16, but it doesn't have a native singlehalftype like on Arm + GCC.And it hits this line, which is native
x86_64.opencv/modules/core/include/opencv2/core/cvdef.h
Lines 903 to 906 in 3d1f646
So for this issue, I need to rework the FP16, but for this PR, I remove this from the focus of this PR
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.