Porting to aarch64


#1

I’d like to try OF on the NVIDIA Jetson TX2. There is an old fork on Github for someone that ported it to the TK1, but that’s a much older version which is not compatible.
The TX2 uses Ubuntu 16.04, but it is using aarch64 architecture. Currently, only armv6l and armv7l is supported in the build.
I edited a bunch of shell scripts and make files to create variants for aarch64, based on grepping for armv7l and editing as appropriate. However, I cannot make the projectGenerator work.

I’ve checked out the “stable” branch from current github.

Interestingly, when I try to re-compile for x86_64, I also get a link error:

/usr/bin/ld: /home/jwatte/pilot/openFrameworks/libs/kiss/lib/linux64/libkiss.a(kiss_fftr.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/jwatte/pilot/openFrameworks/libs/tess2/lib/linux64/libtess2.a(tess.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/jwatte/pilot/openFrameworks/libs/tess2/lib/linux64/libtess2.a(mesh.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/jwatte/pilot/openFrameworks/libs/tess2/lib/linux64/libtess2.a(sweep.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/jwatte/pilot/openFrameworks/libs/tess2/lib/linux64/libtess2.a(dict.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
/home/jwatte/pilot/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:382: recipe for target 'bin/projectGenerator' failed

(This is on Ubuntu 17.04 on x86_64, using GCC 5.4.0)

Please don’t tell me to download a pre-compiled projectGenerator. There isn’t one for aarch64, and the only reason I tried compiling it on x86_64 was to have something to compare against.
So, if I want to make x86_64 actually compile, as a pre-requisite to understanding what I need to do for aarch64, what is the problem here? I tried with adding either of -fPIC, or -static, to the build flags in the projectGenerator commandline Makefile, but neither works. Presumably, I need to make kiss and tess2 compile with -fPIC somehow?


#2

I do not know if this can help you, but I’ve seen this http://www.jetsonhacks.com/2014/08/28/jetson-tk1-running-openframeworks-openkinect/ a while ago


#3

Thanks for the answer!

That link is for an old 32 bit version. The 64 but version (TX2) was released this year.


#4

Any luck with this project Jon?