vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
533 stars 89 forks source link

Cannot build asymptote 2.87 with mesa 24.0.2 #433

Closed thegreyshadow closed 4 months ago

thegreyshadow commented 4 months ago

Using Slackware-current. Mesa version is 24.0.2.

Building of asymptote-2.87 fails with the following output:

g++ -DHAVE_CONFIG_H -D_FILE_OFFSET_BIS=64 -DUSEGC -DLSPCPP_USEGC   -DFFTWPP_SINGLE_THREAD -Wall  -I. -I/usr/include/gc -I/usr/include/gc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600  -I/usr/include/eigen3 -I/usr/include/tirpc  -std=c++11 -O2 -fPIC -fno-var-tracking -ILspCpp/include -o camperror.o -c camperror.cc
g++ -DHAVE_CONFIG_H -D_FILE_OFFSET_BIS=64 -DUSEGC -DLSPCPP_USEGC   -DFFTWPP_SINGLE_THREAD -Wall  -I. -I/usr/include/gc -I/usr/include/gc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600  -I/usr/include/eigen3 -I/usr/include/tirpc  -std=c++11 -O2 -fPIC -fno-var-tracking -ILspCpp/include -o path.o -c path.cc
g++ -DHAVE_CONFIG_H -D_FILE_OFFSET_BIS=64 -DUSEGC -DLSPCPP_USEGC   -DFFTWPP_SINGLE_THREAD -Wall  -I. -I/usr/include/gc -I/usr/include/gc -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600  -I/usr/include/eigen3 -I/usr/include/tirpc  -std=c++11 -O2 -fPIC -fno-var-tracking -ILspCpp/include -o drawpath.o -c drawpath.cc
In file included from glrender.h:64,
                 from drawelement.h:22,
                 from drawpath.h:11,
                 from drawpath.cc:12:
/usr/include/GL/osmesa.h:125:1: error: expected initializer before ‘OSMesaCreateContext’
  125 | OSMesaCreateContext( GLenum format, OSMesaContext sharelist );
      | ^~~~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:138:1: error: expected initializer before ‘OSMesaCreateContextExt’
  138 | OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
      | ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:167:1: error: expected initializer before ‘OSMesaCreateContextAttribs’
  167 | OSMesaCreateContextAttribs( const int *attribList, OSMesaContext sharelist );
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:177:1: error: expected initializer before ‘OSMesaDestroyContext’
  177 | OSMesaDestroyContext( OSMesaContext ctx );
      | ^~~~~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:209:1: error: expected initializer before ‘OSMesaMakeCurrent’
  209 | OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
      | ^~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:219:1: error: expected initializer before ‘OSMesaGetCurrentContext’
  219 | OSMesaGetCurrentContext( void );
      | ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:237:1: error: expected initializer before ‘OSMesaPixelStore’
  237 | OSMesaPixelStore( GLint pname, GLint value );
      | ^~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:253:1: error: expected initializer before ‘OSMesaGetIntegerv’
  253 | OSMesaGetIntegerv( GLint pname, GLint *value );
      | ^~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:268:1: error: expected initializer before ‘OSMesaGetDepthBuffer’
  268 | OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
      | ^~~~~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:284:1: error: expected initializer before ‘OSMesaGetColorBuffer’
  284 | OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
      | ^~~~~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:301:1: error: expected initializer before ‘OSMesaGetProcAddress’
  301 | OSMesaGetProcAddress( const char *funcName );
      | ^~~~~~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:310:1: error: expected initializer before ‘OSMesaColorClamp’
  310 | OSMesaColorClamp(GLboolean enable);
      | ^~~~~~~~~~~~~~~~
/usr/include/GL/osmesa.h:323:1: error: expected initializer before ‘OSMesaPostprocess’
  323 | OSMesaPostprocess(OSMesaContext osmesa, const char *filter,
      | ^~~~~~~~~~~~~~~~~
make: *** [Makefile:384: drawpath.o] Error 1

Thanks for asymptote, and please consider fixing this.

johncbowman commented 4 months ago

Try ./configure --disable-offscreen. Offscreen rendering is for headless servers only (no GPU card).

johncbowman commented 4 months ago

It looks like your osmesa.h header isn't setting GLAPI and GLAPIENTRY correctly; if you really want offscreen rendering (which disables interactive onscreen 3D rendering) I suggest you get a simple example working with OSMesa first.

thegreyshadow commented 4 months ago

Try ./configure --disable-offscreen. Offscreen rendering is for headless servers only (no GPU card).

Indeed. Asymptote built fine passing that parameter. Thanks!

avpanov commented 2 weeks ago

In commit https://gitlab.freedesktop.org/mesa/mesa/-/commit/5bf68ab70133edd264f832f4a133288b8b45f66d GLAPIENTRY was changed to APIENTRY.