Building a code using Catalyst with cmake

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

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

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.

Indeed, that works. Thanks a lot!