luxonis / depthai

DepthAI Python API utilities, examples, and tutorials.
https://docs.luxonis.com
MIT License
938 stars 232 forks source link

[BUG] Relocation error #1196

Closed flabrosse closed 3 months ago

flabrosse commented 3 months ago

I am trying to compile the latest version of depthai_core (from github, today, 13/08/2024) and at linking time I get a lot of:

[ 97%] Linking CXX shared library libdepthai-core.so                                                                                                                       
/usr/bin/ld: /home/cranc/.hunter/_Base/16cc954/2d32323/d8f4da9/Install/lib/libXLink.a(PlatformDeviceFd.cpp.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZNSt1
3unordered_mapImPvSt4hashImESt8equal_toImESaISt4pairIKmS0_EEED1Ev' which may bind externally can not be used when making a shared object; recompile with -fPIC             
/home/cranc/.hunter/_Base/16cc954/2d32323/d8f4da9/Install/lib/libXLink.a(PlatformDeviceFd.cpp.o): in function `_GLOBAL__sub_I_getPlatformDeviceFdFromKey':                 
PlatformDeviceFd.cpp:(.text.startup+0x28): dangerous relocation: unsupported relocation                                                                                    
/usr/bin/ld: /home/cranc/.hunter/_Base/16cc954/2d32323/d8f4da9/Install/lib/libXLink.a(usb_host.cpp.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `mvLogLevel_xLi
nkUsb' which may bind externally can not be used when making a shared object; recompile with -fPIC

I didn't use the script (as I like seeing what is going on given how long it takes to compile) but replicated the same instructions.

This is on ubuntu 22.04 on a Raspberry Pi 4.

flabrosse commented 3 months ago

Clearly, using the standard

mkdir build
cd build
cmake ..
make
make install

is not quite equivalent to what the script does. I just did a verbatim copy of the script and it worked. Not sure I understand, but it complied, linked and installed.