gl.h, glu.h Missing files required by error_checker

I am using Ubuntu Edgy and the install went smoothly, but upon attempting to make the examples and common files I get an error as follows:

make[1]: Entering directory `/home/george/NVIDIA_CUDA_SDK/common'

g++ -m32 -W -Wall -Wimplicit -Wswitch -Wformat -Wchar-subscripts -Wparentheses -Wmultichar -Wtrigraphs -Wpointer-arith -Wcast-align -Wreturn-type -Wno-unused-function  -I. -I/usr/local/cuda/include -I./../common/inc -DUNIX -O3 -o ../bin/obj/release/error_checker.cpp_o -c src/error_checker.cpp

src/error_checker.cpp:51:19: error: GL/gl.h: No such file or directory

src/error_checker.cpp:52:20: error: GL/glu.h: No such file or directory

src/error_checker.cpp: In static member function ‘static void ErrorChecker::checkErrorGL(const char*, int)’:

src/error_checker.cpp:64: error: ‘GLenum’ was not declared in this scope

src/error_checker.cpp:64: error: expected `;' before ‘gl_error’

src/error_checker.cpp:65: error: ‘gl_error’ was not declared in this scope

src/error_checker.cpp:65: error: ‘GL_NO_ERROR’ was not declared in this scope

src/error_checker.cpp:69: error: ‘gluErrorString’ was not declared in this scope

make[1]: *** [../bin/obj/release/error_checker.cpp_o] Error 1

make[1]: Leaving directory `/home/george/NVIDIA_CUDA_SDK/common'

make: *** [lib/libcutil.so] Error 2

The two files just don’t exist in my common/inc/GL folder, where (judging by the code) I assume it is looking for them. After looking through the extraction log the gl.h and glu.h were never extracted, and I’m not sure why. I’m guessing the problem is deeper but I cant figure out where it is.

It is pretty essential as well, as error_checker is included in cutil, which is included in all examples.

As background I have a 8800gts in the mail, so I ran the command in the SDK folder:

make emu=1

Any help would be greatly appreciated.

-George

You need to install the mesa package, I think it is : libgl1-mesa-dev or mesa-common-dev. After you’ve installed those it should work.

EDIT: Re-install of mesa-common-dev fixed it. Thanks a lot.

If anyone has the same problem (this was a pretty fresh install of Ubuntu, so people might)

just do the following:

sudo apt-get install --reinstall mesa-common-dev

EDIT: Next problem >.<

In file included from ../../common/inc/GL/glh_genext.h:16,

                 from ../../common/inc/GL/glh_extensions.h:49,

                 from simpleGL.cu:53:

/usr/include/GL/glx.h:38:22: error: X11/Xlib.h: No such file or directory

/usr/include/GL/glx.h:39:23: error: X11/Xutil.h: No such file or directory

In file included from simpleGL.cu:55:

../../common/inc/GL/glut.h:64:1: warning: "APIENTRY" redefined

In file included from ../../common/inc/GL/glh_extensions.h:31,

                 from simpleGL.cu:53:

/usr/include/GL/gl.h:104:1: warning: this is the location of the previous definition

I’ll poke around with it for a while see if I can find a solution.

Thanks again for your help.

-George

Looks like you need to install libx11-dev

Yep, that solved that problem

I think I’m slowly getting closer… Next problem: :">

This one might be due to the fact that I dont have the graphics driver installed as I am still waiting for my processor. Emulating the samples already works fine, so if this is just driver problems then I am a happy camper. Regardless, here is the message

It shows a bunch of the same errors at different lines in:

/common/inc/GL/glh_genext.h

"glXGetProcAddressARB" is undefined

Thanks again for your help guys.

-George

This is some interaction between the OpenGL headers on Ubuntu and the Nvidia drivers. If you don’t care about using CUDA with OpenGL, you can ignore this problem and your generic CUDA code will work fine. Otherwise, I don’t think this is a CUDA-specific issue, so googling for OpenGL and glXGetProcAddressARB might give you some pointers…

NVIDAs driver installer checks for “conflicting” X and OpenGL files before installing the kernel module. Maybe this fixes the Ubuntu-provided headers.

Peter

Yep, its working fine, and I dont have any need to use it with OpenGL.

Thanks for the help guys, I’m not going to stress about it anymore, I’ll keep posting if I need any help once I get my GTS next week.

I am facing a similar problem trying to make the CUDA SDK 1.1 on an FC5 machine with the 2.6.15-1.2054_FC5smp kernel.

i have gl.h installed in /usr/include/GL but there is no glu.h on the system. due to this i am getting an error while doing a make of CUDA SDK 1.1 in the emulation and debug mode.

i have lots of *mesa.h files in the /usr/include/GL as well. only the glu.h file looks like missing.

[adimax@rahu NVIDIA_CUDA_SDK]$ make emu=1 dbg=1

make[1]: Entering directory `/home/adimax/dumpdata/NVIDIA_CUDA_SDK/common'

