Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Building a headless Blender on PizDaint
  1. Download source & dependencies
# Make a folder
mkdir ~/blender-git
cd  ~/blender-git
# Clone the Blender repo
git clone https://git.blender.org/blender.git
# Clone the dependencies
mkdir ~/blender-git/lib
cd ~/blender-git/lib
svn checkout https://svn.blender.org/svnroot/bf-blender/trunk/lib/linux_centos7_x86_64
# Update source & dependencies
cd ~/blender-git/blender
make update
  1. Load modules
module load daint-mc Mesa/.18.3.3-CrayGNU-20.08
module swap gcc/8.3.0 gcc/9.3.0
  1. Make headless
make headless

Warning: CMake might not find the OpenGL libraries. In that case you'll get an error like this:

-- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY) 

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_glx_LIBRARY (ADVANCED)
    linked by target "cycles_device" in directory /scratch/snx3000/bp000347/blender-git/blender/intern/cycles/device

The solution is to manually set the paths:

a. Open ../build_linux_headless/CMakeCache.txt and find the lines concerning OPENGL, replace them by:

OPENGL_EGL_INCLUDE_DIR:PATH=/usr/include
OPENGL_GLES2_INCLUDE_DIR:PATH=/usr/include
OPENGL_GLX_INCLUDE_DIR:PATH=/usr/include
OPENGL_INCLUDE_DIR:PATH=/usr/include

OPENGL_egl_LIBRARY:FILEPATH=/usr/lib64/libEGL.so
OPENGL_gles2_LIBRARY:FILEPATH=/usr/lib64/libGLESv2.so
OPENGL_gles3_LIBRARY:FILEPATH=/usr/lib64/libGLESv2.so
OPENGL_glu_LIBRARY:FILEPATH=/usr/lib64/libGLU.so
OPENGL_glx_LIBRARY:FILEPATH=/usr/lib64/libGLX.so
OPENGL_opengl_LIBRARY:FILEPATH=/usr/lib64/libOpenGL.so

b. Run make headless again, delete ../build_linux_headless if necesary.

  1. You should now have blender!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.