I have a (Cuda) video application based on a library that compiles, links, and runs fine on a Dell/Ubuntu/A5000 system, with Cuda 12.1.
When building the same code, i.e. the library, on a freshly flashed Jetson Xavier with JetPak 511, it compiles fine, but the link phase fails with a lot of “undefined reference to xxx@GLIC_yyy” where xxx in: memset, strncpy, __stack_chk_fail, … , and yyy in: 2.4, 2.2.5, etc.:
/usr/bin/ld: PTGDE.o: in function CUDA::resetBuffers(PTGDE_PARAMETER&) [clone .isra.0]': PTGDE.cpp:(.text+0x76c): undefined reference to __stack_chk_fail@GLIBC_2.4’
/usr/bin/ld: PTGDE.o: in function PTGDE_resetBuffers': PTGDE.cpp:(.text+0x84c): undefined reference to memset@GLIBC_2.2.5’
/usr/bin/ld: PTGDE.cpp:(.text+0x8b8): undefined reference to memset@GLIBC_2.2.5' /usr/bin/ld: PTGDE.cpp:(.text+0x118c): undefined reference to __stack_chk_fail@GLIBC_2.4’
/usr/bin/ld: PTGDE.o: in function PTGDE_createParameter': PTGDE.cpp:(.text+0x1488): undefined reference to strncpy@GLIBC_2.2.5’
Any pointers towards the reason for this and a solution would be greatly appreciated.
I flashed JP511 onto the microSD, started, and then I cloned, built and installed opencv and contrib 4.5.5.
Also, not a Makefile/compile expert, just want to get to a point where I can run our library+app and start analyzing and improve the GPU performance and efficiency for our code.
ThX for that response! Looking at our code I did find something that seems to indicate some Glibc “symbol versioning” that I was not aware of. Our code includes an include file with ~3700 statements like this one:
I am assuming this means that our code is requesting to be linked with the 2.4 version of “__stack_chk_fail()”, presumably an older version?
I have no experience with this but I now have something to study.
Next questions:
Why does this not happen on a Dell laptop+GPU with regular ubuntu 20.04 running the same code? Except that the cuda tool kit is the newest. Is this an Arm vs x64 issue?
Do you have any pointers to any documentation that I can read to learn what I have to do to accomplish this on the Jetson?
Is this versioning necessary? Are there functional differences between an older and a newer version of Glibc routines? Such as the one above, or strncpy()? I would think that any version has to behave exactly according to the good old man page?
1. A possible reason is that the default GLIBC version is different.
Is it possible to get the version of the desktop in the compiling log?
2. Unfortunately we don’t have a doc for this since GLIBC is a third-party library.
3. A common cause is some API change between versions which causes some incompatible errors.
JetPack 5.1.1 is also Ubuntu 20.04. Maybe you can try to upgrade the CUDA lib to 12 to align all the package versions as desktop.