From 70f17ff996fba17e6055ea25db1d20fef9591f34 Mon Sep 17 00:00:00 2001 From: Michael Platings Date: Fri, 10 May 2024 09:59:04 +0000 Subject: [PATCH] Update required tool versions Versions were decided according to those provided by Ubuntu 20.04 This change adds a workaround for Clang 10 & 11 which had incomplete SVE2 support. --- doc/build.md | 14 ++++++++------ kleidicv/CMakeLists.txt | 6 ++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/build.md b/doc/build.md index f8fd06541..e0ed65a15 100644 --- a/doc/build.md +++ b/doc/build.md @@ -13,9 +13,10 @@ source code and generating the executable. Please ensure that these tools are installed on your system before proceeding with the build process. To successfully build and compile this project for Android, you'll need the following tools: -- [Android NDK](https://developer.android.com/ndk/) -- [CMake](https://cmake.org) version 3.16 or newer (3.21 is recommended) -- `make` or [Ninja](https://ninja-build.org) +- [Android NDK](https://developer.android.com/ndk/). + See [the platform support page](platform-support.md) for supported versions. +- [CMake](https://cmake.org) 3.16 or higher. +- `make` - `patch` Running tests on Android devices requires [ADB](https://developer.android.com/tools/adb). @@ -83,9 +84,10 @@ documentation for cross-building instructions. ## Prerequisites To successfully build and compile this project for AArch64 Linux, you'll need the following tools: -- [CMake](https://cmake.org) version 3.16 or newer (3.21 is recommended) -- A recent version of either GCC or LLVM toolchains -- `make` or [Ninja](https://ninja-build.org) +- Either GCC 9.4 or higher, or Clang 10 or higher. +- Binutils +- [CMake](https://cmake.org) 3.16 or higher. +- `make` - `patch` ## Building OpenCV & KleidiCV for AArch64 Linux diff --git a/kleidicv/CMakeLists.txt b/kleidicv/CMakeLists.txt index ddeb924c7..4bef9981c 100644 --- a/kleidicv/CMakeLists.txt +++ b/kleidicv/CMakeLists.txt @@ -30,6 +30,12 @@ option(KLEIDICV_CANNY_ALGORITHM_CONFORM_OPENCV "Internal - If turned ON Canny al set(KLEIDICV_BUILD_SVE2 OFF) if (KLEIDICV_ENABLE_SVE2) check_cxx_compiler_flag("-march=armv8-a+sve2" KLEIDICV_COMPILER_SUPPORTS_SVE2) + + # SVE2 support is incomplete in earlier versions of Clang. + if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12) + set(KLEIDICV_COMPILER_SUPPORTS_SVE2 OFF) + endif() + if (KLEIDICV_COMPILER_SUPPORTS_SVE2) set(KLEIDICV_BUILD_SVE2 ON) else() -- GitLab