# VTK-m: Installing VTK-m as a submodule of VTK

**URL:** https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668
**Category:** Support
**Created:** [June 29, 2020, 7:52pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668 "2020-06-29T19:52:51Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![McDave17](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mcdave17/32/1778_2.png) [@McDave17](https://discourse.vtk.org/u/McDave17)
#### Post date: [June 29, 2020, 7:52pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/1 "2020-06-29T19:52:51Z")

</div>

Hello,

On Linux Mint I checked out VTK-Releas branch via GIT and I imported the sub module for VTKm and build it via CMake, ensuring that vtkm and AcceleratorsVTKm are enabled. This is completed successfully. Anyhow, after running “make” and “make install” it does not seem to build the rendering libraries properly.  
When I set up a minimal CMake Project and set the VTK\_DIR to “/usr/local/lib/cmake/vtk-9.0” and the VTKm\_DIR to “/usr/local/lib/cmake/vtk-9.0/vtkm” it doesn’t build with an error message:

```
/home/david/Documents/minimal/main.cpp:7:10: fatal error: vtkm/rendering/Actor.h: No such file or directory
#include <vtkm/rendering/Actor.h>
         ^ ~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/minimal.dir/build.make:82: recipe for target 'CMakeFiles/minimal.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/minimal.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/minimal.dir/all' failed
make[1]: *** [CMakeFiles/minimal.dir/all] Error 2
Makefile:103: recipe for target 'all' failed
make: *** [all] Error 2

```

Since these are all the includes it seems strange that only the Actor.h fails:

```
#include <vtkm/cont/Initialize.h>
#include <vtkm/filter/Contour.h>
#include <vtkm/io/reader/VTKDataSetReader.h>
#include <vtkm/rendering/Actor.h>

```

In the src folder pulled via GIT the Actor.h is present, are there any options I’m unaware of for this to be included? Do I have to build VTKm separately and not as a sub module? Building it independently seems to throw other issues at me which I ran into a dead end with, also discussed on here.

Any further information I can provide I’m happy to.

Sincerely,  
David

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 30, 2020, 11:08am UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/2 "2020-06-30T11:08:29Z")

</div>

Hi, David,

> [@McDave17](#):
>
> VTKm\_DIR to “/usr/local/lib/cmake/vtk-9.0/vtkm”

If your code refers to `<vtkm/rendering/Actor.h>`, then I’d set `VTKm_DIR` to `/usr/local/lib/cmake/vtk-9.0`.

regards,

Paulo

---

<div class="post-metadata">

### Author: ![McDave17](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mcdave17/32/1778_2.png) [@McDave17](https://discourse.vtk.org/u/McDave17)
#### Post date: [June 30, 2020, 11:19am UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/3 "2020-06-30T11:19:34Z")

</div>

Hi Paulo,

When I try to set the directory to `/usr/local/lib/cmake/vtk-9.0` and I configure/generate it automatically resets it to `/usr/local/lib/cmake/vtk-9.0/vtkm`.

Thank you,  
David

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 30, 2020, 12:47pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/4 "2020-06-30T12:47:06Z")

</div>

Then it’s a CMake issue. I guess you have to ask why it resets your settings in its community.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 30, 2020, 12:51pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/5 "2020-06-30T12:51:26Z")

</div>

It won’t compile because the preprocessor is expecting this path: `/usr/local/lib/cmake/vtk-9.0/vtkm/vtkm/rendering/Actor.h` (notice the double `vtkm`). Maybe you can try creating a symbolic link in `/usr/local/lib/cmake/vtk-9.0/vtkm` called `vtkm` that points to `/usr/local/lib/cmake/vtk-9.0/vtkm/`. Ugly, but it’ll likely work around your issue.

Perhaps you can change CMakeLists.txt of your project to use VTK\_DIR instead of VTKm\_DIR to find the VTKm headers…

---

<div class="post-metadata">

### Author: ![McDave17](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mcdave17/32/1778_2.png) [@McDave17](https://discourse.vtk.org/u/McDave17)
#### Post date: [June 30, 2020, 1:20pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/6 "2020-06-30T13:20:37Z")

</div>

I tried that, no luck though.  
This is what you meant, right?

```
david@david-mint:/usr/local/lib/cmake/vtk-9.0/vtkm$ ll
total 36
drwxr-xr-x 3 root root 4096 Jun 30 15:12 ./
drwxr-xr-x 4 root root 4096 Jun 30 11:26 ../
drwxr-xr-x 2 root root 4096 Jun 29 19:34 cmake/
lrwxrwxrwx 1 root root 34 Jun 30 15:12 vtkm -> /usr/local/lib/cmake/vtk-9.0/vtkm/
-rw-r--r-- 1 root root 5844 Jun 29 19:12 VTKmConfig.cmake
-rw-r--r-- 1 root root 1830 Jun 29 19:12 VTKmConfigVersion.cmake
-rw-r--r-- 1 root root 6823 Jun 29 19:22 VTKmTargets.cmake
-rw-r--r-- 1 root root 2161 Jun 30 11:15 VTKmTargets-debug.cmake

```

