I’m interested in building a project that embeds some visualization into a simple gui using VTK, for which I need to have the VTK development libraries/headers installed. Is it possible to link to the VTK libraries that are installed with ParaView? I noticed that PV installs all of the VTK libraries with a -pv5.6 suffix, which is makes it difficult to link to with other programs.
I guess instead of fixing the ParaView VTK, I’m assuming another option would be to build VTK first and then ParaView where to look for VTK instead of using the current git submodule setup.
Is one of these two options possible?
These are all being built using a recent git checkout of ParaView on a Linux system
Is it possible to link to the VTK libraries that are installed with ParaView?
No, it is not.
I guess instead of fixing the ParaView VTK, I’m assuming another option would be to build VTK first and then ParaView where to look for VTK instead of using the current git submodule setup.
Can we find a mapping anywhere, which VTK version is embedded in which ParaView version?
Or does ParaView’s VTK evolve independently?
Why can’t ParaView simply use VTK libraries as a dependency? ParaView seems to do everything as complicated as possible, so that nobody grasps its design, including the ParaView developers.
If you compile ParaView from source with -DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON this will install the include files as well as the libraries. You can use these for your VTK libraries.
The include/paraview-5.6/vtkVersionMacros.h includes this type of information:
I’m not really sure what you mean about linkage issues. I’ve never really bothered much there. I’ve just used this sort of thing:
#-----------------------------------------------------------------------------
# Simple discovery and sanity checks
if (EXISTS "$ENV{VTK_DIR}")
message("Building with VTK from $ENV{VTK_DIR}")
find_package(VTK REQUIRED HINTS $ENV{VTK_DIR})
include(${VTK_USE_FILE})
elseif (EXISTS "$ENV{ParaView_DIR}")
message("Building with Paraview from $ENV{ParaView_DIR}")
find_package(ParaView REQUIRED HINTS $ENV{ParaView_DIR})
include(${VTK_USE_FILE})
set(
VTK_VERSION
"${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}"
)
else()
message(FATAL_ERROR "VTK not found using VTK_DIR or ParaView_DIR")
endif()
#-----------------------------------------------------------------------------
Why can’t ParaView simply use VTK libraries as a dependency?
Because our VTK needs are too specific, some options need to be correctly set when building VTK.
@olesenm : It is indeed possible to use the build VTK inside of ParaView, but it does require to change the CMakeLists.txt of the project needing VTK, and not all of VTK is build by ParaView, so some projects may not work at all. We do not recommend it.