Linking issues with GLX for PV5.9 with EGL

Hello,

I am trying to build ParaView version 5.9.1 with EGL backend, parallel and Catalyst support. I am building in on x86 machine. My issue is very similar to this post, but the solution there was to set VTK_USE_X which I cannot do on my machine as X libraries are not installed.

My cmake invocation is as follows:

cmake \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DBUILD_TESTING=OFF \
    -DPARAVIEW_USE_MPI=YES \
    -DVTK_PYTHON_OPTIONAL_LINK=OFF \
    -DVTK_MODULE_ENABLE_ParaView_Catalyst=YES \
    -DVTK_MODULE_ENABLE_ParaView_PythonCatalyst=YES \
    -DVTK_MODULE_ENABLE_VTK_FiltersParallel=YES \
    -DVTK_MODULE_ENABLE_ParaView_VTKExtensionsExtraction=YES \
    -DVTK_MODULE_ENABLE_ParaView_VTKExtensionsExtractionPython=YES \
    -DVTK_MODULE_ENABLE_VTK_FiltersExtraction=YES \
    -DPARAVIEW_USE_PYTHON=NO \
    -DVTK_USE_X=NO \
    -DVTK_RENDERING_BACKEND=OpenGL2 \
    -DPARAVIEW_USE_QT=OFF \
    -DEGL_LIBRARY=/usr/lib64/libEGL_nvidia.so.0 \
    -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
    ../ParaView-v${VERSION} 2>&1 | tee $LOGFILE

Error in verbose mode below:

[ 95%] Linking CXX executable ../../../bin/vtkProbeOpenGLVersion-pv5.9                                                                                 [9/9431]
cd /lustre/scafellpike/local/HT04121/aas01/shared/software/build-5.9.1/VTK/Rendering/OpenGL2 && /netfs/smain01/scafellpike/local/apps/hierarchy/core/cmake/3.21
.1/bin/cmake -E cmake_link_script CMakeFiles/vtkProbeOpenGLVersion.dir/link.txt --verbose=2
/lustre/scafellpike/local/apps/hierarchy/core/gcc/6.5.0/bin/g++ -O2 -g -DNDEBUG  -Wl,-lc  -Wl,-lc -Wl,-rpath=/lustre/scafellpike/local/apps/hierarchy/compiler/
gcc/6.5/openmpi/4.1.1-ucx/lib  CMakeFiles/vtkProbeOpenGLVersion.dir/vtkProbeOpenGLVersion.cxx.o -o ../../../bin/vtkProbeOpenGLVersion-pv5.9  -Wl,-rpath,"\$ORIG
IN/../lib64::::::::" ../../../lib64/libvtkRenderingOpenGL2-pv5.9.so.5.9 ../../../lib64/libvtkRenderingUI-pv5.9.so.5.9 ../../../lib64/libvtkRenderingCore-pv5.9.
so.5.9 ../../../lib64/libvtkFiltersGeneral-pv5.9.so.5.9 ../../../lib64/libvtkFiltersCore-pv5.9.so.5.9 ../../../lib64/libvtkglew-pv5.9.so.5.9 /usr/lib64/libOpen
GL.so ../../../lib64/libvtkCommonExecutionModel-pv5.9.so.5.9 ../../../lib64/libvtkCommonDataModel-pv5.9.so.5.9 ../../../lib64/libvtkCommonTransforms-pv5.9.so.5
.9 ../../../lib64/libvtkCommonMisc-pv5.9.so.5.9 ../../../lib64/libvtkCommonMath-pv5.9.so.5.9 ../../../lib64/libvtkCommonCore-pv5.9.so.5.9 -lpthread ../../../li
b64/libvtksys-pv5.9.so.5.9 -ldl -Wl,-rpath-link,/lustre/scafellpike/local/HT04121/aas01/shared/software/build-5.9.1/lib64 
../../../lib64/libvtkglew-pv5.9.so.5.9: undefined reference to `glXQueryVersion'
../../../lib64/libvtkglew-pv5.9.so.5.9: undefined reference to `glXGetProcAddressARB'
../../../lib64/libvtkglew-pv5.9.so.5.9: undefined reference to `glXGetClientString'

I would appreciate any ideas.

EDIT: Restate why I couldn’t use the solution in the other post.