I’m trying to compile the CUDA BY EXAMPLE examples but cannot make it run :S here’s the output of the compiler
BRabbit$ nvcc julia_gpu.cu In file included from ../common/cpu_bitmap.h:20,
from julia_gpu.cu:18:
../common/gl_helper.h:44:21: error: GL/glut.h: No such file or directory
../common/gl_helper.h:45:22: error: GL/glext.h: No such file or directory
../common/gl_helper.h:46:20: error: GL/glx.h: No such file or directory
OS X has the OpenGL headers in a different place to the standard layout that code is written to expect. Rather than just GL/, headers are located in OpenGL/ and GLUT/. You will need to modify the preprocessor #include statements accordingly.
I change the #include statements but still the last one can’t be found
#include <GLUT/glut.h>
#include <OpenGL/glext.h>
#include <GL/glx.h> //Didn't work
#include <GLUT/glx.h> //the same
#include <OpenGL/glx.h> // the same
is it that the last library doesn’t exist in Mac OS X?
the errors are the following:
Undefined symbols:
"_glDrawPixels", referenced from:
CPUBitmap::Draw() in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glClear", referenced from:
CPUBitmap::Draw() in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glutInit", referenced from:
CPUBitmap::display_and_exit(void (*)(void*))in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glFlush", referenced from:
CPUBitmap::Draw() in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glutMainLoop", referenced from:
CPUBitmap::display_and_exit(void (*)(void*))in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glutInitDisplayMode", referenced from:
CPUBitmap::display_and_exit(void (*)(void*))in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glutInitWindowSize", referenced from:
CPUBitmap::display_and_exit(void (*)(void*))in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glutCreateWindow", referenced from:
CPUBitmap::display_and_exit(void (*)(void*))in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glutDisplayFunc", referenced from:
CPUBitmap::display_and_exit(void (*)(void*))in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glClearColor", referenced from:
CPUBitmap::Draw() in tmpxft_0000065a_00000000-12_julia_gpu.o
"_glutKeyboardFunc", referenced from:
CPUBitmap::display_and_exit(void (*)(void*))in tmpxft_0000065a_00000000-12_julia_gpu.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Hello, sorry for bringing this back from so long ago but I have a mac too and I’m trying to make the changes so I can run the code as well and I’m not doing something right.
So I essentially followed mfatica’s directions and changed the specified lines in my glhelper but still it doesn’t compile. Do I also need to do something else?
I still get the error
“In file included from …/common/cpu_bitmap.h:20,
from julia_gpu.cu:18:
…/common/gl_helper.h:51:21: error: GL/glut.h: No such file or directory
…/common/gl_helper.h:52:22: error: GL/glext.h: No such file or directory
…/common/gl_helper.h:53:21: error: GL/glx.h: No such file or directory”
I also get this error:
In file included from julia_gpu.cu:18:
In file included from ./…/common/cpu_bitmap.h:20:
./…/common/gl_helper.h:17:2: error: unterminated conditional directive #ifndefGL_HELPER_H