# Building a code using Catalyst with cmake

**URL:** https://discourse.paraview.org/t/building-a-code-using-catalyst-with-cmake/595
**Category:** In Situ Support
**Created:** [September 18, 2018, 3:37pm UTC](https://discourse.paraview.org/t/building-a-code-using-catalyst-with-cmake/595 "2018-09-18T15:37:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mdorier](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@mdorier](https://discourse.paraview.org/u/mdorier)
#### Post date: [September 18, 2018, 3:37pm UTC](https://discourse.paraview.org/t/building-a-code-using-catalyst-with-cmake/595/1 "2018-09-18T15:37:33Z")

</div>

Hi,

I’m having troubles building a code that uses Catalyst. The code is built with cmake, so its CMakeLists.txt file has the following:

```
if(ENABLE_CATALYST)
  find_package(ParaView 4.3 REQUIRED COMPONENTS vtkPVPythonCatalyst)
  include("${PARAVIEW_USE_FILE}")
  set(HAVE_PARAVIEW_ENABLED 1)
  set(PARAVIEW_LIBRARIES "vtkPVPythonCatalyst;vtkParallelMPI")
  list(APPEND DEP_LIBRARIES ${PARAVIEW_LIBRARIES})
  add_definitions("-DUSE_CATALYST")
endif(ENABLE_CATALYST)

```

For this to work, apparently, I need to have `-DParaView_DIR=<path/to/directory/containing/ParaViewConfig.cmake>` when calling cmake.

I installed Catalyst 5.6.0 by downloading the Catalyst-v5.6.0-RC1-Base-Enable-Python-Essentials-Extras-Rendering-Base.tar.gz archive, untaring it, then calling the cmake.sh script as follows from a “build” directory:

`./cmake.sh ../Catalyst-v5.6.0-RC1-Base-Enable-Python-Essentials-Extras-Rendering-Base -DCMAKE_INSTALL_PREFIX=$HOME/catalyst`

Then calling `make` and `make install`.

When I try to build my code by using `-DParaView_DIR=$HOME/catalyst` this doesn’t work, because the folder where Catalyst was installed apparently doesn’t contain `ParaViewConfig.cmake`. I searched within subfolder but couldn’t find it. This file however is present in the build directory, so I copy-pasted it into the install directory.  
This didn’t work either: now cmake had another complaint:

```
CMake Error at /home/mdorier/catalyst-build/VTK/VTKConfig.cmake:114 (include):
  include could not find load file:

    /home/mdorier/Catalyst-v5.6.0-RC1-Base-Enable-Python-Essentials-Extras-Rendering-Base/VTK/CMake/vtkModuleAPI.cmake

```

This happened because I removed the source folder. Putting the source folder back made everything work fine.

That being said, it’s not great to have to keep the source folder and the build folder in addition to the install folder just for cmake to be able to find ParaView.

Is there something I’m doing wrong or should this be improved?

Thanks

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [September 19, 2018, 6:44pm UTC](https://discourse.paraview.org/t/building-a-code-using-catalyst-with-cmake/595/2 "2018-09-19T18:44:36Z")

</div>

You are on the right path `ParaView_DIR` should indeed be set to the dir containing `ParaViewConfig.cmake`. However, it’s not expected in the Catalyst subfolder it will be `$HOME/catalyst/lib/cmake/paraview-5.6/`.

Here’s what I did on my install of the same 5.6.0-RC1 catalyst source

```auto
find . | grep Config.cmake
./lib/IceTConfig.cmake
./lib/cmake/paraview-5.6/VTKConfig.cmake
./lib/cmake/paraview-5.6/ParaViewConfig.cmake

```

Setting `-DParaView_DIR=$HOME/catalyst/lib/cmake/paraview-5.6` should do the trick.

---

<div class="post-metadata">

### Author: ![mdorier](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/eb9ed0/32.png) [@mdorier](https://discourse.paraview.org/u/mdorier)
#### Post date: [September 20, 2018, 10:11pm UTC](https://discourse.paraview.org/t/building-a-code-using-catalyst-with-cmake/595/3 "2018-09-20T22:11:40Z")

</div>

Indeed, that works. Thanks a lot!
