Hi,
I’m running 64-bit Ubuntu 10.04 LTS with the NVIDIA development drivers installed. I want to use a multithreaded version of Panda3D, so I’m compiling from source using the makepanda.py script. My compile command is:
./makepanda/makepanda.py --verbose --override "SIMPLE_THREADS=UNDEF" --installer --everything
The compilation fails while building mesadisplay_composite:
[ 46%] Building C++ object built/tmp/mesadisplay_composite.o
g++ -ftemplate-depth-30 -fPIC -c -o built/tmp/mesadisplay_composite.o -I/usr/include/python2.6 -Ibuilt/tmp -Ibuilt/include -DMAKEPANDA= -Ipanda/src/mesadisplay -Ipanda/src/glstuff -pthread -O2 -DBUILDING_PANDAMESA panda/src/mesadisplay/mesadisplay_composite.cxx
In file included from panda/src/mesadisplay/mesagsg.h:75,
from panda/src/mesadisplay/osMesaGraphicsPipe.h:21,
from panda/src/mesadisplay/osMesaGraphicsBuffer.h:20,
from panda/src/mesadisplay/config_mesadisplay.cxx:16,
from panda/src/mesadisplay/mesadisplay_composite1.cxx:1,
from panda/src/mesadisplay/mesadisplay_composite.cxx:1:
/usr/include/GL/osmesa.h:119: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:132: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:142: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/GL/osmesa.h:174: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:184: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:202: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/GL/osmesa.h:218: error: expected constructor, destructor, or type conversion before ‘void’
/usr/include/GL/osmesa.h:233: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:249: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:266: error: ‘GLAPI’ does not name a type
/usr/include/GL/osmesa.h:275: error: expected constructor, destructor, or type conversion before ‘void’
In file included from panda/src/mesadisplay/mesadisplay_composite1.cxx:2,
from panda/src/mesadisplay/mesadisplay_composite.cxx:1:
panda/src/mesadisplay/osMesaGraphicsBuffer.cxx: In member function ‘virtual bool OsMesaGraphicsBuffer::begin_frame(GraphicsOutput::FrameMode, Thread*)’:
panda/src/mesadisplay/osMesaGraphicsBuffer.cxx:69: error: ‘OSMesaMakeCurrent’ was not declared in this scope
In file included from panda/src/mesadisplay/mesadisplay_composite1.cxx:4,
from panda/src/mesadisplay/mesadisplay_composite.cxx:1:
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx: In constructor ‘OSMesaGraphicsStateGuardian::OSMesaGraphicsStateGuardian(GraphicsEngine*, GraphicsPipe*, OSMesaGraphicsStateGuardian*)’:
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx:35: error: ‘OSMesaCreateContext’ was not declared in this scope
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx: In destructor ‘virtual OSMesaGraphicsStateGuardian::~OSMesaGraphicsStateGuardian()’:
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx:49: error: ‘OSMesaDestroyContext’ was not declared in this scope
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx: In member function ‘virtual void* OSMesaGraphicsStateGuardian::do_get_extension_func(const char*, const char*)’:
panda/src/mesadisplay/osMesaGraphicsStateGuardian.cxx:75: error: ‘OSMesaGetProcAddress’ was not declared in this scope
Process exited with exit status 1 and signal code 0
I have tried the compilation with the regular NVIDIA drivers installed, and it worked fine. I have also tried the .deb with the development drivers, it did not work.
Doing some investigating; GLAPI is normally defined in /usr/include/GL/gl.h which is included by /usr/include/GL/osmesa.h. The problem seems to relate to the fact that installing the CUDA drivers provides a new gl.h which undefines GLAPI at the end of the file. I have tried adding the “–no-osmesa” flag to the make command, but it made no difference.
Does anyone have any recommendations on where to go next? Has anyone successfully compiled Panda3D with CUDA drivers?
Thanks,
Jon