[Bf-committers] WITH_HEADLESS and OpenGL

Campbell Barton ideasman42 at gmail.com
Fri Dec 12 01:15:54 CET 2014


On Thu, Dec 11, 2014 at 11:26 PM, Carroll, Michael R
<michael.r.carroll at intel.com> wrote:
> Hello BF-Committers,
>
>
>
> Does building Blender WITH_HEADLESS require linkage with OpenGL?

Currently yes, however it could be changed.

With headless builds (and in background mode) OpenGL arent called,
there are a few possible workaround.

- Use mesa software OpenGL (we use this for blender-softwaregl on Linux),
... Not a real solution, but at least you don't need to install libs
on the operating system.

- Stub-out OpenGL and link to a dummy library.
... No heavy dependencies, but takes some effort to setup. It could be
preloaded or static link.

- Omit all GL calls from WITH_HEADLESS builds,
... the most correct solution, but likely disruptive to the current
code-base. maybe interesting to try, but likely to add a lot if
#ifdef's. Since this is a build option (not even included in official
builds), its not such an attractive prospect to insert 100's of
ifdef's all over the code.

Longer term we might move drawing code into our own GPU module, IIRC
Jason Wilkins work went some way towards this, in that case its
probably  less trouble to stub out the drawing calls and remove the
OpenGL dependency.


> I have read the renderer doesn’t leverage OpenGL at all. I see the window
> manager/X11 features have been disabled in the WITH_HEADLESS source.
> However, I attempt to compile (using CMAKE) without any of the
> WITH_GL_PROFILE* options and bump into OpenGL related compiler errors. They
> start with the second editors/ object:
>
>
>
> [  5%] Building C object
> source/blender/editors/armature/CMakeFiles/bf_editor_armature.dir/editarmature_sketch.c.o
>
> /blender/blender/source/blender/editors/armature/editarmature_sketch.c:441:26:
> error: unknown type name ‘GLUquadric’
>
> static void sk_drawPoint(GLUquadric *quad, SK_Point *pt, float size)
>
>
>
> Would OpenGL have to be shimmed out or is there a build toggle to remove
> OpenGL?
>
> Many sources in the editors/ folders appear to use OpenGL… can these
> specifically be removed from a WITH_HEADLESS build?
>
>
>
> I have been lurking on the mail list reading related conversations… starting
> with the March’11 thread with Campbell, Brecht, and Pete. Campbell suggested
> that adding the WITH_HEADLESS feature could negate the requirement for
> OpenGL. I have seen a lot of checkins to support WITH_HEADLESS but those
> same diffs don’t appear to remove OpenGL from the build flow.
>
>
>
> I’m looking to run Blender for performance analysis on many different
> platforms. Eliminating any GUI is a requirement. Removing OpenGL would also
> be extremely helpful.
>
>
>
> Thank you,
>
> -MichaelC
>
>



-- 
- Campbell


More information about the Bf-committers mailing list