Hi.
I am using a Macbook Air with GeForce 320M and Mac OS X Lion.
I am trying to run the Julia set example in chapter 3. I modified the gl_helper file to look like (as suggested in other posts in this forum):
#ifdef(__APPLE__)
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#include <GL/glext.h>
#include <GL/glx.h>
#endif
And when compiling I tried using several commands like
nvcc JuliaSet.cu -Xlinker -framework GLUT -Xlinker -framework OpenGL
nvcc JuliaSet.cu -Xlinker -framework,GLUT -Xlinker -framework,OpenGL
But I keep getting this error:
nvcc JuliaSet.cu -Xlinker -framework GLUT -Xlinker -framework OpenGL
cuda_by_example/common/cpu_bitmap.h(50): error: identifier "glutInit" is undefined
cuda_by_example/common/cpu_bitmap.h(51): error: identifier "GLUT_SINGLE" is undefined
cuda_by_example/common/cpu_bitmap.h(51): error: identifier "GLUT_RGBA" is undefined
cuda_by_example/common/cpu_bitmap.h(51): error: identifier "glutInitDisplayMode" is undefined
cuda_by_example/common/cpu_bitmap.h(52): error: identifier "glutInitWindowSize" is undefined
cuda_by_example/common/cpu_bitmap.h(53): error: identifier "glutCreateWindow" is undefined
cuda_by_example/common/cpu_bitmap.h(54): error: identifier "glutKeyboardFunc" is undefined
cuda_by_example/common/cpu_bitmap.h(55): error: identifier "glutDisplayFunc" is undefined
cuda_by_example/common/cpu_bitmap.h(56): error: identifier "glutMainLoop" is undefined
cuda_by_example/common/cpu_bitmap.h(79): error: identifier "glClearColor" is undefined
cuda_by_example/common/cpu_bitmap.h(80): error: identifier "GL_COLOR_BUFFER_BIT" is undefined
cuda_by_example/common/cpu_bitmap.h(80): error: identifier "glClear" is undefined
cuda_by_example/common/cpu_bitmap.h(81): error: identifier "GL_RGBA" is undefined
cuda_by_example/common/cpu_bitmap.h(81): error: identifier "GL_UNSIGNED_BYTE" is undefined
cuda_by_example/common/cpu_bitmap.h(81): error: identifier "glDrawPixels" is undefined
cuda_by_example/common/cpu_bitmap.h(82): error: identifier "glFlush" is undefined
16 errors detected in the compilation of "/tmp/tmpxft_00000511_00000000-10_JuliaSet.cpp1.ii".
JuliaSet.cu is just my version of the example given in the book. So I tried running the original julia_gpu.cu given in the example code.
nvcc -o juliagpu julia_gpu.cu -Xlinker -framework,GLUT -Xlinker -framework,OpenGL
../common/cpu_bitmap.h(50): error: identifier "glutInit" is undefined
../common/cpu_bitmap.h(51): error: identifier "GLUT_SINGLE" is undefined
../common/cpu_bitmap.h(51): error: identifier "GLUT_RGBA" is undefined
../common/cpu_bitmap.h(51): error: identifier "glutInitDisplayMode" is undefined
../common/cpu_bitmap.h(52): error: identifier "glutInitWindowSize" is undefined
../common/cpu_bitmap.h(53): error: identifier "glutCreateWindow" is undefined
../common/cpu_bitmap.h(54): error: identifier "glutKeyboardFunc" is undefined
../common/cpu_bitmap.h(55): error: identifier "glutDisplayFunc" is undefined
../common/cpu_bitmap.h(56): error: identifier "glutMainLoop" is undefined
../common/cpu_bitmap.h(79): error: identifier "glClearColor" is undefined
../common/cpu_bitmap.h(80): error: identifier "GL_COLOR_BUFFER_BIT" is undefined
../common/cpu_bitmap.h(80): error: identifier "glClear" is undefined
../common/cpu_bitmap.h(81): error: identifier "GL_RGBA" is undefined
../common/cpu_bitmap.h(81): error: identifier "GL_UNSIGNED_BYTE" is undefined
../common/cpu_bitmap.h(81): error: identifier "glDrawPixels" is undefined
../common/cpu_bitmap.h(82): error: identifier "glFlush" is undefined
16 errors detected in the compilation of "/tmp/tmpxft_0000051e_00000000-4_julia_gpu.cpp1.ii".
What am I doing wrong?
EDIT:
I also tried this in gl_helper.h
#ifdef(__APPLE__)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#include <GL/glext.h>
#include <GL/glx.h>
#endif