nvdla / sw

NVDLA SW
Other
489 stars 193 forks source link

libprotobuf.a : error adding symbols : Files in wrong format #182

Open Scriabing opened 4 years ago

Scriabing commented 4 years ago

After insmoding opendla.ko correctly , I compile umd by using command as follow. root@xilinx-zcu102-2018_3:/media/umd# make TOOLCHAIN_PREFIX=/usr/bin

for dir in core/src/compiler apps/compiler; do \ make -C $dir; \ done make[1]: Entering directory '/media/umd/core/src/compiler' MODULE_CC gcc make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/media/umd/core/src/compiler' make[1]: Entering directory '/media/umd/apps/compiler' MODULE_CC gcc building /media/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler g++ /media/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler.mod.o -L/media/umd/out/core/src/compiler/libnvdla_compiler libprotobuf.a -lnvdla_compiler -pthread -o /media/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler libprotobuf.a -Wl,-rpath=. /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) /usr/lib/gcc/aarch64-xilinx-linux/7.3.0/../../../../aarch64-xilinx-linux/bin/ld: libprotobuf.a(common.o): Relocations in generic ELF (EM: 62) libprotobuf.a: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status make[1]: *** [Makefile:49: /media/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler] Error 1 make[1]: Leaving directory '/media/umd/apps/compiler' make: *** [Makefile:35: compiler] Error 2

when i readelf sw/umd/core/src/compiler/libprotobuf.a ,the file is related with x86. However, I use Xilinx's board named zcu102 with a53.

I compile protobuf-2.5.0 source code with this board's cross compiler named aarch64-linux-gnu-gcc . But a header file named platform_macro.h in source code reports that Host architecture was not detected as supported by protobuf.

which version of protobuf should I choose? How to get libprotobuf based on arm64? Is this file related with board?

MaxS1996 commented 4 years ago

When you look at your error, you are able to see that the error occurred while you were trying to build the compiler

The compiler is supposed to be executed at a desktop machine with a x86 or x86_64 processor inside. This means you need to compile it for x86 not for arm64

AndiNNT commented 11 months ago

Hello, i have the same issue, did you fix it? @MaxS1996 so what is yur suggestion, to make a cross-compiler form the PC ?

long771 commented 11 months ago

这是来自QQ邮箱的自动回复邮件。 您好,我是龙欣荣,很高兴收到您的邮件,我将尽快处理。

MaxS1996 commented 11 months ago

Hi @AndiNNT, It has been some time since I worked with this, but just do not build the compiler for ARM and you should be fine.

I cannot remember how to only build the other components, but it should be possible.

The Compiler itself is also quite limited, it only supports Caffe as input format, which is outdated and is limited in the supported networks.