Trying to compile an example on Tegra Jetson tk1

#3

By default L4T Rel-19 doesn’t enable the “universe” repo, so I wonder if the install failures are on missing packages? Try running this before installing the dependencies:

$ sudo add-apt-repository universe
#4

Hey , thanks for the reply, yeah I actually ended up doing the same as your suggestion by hacking on libs/openFrameworksCompiled/project/linuxarmv7l/config.linuxarmv7l.default.mk

This doesnt seem like a very good file but it will do for now haha.

#5

PIzthewiz thanks for that I had no idea about this universe repository, it does seem to be finding the packages now! Ill give it a try to build again now and let you know.

#6

Works like a charm , I simply ran ./install_dependencies and reextracted the OF tar.gz to remove all my futzing around in the default.mk and I was able to compile and run 3d/easycamexample without a hitch - much appreciated !

@jvcleave basically after doing the sudo add-apt-repository universe there isnt really anything to do anymore so im happy to report that there arent any special instructions.

1 Like
#7

Installed oF 0.8.1 on my TK1 this morning; for some reason, the package installation scripts missed some of the packages and I was getting build errors. The discussion thread Can't get OF compiled had tips to find missing libraries and just installed them with apt-get.

Have you noticed any trouble with the sound examples? My build is compiling and running, but applications are only playing back noise when they read data from sound-files.

#8

so far I got the 3d/easycam example to work as well as gl/vboexample however gl/shaderexample crashes with segmentation fault , not sure why yet.

I havent tried audio yet.

#9

Yeah, I wondered if the multi-GL support of the Jetson TK1 would confuse things, it appears as though it is:

ubuntu@tegra-ubuntu:~/sandbox/of_v0.8.2-RC1_linuxarmv7l_release$ pkg-config cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gtk+-3.0 libmpg123 glesv1_cm glesv2 egl --exists --print-errors
Package glesv1_cm was not found in the pkg-config search path.
Perhaps you should add the directory containing `glesv1_cm.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glesv1_cm' found
Package glesv2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glesv2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glesv2' found
Package egl was not found in the pkg-config search path.
Perhaps you should add the directory containing `egl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'egl' found

@skimon Did you not have an issue with this, perhaps you compiled from source instead of using a binary release?

#10

I did use a binary release though I didn’t notice those errors- did you get those during install_dependencies.

I think according to the defines in ofConstants.h,

 #elif defined(__ARMEL__)
 	#define TARGET_LINUX
 	#define TARGET_OPENGLES
	#define TARGET_LINUX_ARM

so it seems like OF is assuming all ARM is opengl-es , which i guess half applies for the Jetson tk1.

Im trying to hack it to work for my purposes, if you know how to force it to use OpenGL instead of ES , let me know .

Thanks

#11

using codeblocks i see the crash is in
ofAppGLFWWindow::setupOpenGL:

windowP = glfwCreateWindow(w, h, "", NULL, NULL); 

the call to glfwCreateWindow causes the segmentation fault

#12

@skimon did you ever work out your shader problems? Mine should arrive on Tuesday, I’ll let you know how my experience goes. I’m getting it specifically for a heavy shader low CPU installation.

#13

I didnt. I had to divert to doing some other work but i am going to take another crack at it in a week or teo since i need to port my program to work on this device. Let me know if you get the shader examples to work.

#14

I’m stuck in the same place. Were you ever able to make it past this?

#15

just got mine opened up - will try OF soon

my guess it that it will be like the UDOO where there are specially configured drivers that you won’t want to overwrite

#16

I ran the installer.sh in ~/NVIDIA-INSTALLER and then found these weird locations for what looks to be like OpenGL libs - strange thing is that I can’t find the headers

Here are the search results

#17

Is it because nvidia only releases the binary blob drivers?

#18

I just installed the cuda toolkit (required registration) and I now have the headers - not sure if it installed them or used a package manager underneath the hood - will see

#19

Ok - just installed the examples and these Makefiles should give the correct paths

#20

I have made some progress, but ultimately I have no real understanding of what I’m doing. I installed the cuda toolkit and found those files you reference, but I’m not sure where in the .mk files I should be pointing to those directories.

#21

Which part are you stuck on ? Compiling? Or running gl examples?

#22

I added the universal repo