Why would only the rendering libs not load? `<vtkm/filter/Contour.h>` for example works fine.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 30, 2020, 1:28pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/7 "2020-06-30T13:28:47Z")

</div>

That path is odd. It doesn’t seem to be a valid include path. I’d expect something like `/usr/local/include/vtk-9.0` .

---

<div class="post-metadata">

### Author: ![McDave17](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mcdave17/32/1778_2.png) [@McDave17](https://discourse.vtk.org/u/McDave17)
#### Post date: [June 30, 2020, 1:38pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/8 "2020-06-30T13:38:46Z")

</div>

When linking like this:

```
david@david-mint:/usr/local/lib/cmake/vtk-9.0/vtkm$ ll
total 36
drwxr-xr-x 3 root root 4096 Jun 30 15:35 ./
drwxr-xr-x 4 root root 4096 Jun 30 11:26 ../
drwxr-xr-x 2 root root 4096 Jun 29 19:34 cmake/
lrwxrwxrwx 1 root root 26 Jun 30 15:35 vtkm -> /usr/local/include/vtk-9.0/
-rw-r--r-- 1 root root 5844 Jun 29 19:12 VTKmConfig.cmake
-rw-r--r-- 1 root root 1830 Jun 29 19:12 VTKmConfigVersion.cmake
-rw-r--r-- 1 root root 6823 Jun 29 19:22 VTKmTargets.cmake
-rw-r--r-- 1 root root 2161 Jun 30 11:15 VTKmTargets-debug.cmake

```

Make fails with a new error: “Too many levels of symbolic links”

```
/home/david/Documents/minimal/main.cpp:1:10: fatal error: /usr/local/include/vtk-9.0/vtkm/cont/Initialize.h: Too many levels of symbolic links
 #include <vtkm/cont/Initialize.h>
          ^ ~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMakeFiles/minimal.dir/build.make:82: recipe for target 'CMakeFiles/minimal.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/minimal.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/minimal.dir/all' failed
make[1]: *** [CMakeFiles/minimal.dir/all] Error 2
Makefile:103: recipe for target 'all' failed
make: *** [all] Error 2
```

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 30, 2020, 2:08pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/9 "2020-06-30T14:08:04Z")

</div>

Maybe it’s better to remove the symlink. My bad.

---

<div class="post-metadata">

### Author: ![McDave17](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mcdave17/32/1778_2.png) [@McDave17](https://discourse.vtk.org/u/McDave17)
#### Post date: [June 30, 2020, 2:16pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/10 "2020-06-30T14:16:33Z")

</div>

Can it be that the rendering libraries are not even build when installing via VTK?

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 30, 2020, 5:08pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/11 "2020-06-30T17:08:58Z")

</div>

Well, you said you built VTK successfully. Did you do a `make install` after building?

---

<div class="post-metadata">

### Author: ![McDave17](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mcdave17/32/1778_2.png) [@McDave17](https://discourse.vtk.org/u/McDave17)
#### Post date: [June 30, 2020, 6:23pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/12 "2020-06-30T18:23:03Z")

</div>

Yes I did do that. `sudo make install -j8`

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [June 30, 2020, 6:36pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/13 "2020-06-30T18:36:05Z")

</div>

Where is the `vtkm/rendering/Actor.h` file? Do a `find /usr -name "*Actor.h"`.

---

<div class="post-metadata">

### Author: ![McDave17](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mcdave17/32/1778_2.png) [@McDave17](https://discourse.vtk.org/u/McDave17)
#### Post date: [July 1, 2020, 1:10pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/14 "2020-07-01T13:10:18Z")

</div>

This would be the result of that:

