Dear support,
I am trying to compile paraview to have a solid version in Linux because using the uncompiled version gives me problems with either the readers, the python libraries or the GPU drivers (I would like to use Mesa since I am mostly using CPU rendering in my project).
Here I leave the steps and commands that I followed for the compilation:
Declaration of my installation path
#--------------------------------------------#
# Installation path
#--------------------------------------------#
InstallPath='/home/myUsername/Documents/Paraview_build'
Download and compile LLVM source
#--------------------------------------------#
# Part 1: Install LLVM source
#--------------------------------------------#
# SOURCE: https://www.paraview.org/Wiki/ParaView/ParaView_And_Mesa_3D
# Download the latest LLVM source
curl -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/llvm-12.0.1.src.tar.xz
# Extract
tar -xvf llvm-12.0.1.src.tar.xz
# Configure
mkdir llvm-12.0.1.bld
cd llvm-12.0.1.bld
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${InstallPath}/llvm \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_TARGETS_TO_BUILD=X86 \
../llvm-12.0.1.src
# Build and install
make -j8
make install
# Set your dependencies in your .basrhc
export PATH=$PATH:${InstallPath}/llvm/bin
cd ..
Then I download and install the Mesa source
#--------------------------------------------#
# Part 2: Install MESA source
#--------------------------------------------#
# Download and extract the latest Mesa source
curl -L -O https://archive.mesa3d.org//mesa-21.3.1.tar.xz
tar -xvf mesa-21.3.1.tar.xz
# Configure Mesa
mkdir mesa-21.3.1-build
cd mesa-21.3.1-build
meson \
../mesa-21.3.1 \
--buildtype=release \
--prefix=${InstallPath}/mesa \
-Dvulkan-drivers= \
-Ddri-drivers= \
-Dgallium-vdpau=disabled \
-Dgallium-xvmc=disabled \
-Dgallium-omx=disabled \
-Dgallium-va=disabled \
-Dgallium-xa=disabled \
-Dgallium-nine=false \
-Dgallium-opencl=disabled \
-Dbuild-tests=false \
-Degl=disabled \
-Dgbm=disabled \
-Dglx=disabled \
-Dplatforms= \
-Dglvnd=false \
-Dosmesa=true \
-Dopengl=true \
-Dgles1=disabled \
-Dgles2=disabled \
-Dshared-glapi=enabled \
-Dllvm=enabled \
-Dshared-llvm=enabled \
-Dgallium-drivers=swrast,swr
ninja
ninja install
#./configure --prefix=/home/cjimenez2/Documents/Paraview_build --enable-osmesa --with-osmesa-bits=8 ac_cv_path_LLVM_CONFIG=llvm-config-x.x
Then I download the required dependencies
#--------------------------------------------#
# Part 3: Download dependencies for Paraview
#--------------------------------------------#
#SOURCE: https://gitlab.kitware.com/paraview/paraview/blob/master/Documentation/dev/build.md
# Dependencies
sudo apt-get install git cmake build-essential libgl1-mesa-dev libxt-dev qt5-default libqt5x11extras5-dev libqt5help5 qttools5-dev qtxmlpatterns5-dev-tools libqt5svg5-dev python3-dev python3-numpy libopenmpi-dev libtbb-dev ninja-build openmpi-bin
# Environtment
export PATH=$PATH:/usr/bin/
And finally I download and install Paraview version 5.9.1
#--------------------------------------------#
# Part 4: Download and compile Paraview
#--------------------------------------------#
# To build a specific ParaView version, eg: v5.9.1, please run the following commands in a terminal while replacing "tag" by the version you want to build
git clone https://gitlab.kitware.com/paraview/paraview.git
cd paraview
git checkout v5.9.1
git submodule update --init --recursive
cd ..
#--------------------------------------------
# OSMESA compilation configuration
cmake \
-GNinja \
-DPARAVIEW_USE_PYTHON=ON \
-DPARAVIEW_USE_MPI=ON \
-DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
-DPARAVIEW_ENABLE_VISITBRIDGE=ON \
-DCMAKE_BUILD_TYPE=Release ./paraview \
-DPARAVIEW_BUILD_QT_GUI=OFF \
-DVTK_USE_X=OFF \
-DOPENGL_INCLUDE_DIR=IGNORE \
-DOPENGL_xmesa_INCLUDE_DIR=IGNORE \
-DOPENGL_gl_LIBRARY=IGNORE \
-DOSMESA_INCLUDE_DIR=${InstallPath}/mesa-21.3.1/include \
-DOSMESA_LIBRARY=${InstallPath}/mesa/lib/x86_64-linux-gnu/libOSMesa.so \
-DVTK_OPENGL_HAS_OSMESA=ON \
-DVTK_USE_OFFSCREEN=OFF
# Compilation command
ninja
#--------------------------------------------#
However after the cmake command I get the following warning:
-- Enabled modules: VTK(155), ParaView(48 + 12)
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
OPENGL_INCLUDE_DIR
OPENGL_gl_LIBRARY
OPENGL_xmesa_INCLUDE_DIR
VTK_USE_OFFSCREEN
And the compilation crashes when using ninja after the following mensaje:
[1592/20515] Building C object VTK/ThirdParty/glew/vtkglew/CMakeFiles/glew.dir/src/glew.c.o
FAILED: VTK/ThirdParty/glew/vtkglew/CMakeFiles/glew.dir/src/glew.c.o
/usr/bin/cc -DGLEW_NO_GLU -DGLEW_OSMESA -Dglew_EXPORTS -IVTK/ThirdParty/glew/vtkglew -Iparaview/VTK/ThirdParty/glew/vtkglew -Iparaview/VTK/ThirdParty/glew/vtkglew/include -isystem VTK/ThirdParty/glew -isystem paraview/VTK/ThirdParty/glew -isystem mesa-21.3.1/include -O3 -DNDEBUG -fPIC -MD -MT VTK/ThirdParty/glew/vtkglew/CMakeFiles/glew.dir/src/glew.c.o -MF VTK/ThirdParty/glew/vtkglew/CMakeFiles/glew.dir/src/glew.c.o.d -o VTK/ThirdParty/glew/vtkglew/CMakeFiles/glew.dir/src/glew.c.o -c paraview/VTK/ThirdParty/glew/vtkglew/src/glew.c
paraview/VTK/ThirdParty/glew/vtkglew/src/glew.c:41:12: fatal error: GL/osmesa.h: No such file or directory
41 | # include <GL/osmesa.h>
| ^~~~~~~~~~~~~
compilation terminated.
[1605/20515] Building CXX object VTK/ThirdParty/jsoncpp/vtkjsoncpp/CMakeFiles/jsoncpp.dir/jsoncpp.cpp.o
ninja: build stopped: subcommand failed.
I think that the problem is linked with the fact that I should ignore the GL libraries but the flags that I put in the cmake command were not read.
Is there any updated guide to compile paraview almost from scratch?
Thank you in advance!