digitalbrain79 / darknet-nnpack

Darknet with NNPACK
Other
306 stars 76 forks source link

-fpic flag - error adding symbols - libnpack.a #31

Open erickga opened 5 years ago

erickga commented 5 years ago

I have this error, any suggestions? /usr/bin/ld: /usr/lib/gcc/arm-linux-gnueabihf/6/../../../libnnpack.a(softmax.c.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/arm-linux-gnueabihf/6/../../../libnnpack.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status Makefile:96: recipe for target 'libdarknet.so' failed

shartoo commented 5 years ago

Got same error as you, did't know how to fix.

shartoo commented 5 years ago

I think this bug may relates with clang version,here is mine:

pi@raspberrypi:~ $ clang -v
clang version 3.8.1-24+rpi1 (tags/RELEASE_381/final)
Target: armv6--linux-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.6
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.6.4
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.7
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.8.5
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.1
Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/6.3.0
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.6
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.6.4
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.7
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.7.3
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.8
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.8.5
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.9
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.9.3
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/5.4.1
Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/6.3.0
Selected GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/6.3.0
Candidate multilib: .;@m32
Selected multilib: .;@m32

i don't know which version did the author used.I tried to downgrade my clang version,but there is only one

pi@raspberrypi:~ $ sudo apt-cache madison  clang
    clang |   1:3.8-36 | http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
erickga commented 5 years ago

I have the same version as you

shartoo commented 5 years ago

@digitalbrain79 What version of clang did you used when compiling this project?We want to try to compile it with your version.

erickga commented 5 years ago

clang version 3.8.1-24+rpi1 (tags/RELEASE_381/final) Target: armv6--linux-gnueabihf Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.6 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.6.4 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.7 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.8 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.8.5 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.1 Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/6.3.0 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.6 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.6.4 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.7 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.7.3 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.8 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.8.5 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.9 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/4.9.3 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/5.4.1 Found candidate GCC installation: /usr/lib/gcc/arm-linux-gnueabihf/6.3.0 Selected GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/6.3.0 Candidate multilib: .;@m32 Selected multilib: .;@m32

erickga commented 5 years ago

for each of the installs - ninja, NNPACk-darknet -> are on the same folder level as darknet-nnpack

Or should darknet-nnpack be inside NNPACK-darknet inside ninja ??

shartoo commented 5 years ago

No it's not nessary ,i did success once when ninja, NNPACk-darknet,darknet-nnpack are below a same parent path workspace(created by my own).