```
**david@david-mint** : **~** $ find /usr -name "*Actor.h"
/usr/local/include/vtk-9.0/vtkOpenGLActor.h
/usr/local/include/vtk-9.0/vtkContextActor.h
/usr/local/include/vtk-9.0/vtkParallelCoordinatesActor.h
/usr/local/include/vtk-9.0/vtkBarChartActor.h
/usr/local/include/vtk-9.0/vtkScaledTextActor.h
/usr/local/include/vtk-9.0/vtkQuadricLODActor.h
/usr/local/include/vtk-9.0/vtkXYPlotActor.h
/usr/local/include/vtk-9.0/vtkAxesActor.h
/usr/local/include/vtk-9.0/vtkAxisActor.h
/usr/local/include/vtk-9.0/vtkSpiderPlotActor.h
/usr/local/include/vtk-9.0/vtkLightActor.h
/usr/local/include/vtk-9.0/vtkCubeAxesActor.h
/usr/local/include/vtk-9.0/vtkAnnotatedCubeActor.h
/usr/local/include/vtk-9.0/vtkPolarAxesActor.h
/usr/local/include/vtk-9.0/vtkLODActor.h
/usr/local/include/vtk-9.0/vtkLegendBoxActor.h
/usr/local/include/vtk-9.0/vtkPieChartActor.h
/usr/local/include/vtk-9.0/vtkLegendScaleActor.h
/usr/local/include/vtk-9.0/vtkCameraActor.h
/usr/local/include/vtk-9.0/vtkActor.h
/usr/local/include/vtk-9.0/vtkResliceCursorActor.h
/usr/local/include/vtk-9.0/vtkInteractorStyleTrackballActor.h
/usr/local/include/vtk-9.0/vtkImageActor.h
/usr/local/include/vtk-9.0/vtkTextActor.h
/usr/local/include/vtk-9.0/vtkScalarBarActor.h
/usr/local/include/vtk-9.0/vtkInteractorStyleJoystickActor.h
/usr/local/include/vtk-9.0/vtkOpenGLTextActor.h
/usr/local/include/vtkm-1.5/vtkm/rendering/Actor.h
```

The last line is from the standalone installation I tried. But the standalone doesn’t work for me because I need certain includes from VTK.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [July 1, 2020, 1:19pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/15 "2020-07-01T13:19:58Z")

</div>

So, how is VTKm install dir configured in the CMake of your program?

---

<div class="post-metadata">

### Author: ![McDave17](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mcdave17/32/1778_2.png) [@McDave17](https://discourse.vtk.org/u/McDave17)
#### Post date: [July 1, 2020, 3:31pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/16 "2020-07-01T15:31:30Z")

</div>

To /usr/local/include/vtk-9.0/vtkm

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [July 1, 2020, 4:54pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/17 "2020-07-01T16:54:16Z")

</div>

Hence you need to set it to `/usr/local/include/vtkm-1.5`.

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [July 1, 2020, 4:56pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/18 "2020-07-01T16:56:24Z")

</div>

Notice that I asked for the **install dir** , not where VTKm’s `CMakeLists.txt` is.

---

<div class="post-metadata">

### Author: ![McDave17](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mcdave17/32/1778_2.png) [@McDave17](https://discourse.vtk.org/u/McDave17)
#### Post date: [July 1, 2020, 6:02pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/19 "2020-07-01T18:02:12Z")

</div>

Yes I understood that, thank you for your help up until now. The problem is, when I set up a minimal project which requires both VTK and VTKm the includes work but my program crashes.

Example:

CMake:  
VTK\_DIR = `/usr/local/lib/cmake/vtk-9.0`  
VTKm\_DIR = `/usr/local/lib/cmake/vtkm-1.5`

main.cpp:

```
#include <vtkm/cont/Initialize.h>
#include <vtkm/io/reader/VTKDataSetReader.h>
#include <vtkm/filter/Contour.h>
#include <vtkm/rendering/Actor.h>

int main(int argc, char *argv[]) {
    vtkm::cont::Initialize();

    vtkm::io::reader::VTKDataSetReader reader("/home/david/Documents/magField.vtk");
    vtkm::cont::DataSet inData = reader.ReadDataSet();

	vtkm::filter::Contour contour;
    contour.SetActiveField("vec");
	contour.SetIsoValue(-1, 1);
    vtkm::cont::DataSet outData = contour.Execute(inData);

	vtkm::rendering::Actor actor(
    	outData.GetCellSet(),
	    outData.GetCoordinateSystem(),
		outData.GetField("vec")
    );

	return 0;
}

```

Output is following:

```
**david@david-mint** : **~/Documents/minimal/bin** $ ./minimal **Loguru caught a signal: SIGSEGV** Segmentation fault (core dumped)
```

That’s why I tried installing VTKm via VTK by enabling the CMake options to include VTKm. I thought it might help preventing a SEGV, but when I do that, and then therefore build with `/usr/local/lib/cmake/vtk-9.0/vtkm` instead of `/usr/local/lib/cmake/vtkm-1.5` the compiler fails to include actor.h. What I can’t get my head around is why only this functions when I use vtkm::filter::Contour but comment out the actor.

May it be woth Converting the DataSet back to VTK? How hard could it be to convert the result of contour.Execute(inData) to a VTK DataSet instead of VTKm?

Thank you for your time,  
David

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [July 1, 2020, 6:16pm UTC](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668/20 "2020-07-01T18:16:54Z")

</div>

Please, compile this and run. Does it crash?

```auto
#include <vtkm/cont/Initialize.h>
#include <vtkm/io/reader/VTKDataSetReader.h>
#include <vtkm/filter/Contour.h>
#include <vtkm/rendering/Actor.h>

int main(int argc, char *argv[]) {
	return 0;
}

```

[Next page](https://discourse.vtk.org/t/vtk-m-installing-vtk-m-as-a-submodule-of-vtk/3668.md?page=2)