sudo add-apt-repository universe
sudo ./install_dependencies.sh
sudo ./install_codecs.sh
sudo ./install_codeblocks.sh

I go to compile the empty example.

ubuntu@tegra-ubuntu:~/Desktop/of_v0.8.3_linuxarmv7l_release/examples/empty/emptyExample$ make
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gtk+-3.0 libmpg123 glesv1_cm glesv2 egl 
../../../libs/openFrameworksCompiled/project/makefileCommon/config.shared.mk:260: *** couldn't find some pkg-config packages, did you run the latest install_dependencies.sh?.  Stop.

So I go and edit config.shared.mk to change line 260 to warning

$(warning couldn't find some pkg-config packages, did you run the latest install_dependencies.sh?)

run make again

../../../libs/openFrameworks/utils/ofConstants.h:169:23: fatal error: GLES/gl.h: No such file or directory
   #include "GLES/gl.h"

…the relevant block of ofConstants.h

    #ifdef TARGET_LINUX_ARM
    	#ifdef TARGET_RASPBERRY_PI
        	#include "bcm_host.h"
        #endif
       
		#include "GLES/gl.h"
		#include "GLES/glext.h" 
		#include "GLES2/gl2.h"
		#include "GLES2/gl2ext.h"
		
		#define EGL_EGLEXT_PROTOTYPES
		#include "EGL/egl.h"
		#include "EGL/eglext.h"
    #else // normal linux
        #include <GL/glew.h>
        #include <GL/gl.h>
        #include <GL/glx.h>
    #endif

I installed the CUDA toolkit and the samples compile. Let’s find gl.h, glext.h, gl2.h, and gl2ext.h

/usr/include/GL/gl.h					// mesa driver
/usr/include/GL/glext.h					// mesa driver
/usr/local/cuda-6.0/samples/common/inc/GL/glext.h	// nvidia 

I can’t find gl2.h or gl2ext.h or any of the egl*.h files.

I can find the normal linux files in the cuda directories.

ubuntu@tegra-ubuntu:/usr/local/cuda/samples/common/inc/GL$ ls
freeglut_ext.h  freeglut.h  freeglut_std.h  glew.h  glext.h  glut.h  glxew.h  glxext.h  wglew.h

I can also find the missing packages that the pkgconfig was erroring about.

/usr/lib/arm-linux-gnueabihf/tegra$ ls
ld.so.conf       libnvdc.so                     libnvidia-tls.so.19.2   libnvmm_parser.so    libnvos.so           libnvtvmr.so
libcuda.so       libnvddk_2d_v2.so              libnvmm_camera.so       libnvmm.so           libnvparser.so       libnvwinsys.so
libcuda.so.1     libnvddk_vic.so                libnvmm_contentpipe.so  libnvmm_utils.so     libnvrm_graphics.so  libtegrav4l2.so
libcuda.so.1.1   libnvfusebypass.so             libnvmmlite_audio.so    libnvmm_writer.so    libnvrm.so
libGL.so.1       libnvidia-eglcore.so.19.2      libnvmmlite_image.so    libnvodm_imager.so   libnvsm.so
libjpeg.so       libnvidia-glcore.so.19.2       libnvmmlite.so          libnvodm_query.so    libnvtestio.so
libnvapputil.so  libnvidia-glsi.so.19.2         libnvmmlite_utils.so    libnvomxilclient.so  libnvtestresults.so
libnvavp.so      libnvidia-rmapi-tegra.so.19.2  libnvmmlite_video.so    libnvomx.so          libnvtnr.so

and also

ubuntu@tegra-ubuntu:/usr/lib/arm-linux-gnueabihf/tegra-egl$ ls
ld.so.conf  libEGL.so.1  libGLESv1_CM.so.1  libGLESv2.so.2

I added the tegra-egl directories for the shared object (.so) files to config.linuxarmv7l.default.mk

	PLATFORM_LDFLAGS += -Wl,-rpath-link $(SYSROOT)/usr/lib/arm-linux-gnueabihf/tegra-egl
	PLATFORM_LDFLAGS += -Wl,-rpath-link $(SYSROOT)/usr/lib/arm-linux-gnueabihf/tegra

I don’t know what to do from here. I don’t really care for the EGL functionality, if there was a way to configure OF on ARM to act just like OpenGL4.x linux I would be in heaven.