Git Product home page Git Product logo

Comments (6)

maxmarsc avatar maxmarsc commented on May 28, 2024 1

Ok, so assuming you downloaded and extracted the toolchain under /tmp/aarch64-none-linux-gnu-11.3.rel1

Then the toolchain file would be :
Toolchain.cmake

# targets
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(triple aarch64-linux-gnu)

# misc settings
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
set(GNU_ROOT "/tmp/aarch64-none-linux-gnu-11.3.rel1")
set(CMAKE_SYSROOT "${GNU_ROOT}/aarch64-none-linux-gnu/libc")

# find paths
set(CMAKE_FIND_ROOT_PATH "${GNU_ROOT}")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)

# compiler settings
set(CMAKE_C_COMPILER "${GNU_ROOT}/bin/aarch64-none-linux-gnu-gcc" CACHE INTERNAL "")
set(CMAKE_CXX_COMPILER "${GNU_ROOT}/bin/aarch64-none-linux-gnu-g++" CACHE INTERNAL "")

set(CMAKE_C_COMPILER_TARGET ${triple})
set(CMAKE_CXX_COMPILER_TARGET ${triple})

set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "${GNU_ROOT}/lib/gcc")
set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "${GNU_ROOT}/lib/gcc")

# CPU tuning : the RPI 0 2W uses a Cortex a53
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mtune=cortex-a53" CACHE STRING "")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=cortex-a53" CACHE STRING "")

# Qemu emulation setup
set(CMAKE_CROSSCOMPILING_EMULATOR "qemu-aarch64-static;-L;${CMAKE_SYSROOT}" CACHE FILEPATH "Path to the emulator for the target system.")

# Include settings
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES
  ${GNU_ROOT}/aarch64-none-linux-gnu/include/c++/11.3.1
  ${GNU_ROOT}/aarch64-none-linux-gnu/libc/usr/include
  ${GNU_ROOT}/include
  ${GNU_ROOT}/aarch64-none-linux-gnu/include/c++/11.3.1/aarch64-none-linux-gnu
  ${GNU_ROOT}/lib/gcc/aarch64-none-linux-gnu/11.3.1/include
)

set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES
  ${GNU_ROOT}/aarch64-none-linux-gnu/libc/usr/include
)

Then, to actually reproduce the issue I found out that ArmCL is not even needed, the simplest cmake configuration I found to reproduce was :

git clone [email protected]:ARM-software/armnn.git && cd armnn
git checkout v23.05
cmake -B build -DCMAKE_TOOLCHAIN_FILE=Toolchain.cmake  -DBUILD_SHARED_LIBS=OFF .
cmake --build build -j"$(ncpus)" --config Release

(you can simply replace $(ncpus) with the number of threads you want to use)

Hope this helps !

from armnn.

davmon01 avatar davmon01 commented on May 28, 2024

Hey maxmarsc,

Sorry for the delay on responding to this. Normally our preference in these situations is to split the functions off into their own .cpp file. However since this is only used in two places, and one of them is tests, just declaring them as inline is probably a simpler and easier solution. I'll add a patch for it later, but I wanted to ask some questions about how you're building this as we are not seeing the same errors on our end.

Are you including the Ref or OpenCL backends or is it just Neon?
I'm assuming this is cross compilation on an x86 system?
Are you using the build tool or compiling everything manually yourself? (https://github.com/ARM-software/armnn/blob/branches/armnn_23_05/build-tool/README.md)

from armnn.

davmon01 avatar davmon01 commented on May 28, 2024

https://review.mlplatform.org/c/ml/armnn/+/9867

from armnn.

maxmarsc avatar maxmarsc commented on May 28, 2024

Hello davmon,

No worries, things takes time. Thanks for the answer !

  • I don't think I used either OpenCL or Ref, but ArmCL.
  • Yes this is cross compilation on x86_64 host system, here is the exact toolchain I used
  • I'm not using the build tool, but cmake directly as I needed to integrate armnn inside an existing cmake project, and I think it provied better integration and control (using CMake's ExternalProject feature). The only cmake flag I didn't mentioned in the issue was the CMAKE_TOOLCHAIN_FILE which I can provide if you want.

from armnn.

davmon01 avatar davmon01 commented on May 28, 2024

Yes, please send it on if you don't mind. I added a patch making them inline, which is linked in the comment above. But it would still be good to replicate it so we can close off any gaps in our testing. :)

from armnn.

davmon01 avatar davmon01 commented on May 28, 2024

Closing this off for now as a patch to fix the issue has been merged. If the issue reoccurs feel free to reopen the ticket. :)

from armnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.