Gamaru / opencl-book-samples

Automatically exported from code.google.com/p/opencl-book-samples
0 stars 0 forks source link

Chapter_12/Sinewave does not compile on Ubuntu Linux. Is it supposed to be there? #51

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The Chapter 12 Sinewave example does not compile on Ubuntu Linux.

Platform: Ubuntu Linux-- lucid/10.04
OpenCL implementation - OpenCL 1.1 CUDA 4.1.1
The error that is stopping compilation is the following:

Scanning dependencies of target sinewave
[100%] Building CXX object 
src/Chapter_12/Sinewave/CMakeFiles/sinewave.dir/sinewave.cpp.o
src/Chapter_12/Sinewave/sinewave.cpp:41:58: error: bmpLoader.hpp: No such file 
or directory
make[2]: *** [src/Chapter_12/Sinewave/CMakeFiles/sinewave.dir/sinewave.cpp.o] 
Error 1
make[1]: *** [src/Chapter_12/Sinewave/CMakeFiles/sinewave.dir/all] Error 2
make: *** [all] Error 2

When this particular line in sinewave.cpp is removed, then we get a number of 
gl/glut linking errors:

[100%] Building CXX object 
src/Chapter_12/Sinewave/CMakeFiles/sinewave.dir/sinewave.cpp.o
Linking CXX executable sinewave
CMakeFiles/sinewave.dir/sinewave.cpp.o: In function `display()':
sinewave.cpp:(.text+0x37e): undefined reference to `glClear'
sinewave.cpp:(.text+0x388): undefined reference to `glMatrixMode'
sinewave.cpp:(.text+0x38d): undefined reference to `glLoadIdentity'
sinewave.cpp:(.text+0x3a3): undefined reference to `glTranslatef'
sinewave.cpp:(.text+0x3be): undefined reference to `glRotatef'
sinewave.cpp:(.text+0x3d9): undefined reference to `glRotatef'
sinewave.cpp:(.text+0x3e0): undefined reference to `__glewBindBuffer'
sinewave.cpp:(.text+0x41b): undefined reference to `glVertexPointer'
sinewave.cpp:(.text+0x425): undefined reference to `glEnableClientState'
sinewave.cpp:(.text+0x438): undefined reference to `glColor3f'
sinewave.cpp:(.text+0x44c): undefined reference to `glDrawArrays'
sinewave.cpp:(.text+0x456): undefined reference to `glDisableClientState'
sinewave.cpp:(.text+0x45d): undefined reference to `__glewBindBuffer'
sinewave.cpp:(.text+0x46e): undefined reference to `glutSwapBuffers'
sinewave.cpp:(.text+0x473): undefined reference to `glutPostRedisplay'
CMakeFiles/sinewave.dir/sinewave.cpp.o: In function `mouse(int, int, int, int)':
sinewave.cpp:(.text+0x55c): undefined reference to `glutPostRedisplay'
CMakeFiles/sinewave.dir/sinewave.cpp.o: In function `createVBO(unsigned int*, 
cl::Buffer*)':
sinewave.cpp:(.text+0x684): undefined reference to `__glewGenBuffers'
sinewave.cpp:(.text+0x699): undefined reference to `__glewBindBuffer'
sinewave.cpp:(.text+0x6b6): undefined reference to `__glewBufferData'
sinewave.cpp:(.text+0x6d4): undefined reference to `__glewBindBuffer'
CMakeFiles/sinewave.dir/sinewave.cpp.o: In function `main':
sinewave.cpp:(.text+0x7a4): undefined reference to `glutInit'
sinewave.cpp:(.text+0x7ae): undefined reference to `glutInitDisplayMode'
sinewave.cpp:(.text+0x7bd): undefined reference to `glutInitWindowSize'
sinewave.cpp:(.text+0x7c7): undefined reference to `glutCreateWindow'
sinewave.cpp:(.text+0x7cc): undefined reference to `glewInit'
sinewave.cpp:(.text+0x7d6): undefined reference to `glewIsSupported'
sinewave.cpp:(.text+0x80f): undefined reference to `glEnable'
sinewave.cpp:(.text+0x825): undefined reference to `glClearColor'
sinewave.cpp:(.text+0x82f): undefined reference to `glDisable'
sinewave.cpp:(.text+0x848): undefined reference to `glViewport'
sinewave.cpp:(.text+0x852): undefined reference to `glMatrixMode'
sinewave.cpp:(.text+0x857): undefined reference to `glLoadIdentity'
sinewave.cpp:(.text+0x884): undefined reference to `gluPerspective'
sinewave.cpp:(.text+0x88e): undefined reference to `glutDisplayFunc'
sinewave.cpp:(.text+0x898): undefined reference to `glutKeyboardFunc'
sinewave.cpp:(.text+0x8a2): undefined reference to `glutMouseFunc'
sinewave.cpp:(.text+0x8ac): undefined reference to `glutMotionFunc'
sinewave.cpp:(.text+0xbbd): undefined reference to `glXGetCurrentContext'
sinewave.cpp:(.text+0xc15): undefined reference to `glXGetCurrentDisplay'
sinewave.cpp:(.text+0x1216): undefined reference to `glutMainLoop'
collect2: ld returned 1 exit status

However, I do not see this example in the book itself.  Is it supposed to be in 
the source code tree at all?

Original issue reported on code.google.com by kander...@willowgarage.com on 17 Jan 2012 at 6:02

GoogleCodeExporter commented 8 years ago
i have also this issue... but not uncoomment that line..- i have the file 
attached . For the problem with the linker open the file link.txt ,it reside in 
the  folder where you build the solution with cmake in 
/openCL_programmingBook/build/src/Chapter_12/Sinewave/CMakeFiles/sinewave.dir 
and add these : -lglut -lGLU -lGL -lGLEW or you can use the file attached. This 
make compile the solution but launching the app i receive :ERROR: No "ATI 
Stream" CL platform found! Exiting... the same example in GPU_COMPUTING_SDK 
instead works fine...there is something wrong in it?

Original comment by i...@kalwaltart.it on 8 Feb 2012 at 4:15

Attachments:

GoogleCodeExporter commented 8 years ago
i just want to write a demo about CL/GL interop .So i read the OpenCL 
Programming Guide,I  also writed a sine demo, CL computing the vbo buffer 
data.and opengl drawing the sine curve as the vbo buffer data.   while the CL 
called the function clEnqueueAcquireGLObjects() ,it returns CL_SUCCESS  but the 
debugging information :error mapping 0x9123520 0x00000007(error = -2). so i 
can't complete my idea,sine curve was't drawed. i want to ask help for 
you,thanks in advance!could you give me some comment about it? 

Original comment by mingqian...@gmail.com on 14 Jul 2014 at 1:13

Attachments: