Skip to content

CMake fails to detect NEON, etc. support on ARM processor #18244

@rgov

Description

@rgov
System information (version)
  • OpenCV => 4.4.0
  • Operating System / Platform => Ubuntu 18.04 / armv7l
  • Compiler => gcc 7.5.0
Detailed description

CMake does not detect that my ARM CPU supports NEON instructions or other features. If I compile the example source code from cmake/checks/cpu_neon.cpp with -mfpu=neon, it builds and runs successfully.

-- Performing Test HAVE_CXX_MFPU_VFPV3
-- Performing Test HAVE_CXX_MFPU_VFPV3 - Success
-- Performing Test HAVE_CPU_NEON_SUPPORT (check file: cmake/checks/cpu_neon.cpp)
-- Performing Test HAVE_CPU_NEON_SUPPORT - Failed
-- Performing Test HAVE_CXX_MFPU_NEON (check file: cmake/checks/cpu_neon.cpp)
-- Performing Test HAVE_CXX_MFPU_NEON - Success
-- Performing Test HAVE_CPU_FP16_SUPPORT (check file: cmake/checks/cpu_fp16.cpp)
-- Performing Test HAVE_CPU_FP16_SUPPORT - Failed
-- Performing Test HAVE_CXX_MFPU_NEON_FP16_MFP16_FORMAT_IEEE (check file: cmake/checks/cpu_fp16.cpp)
-- Performing Test HAVE_CXX_MFPU_NEON_FP16_MFP16_FORMAT_IEEE - Success
-- Performing Test HAVE_CPU_BASELINE_FLAGS
-- Performing Test HAVE_CPU_BASELINE_FLAGS - Success

...

--   CPU/HW features:
--     Baseline:
--       requested:                 DETECT
--       disabled:                  VFPV3 NEON
Steps to reproduce
cmake .. \
    -DCMAKE_BUILD_TYPE=RelWithDebugInfo \
    -DCMAKE_INSTALL_PREFIX="$(cd root; pwd)" \
    -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules \
    -DBUILD_JAVA=OFF \
    -DBUILD_TESTS=OFF \
    -DBUILD_PERF_TESTS=OFF \
    -DBUILD_opencv_java=OFF \
    -DBUILD_opencv_python2=OFF \
    -DBUILD_opencv_python3=ON \
    -DPYTHON_DEFAULT_EXECUTABLE="$(command -v python3.7)" \
    -DPYTHON3_INCLUDE_DIR="$PYTHON_INCLUDE" \
    -DPYTHON3_LIBRARY="$PYTHON_LIBRARY" \
    -DPYTHON3_EXECUTABLE="$(command -v python3.7)" \
    -DPYTHON3_NUMPY_INCLUDE_DIRS="$NUMPY_INCLUDE" \
    -DPYTHON3_PACKAGES_PATH="$PYTHON_PACKAGES" \
    -DOPENCV_SKIP_PYTHON_LOADER=ON
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcategory: build/installneeds investigationCollect and attach more details (build flags, stacktraces, input dumps, etc)platform: armARM boards related issues: RPi, NVIDIA TK/TX, etc

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions