Trying to build xnnpack/20231026 for android using ndk 21 results in a build error.
clang: error: the clang compiler does not support '-march=armv8.2-a+i8mm'
[12/507] Building C object CMakeFiles/microkernels-prod.dir/src/amalgam/gen/neon.c.o
ninja: build stopped: subcommand failed.
I found the issue and is due to the 8-bit integer matrix multiplication. For older CLang XNNPACK_ENABLE_ARM_I8MM cmake settings should be set to False.
Description
Trying to build xnnpack/20231026 for android using ndk 21 results in a build error.
Package and Environment Details
Conan profile
======== Input profiles ======== Profile host: [settings] arch=armv8 build_type=Debug compiler=clang compiler.cppstd=17 compiler.libcxx=c++_static compiler.version=9 os=Android os.api_level=30 [tool_requires] *: ninja/1.11.1, cmake/3.28.1, android-ndk/r21e [conf] tools.cmake.cmaketoolchain:generator=Ninja tools.env.virtualenv:powershell=False
Profile build: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=20 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows [conf] tools.cmake.cmaketoolchain:generator=Ninja tools.env.virtualenv:powershell=False
Steps to reproduce
From the conan center index:
Logs
Click to expand log
``` ======== Exporting recipe to the cache ======== xnnpack/cci.20231026: Calling export_sources() xnnpack/cci.20231026: Exported: xnnpack/cci.20231026#f0cec1e9189c3a3e99999e2e616b37d1 (2024-08-14 12:56:19 UTC) ======== Exporting recipe to the cache ======== xnnpack/cci.20231026: Exporting package recipe: C:\xrsw\repos\conan-center-index\recipes\xnnpack\all\conanfile.py xnnpack/cci.20231026: exports: File 'conandata.yml' found. Exporting it... xnnpack/cci.20231026: Calling export_sources() xnnpack/cci.20231026: Copied 1 '.yml' file: conandata.yml xnnpack/cci.20231026: Copied 1 '.py' file: conanfile.py xnnpack/cci.20231026: Copied 1 '.cmake' file: xnnpack_project_include.cmake xnnpack/cci.20231026: Exported to cache folder: C:\Users\edukaj\.conan2\p\xnnpa58942605412c0\e xnnpack/cci.20231026: Exported: xnnpack/cci.20231026#f0cec1e9189c3a3e99999e2e616b37d1 (2024-08-14 12:56:20 UTC) ======== Input profiles ======== Profile host: [settings] arch=armv8 build_type=Debug compiler=clang compiler.cppstd=17 compiler.libcxx=c++_static compiler.version=9 os=Android os.api_level=30 [tool_requires] *: ninja/1.11.1, cmake/3.28.1, android-ndk/r21e [conf] tools.cmake.cmaketoolchain:generator=Ninja tools.env.virtualenv:powershell=False Profile build: [settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=20 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=193 os=Windows [conf] tools.cmake.cmaketoolchain:generator=Ninja tools.env.virtualenv:powershell=False ======== Computing dependency graph ======== Graph root cli Requirements cpuinfo/cci.20231129#c940e224f068f5f19869d84072463c2c - Cache fp16/cci.20210320#13aae98dcd66c84ab25d0628556a575b - Cache fxdiv/cci.20200417#cd81cfae19f7e26153aad6323f53bb89 - Cache psimd/cci.20200517#908388f0bd93822af8be832c6dfd0622 - Cache pthreadpool/cci.20231129#b402cd193ba5a173c67a893312fc24d7 - Cache xnnpack/cci.20231026#f0cec1e9189c3a3e99999e2e616b37d1 - Cache Build requirements android-ndk/r21e#2bce776b9310802642f0bdada0e3e5a6 - Cache cmake/3.28.1#a3ac6f074d14bbc2ef2c080e40833e2e - Cache ninja/1.11.1#cd30ca226f2040a979c359ebca4817d5 - Cache ======== Computing necessary packages ======== Requirements cpuinfo/cci.20231129#c940e224f068f5f19869d84072463c2c:2dc06c01d8d7be13801023964975c46ca61f5747#ee62839e3719c8bf1066773c29626d12 - Cache fp16/cci.20210320#13aae98dcd66c84ab25d0628556a575b:da39a3ee5e6b4b0d3255bfef95601890afd80709#b7ab18bd2ee17d82530f93d190f36156 - Cache fxdiv/cci.20200417#cd81cfae19f7e26153aad6323f53bb89:da39a3ee5e6b4b0d3255bfef95601890afd80709#99822879bdd86a69aa08623a42893b48 - Cache psimd/cci.20200517#908388f0bd93822af8be832c6dfd0622:da39a3ee5e6b4b0d3255bfef95601890afd80709#d8c3d8d76275b4c8abf8ee833e49cae5 - Cache pthreadpool/cci.20231129#b402cd193ba5a173c67a893312fc24d7:5b8c8076ee549bd985b930caa9997c53f0f49cdb#b0c14c4ff9fea951a3b71010b938cc2f - Cache xnnpack/cci.20231026#f0cec1e9189c3a3e99999e2e616b37d1:b68bfca3e9d1b0797c101e9bab8f9cf649aa9ee7 - Build Build requirements android-ndk/r21e#2bce776b9310802642f0bdada0e3e5a6:522dcea5982a3f8a5b624c16477e47195da2f84f#287143c6d5b4ab57a3d8dff4134c649b - Cache cmake/3.28.1#a3ac6f074d14bbc2ef2c080e40833e2e:522dcea5982a3f8a5b624c16477e47195da2f84f#29e6903b5006c2b2f81003c9ebf7551b - Cache ninja/1.11.1#cd30ca226f2040a979c359ebca4817d5:723257509aee8a72faf021920c2874abc738e029#1a592c653c6d8742bf921f77d92580f4 - Cache ======== Installing packages ======== android-ndk/r21e: Already installed! (1 of 9) cmake/3.28.1: Already installed! (2 of 9) cmake/3.28.1: Appending PATH environment variable: C:\Users\edukaj\.conan2\p\cmakee8c7c8f298435\p\bin cmake/3.28.1: Appending PATH environment variable: C:\Users\edukaj\.conan2\p\cmakee8c7c8f298435\p\bin ninja/1.11.1: Already installed! (3 of 9) cpuinfo/cci.20231129: Already installed! (4 of 9) fxdiv/cci.20200417: Already installed! (5 of 9) psimd/cci.20200517: Already installed! (6 of 9) fp16/cci.20210320: Already installed! (7 of 9) pthreadpool/cci.20231129: Already installed! (8 of 9) -------- Installing package xnnpack/cci.20231026 (9 of 9) -------- xnnpack/cci.20231026: Building from source xnnpack/cci.20231026: Package xnnpack/cci.20231026:b68bfca3e9d1b0797c101e9bab8f9cf649aa9ee7 xnnpack/cci.20231026: Copying sources to build folder xnnpack/cci.20231026: Building your package in C:\Users\edukaj\.conan2\p\b\xnnpaa6d5fdce539be\b xnnpack/cci.20231026: Calling generate() xnnpack/cci.20231026: Generators folder: C:\Users\edukaj\.conan2\p\b\xnnpaa6d5fdce539be\b\build\Debug\generators xnnpack/cci.20231026: CMakeToolchain generated: conan_toolchain.cmake xnnpack/cci.20231026: CMakeToolchain generated: C:\Users\edukaj\.conan2\p\b\xnnpaa6d5fdce539be\b\build\Debug\generators\CMakePresets.json xnnpack/cci.20231026: CMakeToolchain generated: C:\Users\edukaj\.conan2\p\b\xnnpaa6d5fdce539be\b\src\CMakeUserPresets.json xnnpack/cci.20231026: CMakeDeps necessary find_package() and targets for your CMakeLists.txt find_package(cpuinfo) find_package(fp16) find_package(pthreadpool) find_package(fxdiv) target_link_libraries(... cpuinfo fp16 pthreadpool fxdiv) xnnpack/cci.20231026: Generating aggregated env files xnnpack/cci.20231026: Generated aggregated env files: ['conanbuild.bat', 'conanrun.sh'] xnnpack/cci.20231026: Calling build() xnnpack/cci.20231026: Running CMake.configure() xnnpack/cci.20231026: RUN: cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/edukaj/.conan2/p/b/xnnpaa6d5fdce539be/p" -DXNNPACK_LIBRARY_TYPE="static" -DCMAKE_PROJECT_XNNPACK_INCLUDE="C:\Users\edukaj\.conan2\p\b\xnnpaa6d5fdce539be\b\src\xnnpack_project_include.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Debug" "C:/Users/edukaj/.conan2/p/b/xnnpaa6d5fdce539be/b/src" -- Using Conan toolchain: C:/Users/edukaj/.conan2/p/b/xnnpaa6d5fdce539be/b/build/Debug/generators/conan_toolchain.cmake -- Conan toolchain: Setting CMAKE_POSITION_INDEPENDENT_CODE=ON (options.fPIC) -- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF -- The ASM compiler identification is Clang with GNU-like command-line -- Found assembler: C:/Users/edukaj/.conan2/p/androd0d7aa1bd8aac/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Users/edukaj/.conan2/p/androd0d7aa1bd8aac/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Users/edukaj/.conan2/p/androd0d7aa1bd8aac/p/bin/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Conan: Component target declared 'cpuinfo::cpuinfo' -- Conan: Target declared 'cpuinfo' -- Conan: Target declared 'pthreadpool' -- Conan: Target declared 'fxdiv' -- Conan: Target declared 'fp16' -- Conan: Target declared 'psimd::psimd' -- Configuring done (3.5s) -- Generating done (0.9s) -- Build files have been written to: C:/Users/edukaj/.conan2/p/b/xnnpaa6d5fdce539be/b/build/Debug xnnpack/cci.20231026: Running CMake.build() xnnpack/cci.20231026: RUN: cmake --build "C:\Users\edukaj\.conan2\p\b\xnnpaa6d5fdce539be\b\build\Debug" --target XNNPACK -- -j8 [5/507] Building C object CMakeFiles/microkernels-prod.dir/src/amalgam/gen/neoni8mm.c.o FAILED: CMakeFiles/microkernels-prod.dir/src/amalgam/gen/neoni8mm.c.o C:\Users\edukaj\.conan2\p\androd0d7aa1bd8aac\p\bin\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=aarch64-none-linux-android30 --gcc-toolchain=C:/Users/edukaj/.conan2/p/androd0d7aa1bd8aac/p/bin/toolchains/llvm/prebuilt/windows-x86 _64 --sysroot=C:/Users/edukaj/.conan2/p/androd0d7aa1bd8aac/p/bin/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DXNN_ENABLE_ARM_BF16=1 -DXNN_ENABLE_ARM_DOTPROD=1 -DXNN_ENABLE_ARM_FP16_SCALAR=1 -DXNN_ENABLE_ARM_FP16_VECTOR=1 -DXNN_ENABLE_ARM_I8M M=1 -DXNN_ENABLE_ASSEMBLY=1 -DXNN_ENABLE_CPUINFO=1 -DXNN_ENABLE_DWCONV_MULTIPASS=0 -DXNN_ENABLE_GEMM_M_SPECIALIZATION=1 -DXNN_ENABLE_JIT=0 -DXNN_ENABLE_MEMOPT=1 -DXNN_ENABLE_RISCV_VECTOR=1 -DXNN_ENABLE_SPARSE=1 -D_DEFAULT_SOURCE -IC:/Users/edukaj /.conan2/p/b/xnnpaa6d5fdce539be/b/src/src -isystem C:/Users/edukaj/.conan2/p/b/pthrecea92541d246e/p/include -isystem C:/Users/edukaj/.conan2/p/b/fxdiv44daeb6abc066/p/include -isystem C:/Users/edukaj/.conan2/p/b/fp165fe02b4e36381/p/include -isyste m C:/Users/edukaj/.conan2/p/b/psimdb5c9de09b5b17/p/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -O0 -fno-limit-debug -info -std=c99 -fPIC -march=armv8.2-a+i8mm -MD -MT CMakeFiles/microkernels-prod.dir/src/amalgam/gen/neoni8mm.c.o -MF CMakeFiles\microkernels-prod.dir\src\amalgam\gen\neoni8mm.c.o.d -o CMakeFiles/microkernels-prod.dir/src/amalgam/gen/neoni8mm.c.o -c C:/Users/edukaj/.conan2/p/b/xnnpaa6d5fdce539be/b/src/src/amalgam/gen/neoni8mm.c clang: error: the clang compiler does not support '-march=armv8.2-a+i8mm' [12/507] Building C object CMakeFiles/microkernels-prod.dir/src/amalgam/gen/neon.c.o ninja: build stopped: subcommand failed. xnnpack/cci.20231026: ERROR: Package 'b68bfca3e9d1b0797c101e9bab8f9cf649aa9ee7' build failed xnnpack/cci.20231026: WARN: Build folder C:\Users\edukaj\.conan2\p\b\xnnpaa6d5fdce539be\b\build\Debug ERROR: xnnpack/cci.20231026: Error in build() method, line 138 cmake.build(target="XNNPACK") ConanException: Error 1 while executing ```