huawei-noah / bolt

Bolt is a deep learning library with high performance and heterogeneous flexibility.
https://huawei-noah.github.io/bolt/
MIT License
910 stars 158 forks source link

error adding symbols: file in wrong format #6

Closed Cord3th closed 4 years ago

Cord3th commented 4 years ago

Hello, compiling with your instructions (using cross compile) I face this problem. How can I solve it?

[ 74%] Linking CXX executable ../../../image/bin/test_image_processing
/home/<user>/Downloads/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: ../../../image/dependency/png/lib/libpng.a(png.o): Relocations in generic ELF (EM: 62)
/home/<user>/Downloads/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: ../../../image/dependency/png/lib/libpng.a(png.o): Relocations in generic ELF (EM: 62)
/home/<user>/Downloads/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: ../../../image/dependency/png/lib/libpng.a(png.o): Relocations in generic ELF (EM: 62)
/home/<user>/Downloads/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/8.3.0/../../../../aarch64-linux-gnu/bin/ld: ../../../image/dependency/png/lib/libpng.a: error adding symbols: file in wrong format
yuxianzhi commented 4 years ago

Please check whether you have used same compiler aarch64-linux-gnu-gcc to compile bolt and png. you can use readelf tool to check the library.

You need to add following variables before compiling png.

export PATH=<directory to aarch64-linux-gnu-gcc>/bin:$PATH
export CC=aarch64-linux-gnu-gcc
export CXX=aarch64-linux-gnu-g++ 
Cord3th commented 4 years ago

@yuxianzhi, thanks for your reply. Recompiled all the libs with aarch64-linux-gnu-gcc, but still getting the same error.

Cord3th commented 4 years ago

@yuxianzhi nevermind, now I'm getting error: `imTrans.c:56:10: fatal error: X11/Xatom.h: No such file or directory

include <X11/Xatom.h>

` and similar. Do I need to link X11 from /usr/include to aarch64-linux-gnu-gcc somehow? By the way, there is no configure file in libxau, libxcb and libx11, @jianfeifeng, edit build_dependency.sh in bolt/image, please.