Using GLUT with CUDA on MacOSX

Hi,

I am trying to compile a simple program using all the openGL libraries with a GPU computation using CUDA on MacOSX. However, I have been unable to link to the GLUT library on MacOSX. I have been told that I cannot use the Xcode framework and that I should link to the required libraries with this flag:

-Xlinker “-L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL -lGLU”

But where is the GLUT lib file? I have tried adding the following argument:
“-L/System/Library/Frameworks/GLUT.framework”

But of course, it cannot find the glut library…does anyone know where is is in MacOSX? It should come with XCode, but it’s not in Library folder…

Here is the command line and the errors:

nvcc main.c -o main -Xlinker “-L/System/Library/Frameworks/OpenGL.framework/Libraries -lGL -lGLU” “-L/System/Library/Frameworks/GLUT.framework”
Undefined symbols:
“_glutInitWindowSize”, referenced from:
_main in tmpxft_00001612_00000000-1_main.o
“_glutInitWindowPosition”, referenced from:
_main in tmpxft_00001612_00000000-1_main.o
“_glutDisplayFunc”, referenced from:
_main in tmpxft_00001612_00000000-1_main.o
“_glutInitDisplayMode”, referenced from:
_main in tmpxft_00001612_00000000-1_main.o
“_glutCreateWindow”, referenced from:
_main in tmpxft_00001612_00000000-1_main.o
“_glutMainLoop”, referenced from:
_main in tmpxft_00001612_00000000-1_main.o
“_glutInit”, referenced from:
_main in tmpxft_00001612_00000000-1_main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Any ideas? Should I use something else instead? OpenGL works fine, I just can’t manage to create my window with GLUT…

Thanks,

omegatai