# How to install VTK as a standalone package

**URL:** https://discourse.paraview.org/t/how-to-install-vtk-as-a-standalone-package/930
**Category:** ParaView Support
**Created:** [November 18, 2018, 11:55pm UTC](https://discourse.paraview.org/t/how-to-install-vtk-as-a-standalone-package/930 "2018-11-18T23:55:14Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![cbcoutinho](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cbcoutinho/32/291_2.png) [@cbcoutinho](https://discourse.paraview.org/u/cbcoutinho)
#### Post date: [November 18, 2018, 11:55pm UTC](https://discourse.paraview.org/t/how-to-install-vtk-as-a-standalone-package/930/1 "2018-11-18T23:55:14Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 19, 2018, 9:07am UTC](https://discourse.paraview.org/t/how-to-install-vtk-as-a-standalone-package/930/2 "2018-11-19T09:07:49Z")

</div>

> 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.

Not possible either.

If you need VTK, you should download/build VTK.

---

<div class="post-metadata">

### Author: ![cbcoutinho](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cbcoutinho/32/291_2.png) [@cbcoutinho](https://discourse.paraview.org/u/cbcoutinho)
#### Post date: [November 19, 2018, 11:12am UTC](https://discourse.paraview.org/t/how-to-install-vtk-as-a-standalone-package/930/3 "2018-11-19T11:12:56Z")

</div>

Thanks for the quick reply mwestphal – I’ll build VTK on my own.

Regards,

Chris

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 19, 2018, 12:35pm UTC](https://discourse.paraview.org/t/how-to-install-vtk-as-a-standalone-package/930/4 "2018-11-19T12:35:15Z")

</div>

You can also directly download a binary package here  
[https://www.vtk.org/download/](https://www.vtk.org/download/)

---

<div class="post-metadata">

### Author: ![Patrick](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/b2d939/32.png) [@Patrick](https://discourse.paraview.org/u/Patrick)
#### Post date: [November 20, 2018, 6:13am UTC](https://discourse.paraview.org/t/how-to-install-vtk-as-a-standalone-package/930/5 "2018-11-20T06:13:10Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![olesenm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olesenm/32/17416_2.png) [@olesenm](https://discourse.paraview.org/u/olesenm)
#### Post date: [November 20, 2018, 7:23am UTC](https://discourse.paraview.org/t/how-to-install-vtk-as-a-standalone-package/930/6 "2018-11-20T07:23:05Z")

</div>

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:

```auto
#define VTK_MAJOR_VERSION 8
#define VTK_MINOR_VERSION 2
#define VTK_BUILD_VERSION 0
#define VTK_VERSION "8.2.0"

```

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:

```auto
#-----------------------------------------------------------------------------
# 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()
#-----------------------------------------------------------------------------

```

And later on:

```auto
include(${VTK_USE_FILE})
...
target_link_libraries(
    myOwnTarget
    ${VTK_LIBRARIES}
    ${MYOWN_LIBRARIES}
)

```

Should I be concerned or doing something else? It doesn’t seem too terrible to me.

It would, however, be nice to have the includes are part of the standard binary package, but this is apparently not possible (see [https://discourse.paraview.org/t/clean-paraview-build-link-for-plugin-development/](https://discourse.paraview.org/t/clean-paraview-build-link-for-plugin-development/)).

/mark

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 20, 2018, 8:37am UTC](https://discourse.paraview.org/t/how-to-install-vtk-as-a-standalone-package/930/7 "2018-11-20T08:37:40Z")

</div>

> [@Patrick](#):
>
> Can we find a mapping anywhere, which VTK version is embedded in which ParaView version?  
> Or does ParaView’s VTK evolve independently?

There is no strict mapping. ParaView uses whatever hash of VTK to correspond to its need.  
If you are interested, please take a look here: [ParaView/Documentation/dev/git/develop.md at master · Kitware/ParaView · GitHub](https://github.com/Kitware/ParaView/blob/master/Documentation/dev/git/develop.md)

> 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.
