From: Nabil Ghodbane Date: Wed, 13 Jan 2021 08:49:30 +0000 (+0100) Subject: spns #20550 Version EGL headless offscreen de paraview X-Git-Tag: V9_7_0~161 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1d484907d4827e1943d02690996f6c777fed419f;p=tools%2Fsat_salome.git spns #20550 Version EGL headless offscreen de paraview --- diff --git a/products/compil_scripts/ParaView.sh b/products/compil_scripts/ParaView.sh index c37f2f3..f9f729c 100755 --- a/products/compil_scripts/ParaView.sh +++ b/products/compil_scripts/ParaView.sh @@ -30,6 +30,36 @@ CMAKE_OPTIONS="${CMAKE_OPTIONS} -DPARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON" ### OpenGL settings CMAKE_OPTIONS="${CMAKE_OPTIONS} -DOpenGL_GL_PREFERENCE:STRING=LEGACY" +### spns #20550 - Headless mode +if [ -n "$PARAVIEW_HEADLESS_MODE" ] +then + EGL_INCLUDE_ROOT_DIR= + EGL_LIBRARY_ROOT_DIR= + # check EGL/egl.h is present + LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + case $LINUX_DISTRIBUTION in + CO6|CO7|FD26|FD30|FD32) + if [ -f /usr/include/EGL/egl.h ] && [ -f /usr/lib64/libEGL.so ] + then + EGL_FOUND=true + EGL_INCLUDE_ROOT_DIR=/usr/include + EGL_LIBRARY_ROOT_DIR=/usr/lib64 + fi + ;; + *) + ;; + esac + if [ $EGL_FOUND == "true" ]; then + echo "WARNING: Building with headless mode support..." + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_OPENGL_HAS_EGL:BOOL=ON" + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DEGL_INCLUDE_DIR=${EGL_INCLUDE_ROOT_DIR}" + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DEGL_opengl_LIBRARY=${EGL_LIBRARY_ROOT_DIR}/libEGL.so" + else + echo "FATAL: Headless mode cannot be set on node $LINUX_DISTRIBUTION! Please set EGL_INCLUDE_ROOT_DIR and EGL_LIBRARY_ROOT_DIR environment variables in script: $0" + exit 1 + fi +fi + ### Ray-tracing settings if [ -n "$OSPRAY_ROOT_DIR" ] then