Imagination PowerVR SDK Blog

Building Sample PVRShell Program


#1

Hi. I am trying to build a sample program given in Examples folder in the SDK but I can’t find any makefile or configure file. Can anyone tell me how can I build any sample program from its code ?


#2

Hello



in the documentation sdk , InstallationSection.html page describe everything !!!



regards

david


#3

Thanks for the reply. But I have a doubt in the very first step.

"Define the TOOLCHAIN environment variable to the toolchain directory, or add the path to the toolchain to the PATH environment variable (i.e. run export PATH=“path to the toolchain:$PATH”)."

What is a TOOLCHAIN and where can I find it ? Sorry for the silly doubt but I am new to all this.


#4

that is cool that you start by using this wonderfull SDK .

by my side :

export PATH=/home/dgu/2015sdk/SDK_3.1:$PATH

make PLATFORM=Linux_x86_32 X11BUILD=1



and everything compile and run





g++ -c -DBUILD_OGLES2 -DRELEASE -O2 -m32 -march=i686 -I/home/dgu/2015sdk/SDK_3.1/Builds/Include -I/home/dgu/2015sdk/SDK_3.1/Shell -I/home/dgu/2015sdk/SDK_3.1/Shell/API/KEGL -I/home/dgu/2015sdk/SDK_3.1/Shell/OS/LinuxX11 -I/home/dgu/2015sdk/SDK_3.1/Tools/OGLES2 -I/usr/include/X11/include /home/dgu/2015sdk/SDK_3.1/Shell/OS/LinuxX11/PVRShellOS.cpp -o…/Linux_x86_32/ReleaseX11/PVRShellOS.o

g++ -o …/Linux_x86_32/ReleaseX11/OGLES2AlphaTest …/Linux_x86_32/ReleaseX11/OGLES2AlphaTest.o …/Linux_x86_32/ReleaseX11/TexFragShader.o …/Linux_x86_32/ReleaseX11/DiscardFragShader.o …/Linux_x86_32/ReleaseX11/VertShader.o …/Linux_x86_32/ReleaseX11/Wallwire.o …/Linux_x86_32/ReleaseX11/PVRShell.o …/Linux_x86_32/ReleaseX11/PVRShellAPI.o …/Linux_x86_32/ReleaseX11/PVRShellOS.o -m32 -L/usr/include/X11/lib -lX11 -lXau -lGLESv2 -lEGL -L/home/dgu/2015sdk/SDK_3.1/Tools/OGLES2/Build/LinuxGeneric/…/Linux_x86_32/ReleaseX11 -logles2tools -L"/home/dgu/2015sdk/SDK_3.1/Builds/Linux/x86_32/Lib" -Wl,–rpath-link,"/home/dgu/2015sdk/SDK_3.1/Builds/Linux/x86_32/Lib"



i am using codelite under linux as well , you can copy the shell classes in your project and setting include directoy and linking information as well , it s then fast to setup your project.



Its really a matter of taste and opinion about preferences :slight_smile:


#5

