opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
75.69k stars 55.61k forks source link

ENABLE_NEON=OFF is not disabling the baseline in armv7l #25444

Open rprasanth opened 2 weeks ago

rprasanth commented 2 weeks ago

System Information

OpenCV version: 4.9.0 Operating System / Platform: Ubuntu 20.04 Compiler & compiler version: GCC 4.9.4l Libc : Uclibc

Detailed description

I'm doing a cross-build for my armv7l platform with Gcc 4.9 + uclibc As I am not using hardfloat feature, I tried disabling neon support with "ENABLE_NEON=OFF" " -- CPU/HW features: -- Baseline: NEON FP16 -- requested: DETECT -- disabled: VFPV3 NEON "

But it seems the Neon is getting auto-detected and getting enabled, If I pass CPU_BASELINE=FP16 in addition I could see the build get success, but __m128 seems to be with SSE for x86 32/64 bit arch, doesn't it?

kindly give me a clarity on this please, why "ENABLE_NEON=OFF" doesn't help in disabling it?

Steps to reproduce

opencv-4.9.log

''' uclibcgnueabi/OpenCV-4.9.0/opencv-4.9.0/modules/core/include/opencv2/core/cvdef.h:904:9: error: 'm128' was not declared in this scope m128 v = _mm_load_ss(&x); ^ uclibcgnueabi/OpenCV-4.9.0/opencv-4.9.0/modules/core/include/opencv2/core/cvdef.h:905:52: error: 'v' was not declared in this scope w = (ushort)_mm_cvtsi128_si32(_mm_cvtps_ph(v, 0)); '''

''' -- Performing Test HAVE_CPU_NEON_SUPPORT (check file: cmake/checks/cpu_neon.cpp) -- Performing Test HAVE_CPU_NEON_SUPPORT - Success -- Performing Test HAVE_CPU_FP16_SUPPORT (check file: cmake/checks/cpu_fp16.cpp) -- Performing Test HAVE_CPU_FP16_SUPPORT - Success -- Performing Test HAVE_CPU_BASELINE_FLAGS -- Performing Test HAVE_CPU_BASELINE_FLAGS - Success '''

Issue submission checklist

opencv-alalek commented 2 weeks ago

OpenCV version: 4.9.0 I updated to the latest OpenCV version

Fetch latest code from 4.x branch.


This FP16 assumes NEON support. Don't try to use it without NEON.


ENABLE_NEON

Legacy and deprecated option.

rprasanth commented 1 week ago

Hi @opencv-alalek

is there any specific option to disable the NEON/FP16 support? that will be much helpful

opencv-alalek commented 1 week ago
-- Performing Test HAVE_CPU_NEON_SUPPORT (check file: cmake/checks/cpu_neon.cpp)
-- Performing Test HAVE_CPU_NEON_SUPPORT - Success

That means that compiler has enabled NEON support initially. You need to replace compiler toolchain or cmake's toolchain file or provide some flags to the compiler directly (e.g., using CXXFLAGS against clean build directory from scratch). Refer to manual of used compiler toolchain.


Build / usage questions should go to Users OpenCV Q/A forum: https://forum.opencv.org/