# Compiling Issue with ITKVtkGlue

**URL:** https://discourse.itk.org/t/compiling-issue-with-itkvtkglue/6304
**Category:** Beginner Questions
**Created:** [November 15, 2023, 12:54pm UTC](https://discourse.itk.org/t/compiling-issue-with-itkvtkglue/6304 "2023-11-15T12:54:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MartinHeller](https://discourse.itk.org/user_avatar/discourse.itk.org/martinheller/32/3769_2.png) [@MartinHeller](https://discourse.itk.org/u/MartinHeller)
#### Post date: [November 15, 2023, 12:54pm UTC](https://discourse.itk.org/t/compiling-issue-with-itkvtkglue/6304/1 "2023-11-15T12:54:04Z")

</div>

Hi everyone

I like to compile Plastimatch with ITK/VTK.

During the configuration, I got following error:

```auto
Plastimatch version is 1.9.4-49-g581c7692
CMake Error at //lib/cmake/ITK-5.3/Modules/ITKVtkGlue.cmake:16 (find_package):
   Could not find a package configuration file provided by "VTK" with any of
   the following names:

     VTKConfig.cmake
     vtk-config.cmake

   Add the installation prefix of "VTK" to CMAKE_PREFIX_PATH or set "VTK_DIR"
   to a directory containing one of the above files. If "VTK" provides a
   separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
   //lib/cmake/ITK-5.3/ITKModuleAPI.cmake:76 (include)
   //lib/cmake/ITK-5.3/ITKModuleAPI.cmake:31 (itk_module_load)
   //lib/cmake/ITK-5.3/ITKModuleAPI.cmake:129 (_itk_module_config_recurse)
   /lib/cmake/ITK-5.3/ITKConfig.cmake:88 (itk_module_config)
   CMakeLists.txt:585 (find_package)

Configuring incomplete, errors occurred!

```

My setup:  
OS: RHEL 8.8  
CMAKE: 3.20.2  
VTK: 9.0.1 (vtk-devel, from repo epel)  
ITK: 5.3.0 (source: [GitHub - InsightSoftwareConsortium/ITK: Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.](https://github.com/InsightSoftwareConsortium/ITK.git))  
`ccmake3 ../itk -DCMAKE_INSTALL_PREFIX=/ITK/itk-distrib -DBUILD_SHARED_LIBS=ON -DModule_ITKVtkGlue=ON -DModule_ITKReview=ON -DModule_SimpleITKFilters=ON -DCMAKE_BUILD_TYPE:STRING=Release`  
Cuda: 11.8.0  
gdcm: compiled from source  
dcmtk: compiled from source

I understand that this is the ITK-Forum. But since I got the issue from ITKVtkGlue, I tried first here.  
What should I consider if I try to deploy ITK (VTK) for Plastimatch?

Thanks a lot.

BR,  
Martin

---

<div class="post-metadata">

### Author: ![codeling](https://discourse.itk.org/user_avatar/discourse.itk.org/codeling/32/2214_2.png) [@codeling](https://discourse.itk.org/u/codeling)
#### Post date: [November 24, 2023, 1:23pm UTC](https://discourse.itk.org/t/compiling-issue-with-itkvtkglue/6304/2 "2023-11-24T13:23:10Z")

</div>

You can point the ITK build to VTK’s location by setting `VTK_DIR`, as the error suggests.

You could for example add it in your command line, as follows:

```auto
ccmake3 ../itk -DCMAKE_INSTALL_PREFIX=/ITK/itk-distrib -DBUILD_SHARED_LIBS=ON -DModule_ITKVtkGlue=ON -DModule_ITKReview=ON -DModule_SimpleITKFilters=ON -DCMAKE_BUILD_TYPE:STRING=Release -DVTK_DIR=/usr/lib64/cmake/vtk

```

As far as I can see, vtk-devel should install the cmake files into `/usr/lib64/cmake/vtk` (and `/usr/lib/cmake/vtk`) - check the output of `dnf repoquery -l vtk-devel | grep "vtk-config[.]cmake"` if that is not working for you.

---

<div class="post-metadata">

### Author: ![Gib](https://discourse.itk.org/user_avatar/discourse.itk.org/gib/32/4124_2.png) [@Gib](https://discourse.itk.org/u/Gib)
#### Post date: [June 8, 2024, 10:48pm UTC](https://discourse.itk.org/t/compiling-issue-with-itkvtkglue/6304/3 "2024-06-08T22:48:29Z")

</div>

I have a very similar problem, building (with VS 2010) a small program that uses ITK.  
VTK is installed at E:\VTK-VS10, I have the env variable VTK\_DIR set to this, and VTKConfig.cmake is in:  
VTK-VS10\lib\vtk-5.10. I added this line to CMakeLists.txt:

set (VTK\_DIR E:/VTK-VS10/lib/vtk-5.10)

but the error message is unchanged:

CMake Error at C:/ITK4.8.0/lib/cmake/ITK-4.8/Modules/ITKVtkGlue.cmake:9 (find\_package):  
Could not find a package configuration file provided by “VTK” with any of  
the following names:

```
VTKConfig.cmake
vtk-config.cmake

```

Add the installation prefix of “VTK” to CMAKE\_PREFIX\_PATH or set “VTK\_DIR”  
to a directory containing one of the above files. If “VTK” provides a  
separate development package or SDK, be sure it has been installed.
