GLIBC错误:在x86_64(Ubuntu18.04)上针对ARM Cortex A9(Debian 9)交叉编译ARMNN

问题描述 投票:0回答:1

我在x86_64(Ubuntu 18.04)主机系统上为我的ARM Cortex-A9(Debian 9)设备交叉编译了ARMNN。

我已经成功构建了ARMNN及其所有依赖关系,没有任何错误,但是当我尝试在Cortex-A9上运行示例mnist时,它出现以下错误:

duu@34d456-45433g:~/ML-examples/armnn-mnist$ make test
arm-linux-gnueabihf-g++ -O3 -std=c++14 -I/home/duu/armnn/armnn/include mnist_caffe.cpp -o mnist_caffe -L/home/duu/build -larmnn -larmnnCaffeParser
/home/admin/build/libarmnn.so: undefined reference to `exp2f@GLIBC_2.27'
/home/admin/build/libarmnn.so: undefined reference to `logf@GLIBC_2.27'
/home/admin/build/libarmnn.so: undefined reference to `log2f@GLIBC_2.27'
/home/admin/build/libarmnn.so: undefined reference to `powf@GLIBC_2.27'
/home/admin/build/libarmnn.so: undefined reference to `expf@GLIBC_2.27'
collect2: error: ld returned 1 exit status
Makefile:12: recipe for target 'mnist_caffe' failed
make: *** [mnist_caffe] Error 1

我后来发现,该设备应具有相同的编译器和相同的GLIBC软件包,两者的版本应与在其上编译该库的主机相同。

[我在主机上使用gcc-6.4.0和glibc-2.27编译了ARMNN,在Cortex-A9设备上使用了gcc-6.3.0和glibc-2.24。

我设法匹配了GCC版本并解决了编译器错误,但在Ubuntu 18.04和debian 9上找不到匹配的GLIBC版本。

是否有任何方法可以在这两个系统中的任何一个上安装GLIBC版本?

P.S。 :高度赞赏解决此问题的任何其他方法。

makefile cross-compiling ubuntu-18.04 glibc armv7
1个回答
-1
投票

这里是我现在可以想到的可能选项的列表:

  1. LD_LIBRARY_PATH指向包含从x86_64系统复制的arm glibc动态库(v2.27)的目录时运行应用程序-请参阅this post。>
  2. 如果可能,例如,如果目标系统可以使用NFS,则在目标系统上重新编译应用程序,
  3. 交叉编译您的库/应用程序的静态版本,使用-static -static-libgcc -static-libstdc++将其链接-请参见this post。>>
  4. 如果[g0 / g ++和glibc无法使用,请使用arm-linux-musleabihf-cross或他的一个朋友来交叉编译您的库/应用程序的静态版本。
  5. 在包含您在x86_64系统上与应用程序链接的arm动态库的chroot环境中运行应用程序-有关更多详细信息,请参见this post,>
  6. 在您的Cortex-A9系统上安装docker,并使用glibc 2.27以及您的库和应用程序构建包含debian / ubuntu版本的最小debian / ubuntu docker映像,并在容器中执行该应用程序。
© www.soinside.com 2019 - 2024. All rights reserved.