I have some more doubts. I 'll list them all :


  1. You did a X11 build, then why didn’t you perform the second step i.e. “export X11ROOT=/usr/X11R6_SGX”.


  2. According to your first command, is the location of the toolchain the SDK_3.1 directory present in the Imagination SDK installation folder i.e. (C:ImaginationPowerVRGraphicsSDKSDK_3.1) ?


  3. According to your machine, the first line printed after doing make has -march=i686 -I toolchain-directory/Builds/Include… But I set my toolchain directory as /usr/ig86-pc-cygwin/bin and after doing make, my first line which is printed contains :

    -march=i686 -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Include…



    g++ -DBUILD_OGLES2 -DRELEASE -O2 -m32 -march=i686 -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Include -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Shell -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Shell/API/KEGL -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Shell/OS/LinuxX11 -I/usr/X11R6_SGX/include -MF"…/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell.d" -MG -MM -MP -MT"…/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell.d" -MT"…/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell.o" "…/…/OGLES2IntroducingPVRShell.cpp"

    g++ -c -DBUILD_OGLES2 -DRELEASE -O2 -m32 -march=i686 -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Include -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Shell -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Shell/API/KEGL -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Shell/OS/LinuxX11 -I/usr/X11R6_SGX/include …/…/OGLES2IntroducingPVRShell.cpp -o…/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell.o


  4. I also perform the second step i.e. “export X11ROOT=/usr/X11R6_SGX”. My make finally fails and throws the error : ld cannot find -lGLESv2



    g++ -o …/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell …/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell.o …/Linux_x86_32/ReleaseX11/PVRShell.o …/Linux_x86_32/ReleaseX11/PVRShellAPI.o …/Linux_x86_32/ReleaseX11/PVRShellOS.o -m32 -L/usr/X11R6_SGX/lib -lX11 -lXau -lGLESv2 -lEGL -L"/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib" -Wl,–rpath-link,"/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib"

    …/…/…/…/…/…/Builds/Linux/make_example.mak:46: recipe for target `…/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell’ failed



    I set my LD_LIBRARY_PATH variable to contain the directory containing the libGLESv2.so file in the Builds folder in the SDK but nothing happens.





    Can you please tell where am I going wrong ?

    Thanks.

#6

hi,

i use of course Linux Ubuntu :slight_smile:



if your are using window why not use visual studio ?



about your question

1/ it s already in my path and my gnu toolchain as well.

are you able to compile ?



about step 4

set YOUR LIBRARYPATH in my case :/home/dgu/2015sdk/SDK_3.1/Builds/Linux/x86_32/Lib

export LD_LIBRARY_PATH=YOUR LIBRARYPATH into /etc/bash.profile



kind regards

david


#7

Yes, I am able to compile and generate the following files :



OGLES2IntroducingPVRShell.d

OGLES2IntroducingPVRShell.o

PVRShell.d

PVRShell.o

PVRShellAPI.d

PVRShellAPI.o

PVRShellOS.d

PVRShellOS.o



But the final linking step to create an executable fails.



I exported LD_LIBRARY_PATH to /etc/profile but still it cannot find libGLESv2.so



Is it due to because I did export X11ROOT=/usr/X11R6_SGX and after make PLATFORM=Linux_x86_32 X11BUILD=1 , it searches for “GLESv2” in /usr/X11R6_SGX/lib and when I do “ls” in /usr, I don’t see any “X11R6_SGX” directory.



g++ -o …/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell …/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell.o …/Linux_x86_32/ReleaseX11/PVRShell.o …/Linux_x86_32/ReleaseX11/PVRShellAPI.o …/Linux_x86_32/ReleaseX11/PVRShellOS.o -m32 -L/usr/X11R6_SGX/lib -lX11 -lXau -lGLESv2 -lEGL -L"/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib" -Wl,–rpath-link,"/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib"

…/…/…/…/…/…/Builds/Linux/make_example.mak:46: recipe for target `…/Linux_x86_32/ReleaseX11/OGLES2IntroducingPVRShell’ failed



Do I also need to include /cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1ToolsOGLES2/Build/Linux_x86_32/ReleaseX11/libogles2tools.a

to any library path ?



I will finally be running the application on a PandaBoard.


#8

Hello



i see,

yes include this lib as well

the mandatory lib under linux X11 ARE :

GLESv2;EGL;X11



the /usr/X11R6_SGX given in the doc are just a sample. i do not have this directoy, maybe this should be removed because it s not clear.



#9

Nothing happened even after including the path of libogles2tools.a to LD_LIBRARY_PATH and LIB_PATH. is there something else that I am missing ?


#10

if the library is in the ld path then this error should not happend , it s seems that the ld path is wrong .

You mention that -L/usr/X11R6_SGX/lib doesnt exist in your machine , then you should remove it.

the directory you mention is then wrong .

some helper

http://www.gnu.org/software/libtool/


#11

I had removed X11R6_SGX. Now, the X11ROOT is /usr .


#12

does it work for you ? you should be very close now


#13

No, it didn’t .


#14

what is the error then ?

does it compile ?


#15

your Ld path should contain where the lib are with correct path.


#16

export X11ROOT=/usr/include/X11



make PLATFORM=Linux_x86_32 X11BUILD=1



and it work for me


#17

It compiles. Thats how I get all the .o’s and .d’s.



The above commands didn’t work for me. What I keep on getting is this :



/usr/lib/gcc/i686-pc-cygwin/4.5.3/…/…/…/…/i686-pc-cygwin/bin/ld: cannot find -lGLESv2


#18

Did you add the path linking to the library DIRECTORY after the -L ??


#19

I added the path in the /etc/profile as :



LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib

export LD_LIBRARY_PATH



LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Tools/OGLES2/Build/Linux_x86_32/ReleaseX11/

export LD_LIBRARY_PATH



LIB_PATH=$LIB_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Tools/OGLES2/Build/Linux_x86_32/ReleaseX11/

export LIB_PATH


#20

LD_LIBRARY_PATH is wrong

I added the path in the /etc/profile as :



LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Builds/Linux/x86_32/Lib

export LD_LIBRARY_PATH



LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Tools/OGLES2/Build/Linux_x86_32/ReleaseX11/

export LD_LIBRARY_PATH



LIB_PATH=$LIB_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK_3.1/Tools/OGLES2/Build/Linux_x86_32/ReleaseX11/

export LIB_PATH