benchmark icon indicating copy to clipboard operation
benchmark copied to clipboard

Help wanted: Build support for Aarch64

Open ganeshmarkandan opened this issue 3 years ago • 4 comments

Hi,

This is a simple question.

I would like to use this tool for aarch64 for linux (to be used in RasPi). I am currently using aarch64-linux-gnu-g++-8 compiler. I would like to know the steps or procedure for cross compilation of this package.

ganeshmarkandan avatar Jul 13 '21 08:07 ganeshmarkandan

we don't do anything special so something like http://amgaera.github.io/blog/2014/04/10/cross-compiling-for-raspberry-pi-on-64-bit-linux/ should work.

let us know if it doesn't.

dmah42 avatar Jul 13 '21 10:07 dmah42

we don't do anything special so something like http://amgaera.github.io/blog/2014/04/10/cross-compiling-for-raspberry-pi-on-64-bit-linux/ should work.

let us know if it doesn't.

I do the following inside build. mkdir build cmake -E chdir "build" cmake -DCMAKE_BUILD_TYPE=Release ../ -D CMAKE_CXX_COMPILER=aarch64-linux-gnu-g++-8 -DHAVE_POSIX_REGEX=1 cmake --build "build" --config Release .

The build is successfull. however when I try to run the sample program. I get the below issue.

/home/gmarkandan/neon/./benchmark/build/src/libbenchmark.a(benchmark_runner.cc.o): In function benchmark::internal::BenchmarkRunner::DoNIterations()': benchmark_runner.cc:(.text+0x11e8): undefined reference to pthread_create' benchmark_runner.cc:(.text+0x11f8): undefined reference to `pthread_create' .

So I update my CMakeLists.Txt with (my application)

target_link_libraries(${PROJECT_NAME} Threads::Threads).

Now the application build is successful but the binary file throws an std::system error while executed

Running ./NeonOptimizations Run on (2 X 2592 MHz CPU s) CPU Caches: L1 Data 32 KiB (x2) L1 Instruction 32 KiB (x2) L2 Unified 256 KiB (x2) L3 Unified 9216 KiB (x2) Load Average: 0.51, 0.24, 0.19 terminate called after throwing an instance of 'std::system_error' what(): Unknown error 6243640

Do you have a suggestion on how to resolve this?Also let me know if you require any files from my side

ganeshmarkandan avatar Jul 13 '21 10:07 ganeshmarkandan

can you (or anyone) build a debug version and run under debugger?

i have tried, but my RPis are all armv7

dmah42 avatar Jan 13 '22 14:01 dmah42

@ganeshmarkandan I'm cross-compiling google/benchmark for armv8a/neon (from either Windows or Linux) with Android NDK-26, runs with no issues, but I'm using clang-llvm (better SIMD code gen). I do have GCC4.9 in MSVC's NDK-26 if that helps, but yeah, better build and run with remote debug to see what's going on.

yzazik avatar Feb 13 '22 07:02 yzazik