Trouble Cross-Compiling VisionWorks-1.2 feature demo tracker, missing libglfw


I’m trying to follow along with the instruction to compile the vision works examples located in the VisionWorks Toolkit Reference -> Linux: Building and Running Samples and Demos.

I’m running into problem compiling the feature_tracker demo for my Jetson TX1 on a x86 machine. I appear to be missing the libglfw library. The compiler output is

x86-ubuntu:~/VisionWorks-1.2-Samples/demos/feature_tracker$ make 
aarch64-linux-gnu-g++ -Wl,--allow-shlib-undefined -pthread -Wl,-rpath=/mnt/jetson/usr/local/cuda-7.0/lib   -O3 -DNDEBUG -std=c++0x -o ../../bin/aarch64/linux/release/nvx_demo_feature_tracker obj/release/feature_tracker.o obj/release/main_feature_tracker.o ../../libs/aarch64/linux/release/libnvxio.a -L"/mnt/jetson/usr/lib" ../../libs/aarch64/linux/release/libnvxio.a -L/mnt/jetson/usr/lib/aarch64-linux-gnu -lfreetype   ../../3rdparty/glfw3/libs/libglfw3.a -L/mnt/jetson/usr/lib/aarch64-linux-gnu -lGL   -L/mnt/jetson/usr/lib/aarch64-linux-gnu -lXrandr -lXi -lXxf86vm -lX11   -L/mnt/jetson/usr/lib/aarch64-linux-gnu -lgstpbutils-1.0 -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0     -L/mnt/jetson/usr/local/cuda-7.0/lib -lcudart   -L/mnt/jetson/usr/lib -L/mnt/jetson/usr/local/cuda-7.0/lib -lvisionworks -lcudart  
/usr/lib/gcc-cross/aarch64-linux-gnu/4.8/../../../../aarch64-linux-gnu/bin/ld: cannot find -lfreetype
/usr/lib/gcc-cross/aarch64-linux-gnu/4.8/../../../../aarch64-linux-gnu/bin/ld: ../../3rdparty/glfw3/libs/libglfw3.a(context.c.o): Relocations in generic ELF (EM: 62)
/usr/lib/gcc-cross/aarch64-linux-gnu/4.8/../../../../aarch64-linux-gnu/bin/ld: ../../3rdparty/glfw3/libs/libglfw3.a(context.c.o): Relocations in generic ELF (EM: 62)
../../3rdparty/glfw3/libs/libglfw3.a: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make: *** [../../bin/aarch64/linux/release/nvx_demo_feature_tracker] Error 1

My configuration is (with /mnt/jetson mounted with sudo sshfs -o allow_other ubuntu@jetsontxip:/ /mnt/jetson):

x86-ubuntu:~/VisionWorks-1.2-Samples/demos/feature_tracker$ export | grep aarch
declare -x AR="aarch64-linux-gnu-ar"
declare -x ARCH="aarch64"
declare -x CC="aarch64-linux-gnu-gcc"
declare -x CPP="aarch64-linux-gnu-cpp"
declare -x CROSS_COMPILE="aarch64-linux-gnu-"
declare -x CXX="aarch64-linux-gnu-g++"
declare -x LD="aarch64-linux-gnu-ld"
declare -x OS_ARCH="aarch64"
declare -x PKG_CONFIG_PATH="/mnt/jetson/usr/lib/aarch64-linux-gnu/pkgconfig:/mnt/jetson/usr/lib/pkgconfig"

I have also copied the /mnt/jetson/usr/lib/arm-linux-gnueabihf/pkgconfig/ files
to /mnt/jetson/usr/lib/aarch64-linux-gnu/pkgconfig/ folder because they were missing. And I modified them to point to the /mnt/jetson/usr/lib/aarch64-linux-gnu/ path.

libglfw is missing from my /mnt/jetson/usr/lib/aarch64-linux-gnu/
folder and I have not been able to find an aarch64 package for libglfw. I’m going to try to cross-compile glfw, but I’m not having any success.

Thanks for your help

I think libglfw3 isn’t available as a package on Ubuntu 14.04, if you’re using that, you’ll either need to compile it or grab it from a repo:

And/or the other possibility is the aarch64 compatibility issue, L4T is 32-bit right now and needs SW to be built accordingly.

As a member of a FRC team, I just got a Jetson TX1 and am trying to learn about this unit. I am a entry level. I just try to learn about a demo program by compiling these programs but I don’t know how find the compiler inside jetson tx1. Please show me how to compile demo program of visionworks. Thank you very much.
Any way to use eclipse to compile these files.
I am sorry for very beginner’s questions. Thanks again for your help.

If you use JetPack to flash from an Ubuntu 14 host, then you can optionally set up nsight edition of eclipse to deal with cross-environment and install several packages. I do not know the specifics, my host is Fedora, so JetPack does not apply. nsight can be set up manually, but there is a lot more to it.