ar: creating ./../lib/libcutilD.a

a - obj/debug/bank_checker.cpp_o

a - obj/debug/cmd_arg_reader.cpp_o

a - obj/debug/cutil.cpp_o

a - obj/debug/stopwatch.cpp_o

a - obj/debug/stopwatch_linux.cpp_o

a - obj/debug/multithreading.cpp_o

make[1]: Leaving directory `/home/adimax/dumpdata/NVIDIA_CUDA_SDK/common'

make[1]: Entering directory `/home/adimax/dumpdata/NVIDIA_CUDA_SDK/common'

In file included from ./../common/inc/paramgl.h:13,

                 from src/paramgl.cpp:8:

./../common/inc/GL/glut.h:60:20: error: GL/glu.h: No such file or directory

./../common/inc/GL/glut.h:64:1: warning: "APIENTRY" redefined

In file included from ./../common/inc/GL/glut.h:59,

                 from ./../common/inc/paramgl.h:13,

                 from src/paramgl.cpp:8:

/usr/include/GL/gl.h:104:1: warning: this is the location of the previous definition

make[1]: *** [obj/debug/paramgl.cpp_o] Error 1

make[1]: Leaving directory `/home/adimax/dumpdata/NVIDIA_CUDA_SDK/common'

make: *** [lib/libparamgl.so] Error 2

[adimax@rahu NVIDIA_CUDA_SDK]$ cd common/inc/

any help is appreciated

libGLU/glu.h ships with the OS. Please note that FC5 was never qualified to work with CUDA.

I had this missing on my RHES 5 box as well. Needed to yum install mesa’s gl and glu devel packages as well as freeglut devel package.

EDIT: Next problem >.<

In file included from ../../common/inc/GL/glh_genext.h:16,

                 from ../../common/inc/GL/glh_extensions.h:49,

                 from simpleGL.cu:53:

/usr/include/GL/glx.h:38:22: error: X11/Xlib.h: No such file or directory

/usr/include/GL/glx.h:39:23: error: X11/Xutil.h: No such file or directory

In file included from simpleGL.cu:55:

../../common/inc/GL/glut.h:64:1: warning: "APIENTRY" redefined

In file included from ../../common/inc/GL/glh_extensions.h:31,

                 from simpleGL.cu:53:

/usr/include/GL/gl.h:104:1: warning: this is the location of the previous definition

I’ll poke around with it for a while see if I can find a solution.

Thanks again for your help.

-George

[snapback]170680[/snapback]

[/quote]

Also, you might want to install the “freeglut”-package…

Since this is the first hit on Google I got when I searched for the problem, I’ll also post the solution.

To get the CUDA 2.0 SDK samples compiling on RHEL 5, you may need to run the following commands:

yum install freeglut freeglut-devel libX11-devel mesa-libGLU-devel

I hope I didn’t miss anything.

This is just a guess, but maybe to use CUDA you should install nvidia-glx-177-dev (Or whichever driver revision you have) which is nvidia’s OpenGL libraries and headers.

Then, as stated before, use libglu1-mesa-dev for GLU.

yum install freeglut-devel

I answer this question a lot!

Why doesn’t the CUDA Toolkit script check for these and at least warn the user, if not install them itself?

replace “toolkit” with “SDK” and that’s a legitimate question. freeglut has nothing to do with the toolkit, just some SDK samples (same with D3D support for the Windows SDK).

I get an error “GL/glu.h No such file or directory” on Ubuntu 8.10, and I tried all the advice I found in this thread. Nothing helps.

Namely, I tried
sudo apt-get install --reinstall mesa-common-dev
yum install freeglut freeglut-devel libX11-devel mesa-libGLU-devel
etc.
and I don’t have libGLU/glu.h in /usr/include.

Any help is greatly appreciated.

Hi,

I’m running Debian, so not too far from Ubuntu. I installed the following packages (apt-get install) this morning, and everything compiles fine for me:

libgl1-mesa-dev

  mesa-common-dev

  libgl1-mesa-dri-dev

  libglu1-mesa-dev

  freeglut-dev

libglu1-mesa-dev contains glu.h.