# How to Install VTKData-9.1.0 with CMake with Operating System: LFS

**URL:** https://discourse.vtk.org/t/how-to-install-vtkdata-9-1-0-with-cmake-with-operating-system-lfs/8226
**Category:** Support
**Created:** [April 6, 2022, 11:40pm UTC](https://discourse.vtk.org/t/how-to-install-vtkdata-9-1-0-with-cmake-with-operating-system-lfs/8226 "2022-04-06T23:40:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://discourse.vtk.org/user_avatar/discourse.vtk.org/freya_the_goddess/32/4942_2.png) [@Freya\_the\_Goddess](https://discourse.vtk.org/u/Freya_the_Goddess)
#### Post date: [April 6, 2022, 11:40pm UTC](https://discourse.vtk.org/t/how-to-install-vtkdata-9-1-0-with-cmake-with-operating-system-lfs/8226/1 "2022-04-06T23:40:38Z")

</div>

Hi all good day to you,

I have tried to use VTK but a bit confused. I am downloading the source files of

1. VTK-9.1.0.tar.gz
2. VTKData-9.1.0.tar.gz  
from this link [https://vtk.org/download/](https://vtk.org/download/)  
I use Linux From Scratch OS. Not Ubuntu or anything. So I build it from source.

I am able to make .ExternalData from the extracted VTKData-9.1.0 into the extracted directory of VTK-9.1.0, however when I do CMAKE there are no examples downloaded. Since VTKData-9.1.0 only contain SHA512 data without actual files that can be used.

Then, when I see the [VTKDataFiles-9.1.0.tar.gz](https://www.vtk.org/files/release/9.1/VTKDataFiles-9.1.0.tar.gz)  
It has folders and a lot of files. I want to make sure is VTKDataFiles-9.1.0 is the downloaded version of VTKData-9.1.0 ?

**This is my build scripts with CMake and Ninja:**  
_mkdir build &&_  
_cd build &&_  
cmake -GNinja   
-DCMAKE\_INSTALL\_PREFIX=/opt/hamzstlib/Vtk9   
-DVTK\_BUILD\_EXAMPLES=ON \  
-DBUILD\_SHARED\_LIBS=ON \  
-DCMAKE\_BUILD\_TYPE=Release \  
-DVTK\_ENABLE\_WRAPPING=ON \  
-DVTK\_DATA\_STORE=/sources/Hamzstlab/VTK-9.0.1/VtkData \  
-DVTK\_WRAP\_JAVA=ON \  
-DVTK\_WRAP\_PYTHON=ON \  
-DVTK\_USE\_TK=ON \  
-DVTK\_WHEEL\_BUILD=ON /sources/Hamzstlab/VTK-9.1.0   
_-Wno-dev … &&_  
_ninja_

Tell me what did I miss? Is using **CMake and make** is better? I tried building it multiple times and still not getting it right. When I call “vtk” it becomes bash: vtk command not found.

Lastly, based on experienced developers and users here, I want to know the best tools to try VTK examples is it using Python3 or C++?

 ![blfs-misc-36-12](https://discourse.vtk.org/uploads/default/original/2X/5/5a1e14bd1dc40d4c9494306a5c1be21767dccce8.png)

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [April 7, 2022, 12:19am UTC](https://discourse.vtk.org/t/how-to-install-vtkdata-9-1-0-with-cmake-with-operating-system-lfs/8226/2 "2022-04-07T00:19:23Z")

</div>

VTKData is really meant to pre-fill the cache for cmake when building tests so files could be found without individual download.

VTKDataFiles is basically the resolved version of VTKData.

If you want to test and play with VTK, it might be easier using Python by creating a virtual environment and running some examples from the Python section of that [website](https://kitware.github.io/vtk-examples/site/). That way you can skip the compilation part.

To get a virtual-env setup you can run the following

```bash
python3 -m venv vtk-venv
source ./vtk-venv/bin/activate
pip install -U pip
pip install vtk

```

Then run any python script like `python ./vtk-test-script.py`.

You can even try a [trame example](https://kitware.github.io/vtk-examples/site/Trame/Applications/FiniteElementAnalysis/FiniteElementAnalysis/) using that same venv. (just `pip install trame` though)

---

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://discourse.vtk.org/user_avatar/discourse.vtk.org/freya_the_goddess/32/4942_2.png) [@Freya\_the\_Goddess](https://discourse.vtk.org/u/Freya_the_Goddess)
#### Post date: [April 7, 2022, 9:39am UTC](https://discourse.vtk.org/t/how-to-install-vtkdata-9-1-0-with-cmake-with-operating-system-lfs/8226/3 "2022-04-07T09:39:46Z")

</div>

Thanks for the reply Sebastien,

I am new to VTK so apologize if my question is too trivial.

I have build VTK and I move the build folder into another place. Is that wrong?

I try the cxx example here:  
[https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/CylinderExample/](https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/CylinderExample/)

I couldn’t run the cmake to build the example. It triggers an error:

_Couldn’t find:_  
_VTKConfig.cmake_  
_VTK-config.cmake_  
_add the installation prefix of “VTK” to CMAKE\_PREFIX\_PATH_  
_set VTK\_DIR to the above files_

The weird things are there are no VTKConfig.cmake under the build directory after the compiling/building for VTK-9.1.0. So maybe my Cmake compiling scripts are wrong or lack some scripts? If I run “make install” it only install several vtkmodules and still no VTKConfig.cmake files in there.

I will try the Python example after this cxx.

Thank You.

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [April 7, 2022, 3:43pm UTC](https://discourse.vtk.org/t/how-to-install-vtkdata-9-1-0-with-cmake-with-operating-system-lfs/8226/4 "2022-04-07T15:43:47Z")

</div>

Yes build tree can not be relocated while install tree can.
