errors compiling ParaView 5.6.1 for offscreen GPU rendering

Hello,

I am trying to compile ParaView 5.6.1 server to run offscreen on cluster GPU nodes, using the following flags:

-DCMAKE_SKIP_RPATH=ON
-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON
-DVTK_OPENGL_HAS_OSMESA=ON
-DPARAVIEW_USE_MPI=ON
-DPARAVIEW_BUILD_QT_GUI=OFF
-DPARAVIEW_USE_OSPRAY=ON
-DOSPRAY_INSTALL_DIR=$NIXUSER_PROFILE
-DVTK_USE_SYSTEM_HDF5=ON
-DPARAVIEW_ENABLE_PYTHON=ON
-DBUILD_SHARED_LIBS=ON
-DVTK_USE_X=OFF
-DVTK_OPENGL_HAS_EGL=ON
-DBUILD_TESTING=OFF
-DEGL_INCLUDE_DIR=/usr/include
-DEGL_LIBRARY=/usr/lib64/nvidia/libEGL.so
-DEGL_opengl_LIBRARY=/usr/lib64/nvidia/libOpenGL.so
-DVTK_RENDERING_BACKEND=OpenGL2

The compiler is gcc/5.4.0 (tried other gcc versions too), and I am getting the following error:

[ 13%] Linking CXX shared library …/…/…/lib/libvtkDomainsChemistry-pv5.6.so
[ 13%] Built target vtkDomainsChemistry
Scanning dependencies of target vtkglew
[ 13%] Building C object VTK/ThirdParty/glew/vtkglew/CMakeFiles/vtkglew.dir/src/glew.c.o
/tmp/pv/ParaView-v5.6.1/VTK/ThirdParty/glew/vtkglew/src/glew.c: In function ‘vtkglew_glewInit’:
/tmp/pv/ParaView-v5.6.1/VTK/ThirdParty/glew/vtkglew/src/glew.c:20864:3: error: unknown type name ‘PFNEGLGETCURRENTDISPLAYPROC’
PFNEGLGETCURRENTDISPLAYPROC getCurrentDisplay = NULL;
^
/tmp/pv/ParaView-v5.6.1/VTK/ThirdParty/glew/vtkglew/src/glew.c:20869:24: error: ‘PFNEGLGETCURRENTDISPLAYPROC’ undeclared (first use in this function)
getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) glewGetProcAddress(“eglGetCurrentDisplay”);
^
/tmp/pv/ParaView-v5.6.1/VTK/ThirdParty/glew/vtkglew/src/glew.c:20869:24: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pv/ParaView-v5.6.1/VTK/ThirdParty/glew/vtkglew/src/glew.c:164:36: error: expected ‘;’ before ‘OSMesaGetProcAddress’
define glewGetProcAddress(name) OSMesaGetProcAddress((const char *)name)
^
/tmp/pv/ParaView-v5.6.1/VTK/ThirdParty/glew/vtkglew/src/glew.c:20869:53: note: in expansion of macro ‘glewGetProcAddress’
getCurrentDisplay = (PFNEGLGETCURRENTDISPLAYPROC) glewGetProcAddress(“eglGetCurrentDisplay”);
^
/tmp/pv/ParaView-v5.6.1/VTK/ThirdParty/glew/vtkglew/src/glew.c:20870:20: error: called object ‘getCurrentDisplay’ is not a function or function pointer
return eglewInit(getCurrentDisplay());
^
/tmp/pv/ParaView-v5.6.1/VTK/ThirdParty/glew/vtkglew/src/glew.c:20864:31: note: declared here
PFNEGLGETCURRENTDISPLAYPROC getCurrentDisplay = NULL;
^
make[2]: *** [VTK/ThirdParty/glew/vtkglew/CMakeFiles/vtkglew.dir/build.make:63: VTK/ThirdParty/glew/vtkglew/CMakeFiles/vtkglew.dir/src/glew.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:6466: VTK/ThirdParty/glew/vtkglew/CMakeFiles/vtkglew.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Any suggestions on how I could solve this?

Thank you.

Welcome to ParaView, @razoumov.

It looks to me like you are trying to use OSMesa and EGL. You can enable only one of those in a build.

Since you have EGL, I suggest setting -DVTK_OPENGL_HAS_OSMESA=OFF instead of on.

Thank you, Cory – that worked.