# Issue detecting build configuration with legacy Catalyst with CMake versions 3.23 and above.

**URL:** https://discourse.paraview.org/t/issue-detecting-build-configuration-with-legacy-catalyst-with-cmake-versions-3-23-and-above/11059
**Category:** In Situ Support
**Created:** [December 22, 2022, 1:07am UTC](https://discourse.paraview.org/t/issue-detecting-build-configuration-with-legacy-catalyst-with-cmake-versions-3-23-and-above/11059 "2022-12-22T01:07:51Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![YvanFournier](https://discourse.paraview.org/user_avatar/discourse.paraview.org/yvanfournier/32/2876_2.png) [@YvanFournier](https://discourse.paraview.org/u/YvanFournier)
#### Post date: [December 22, 2022, 1:07am UTC](https://discourse.paraview.org/t/issue-detecting-build-configuration-with-legacy-catalyst-with-cmake-versions-3-23-and-above/11059/1 "2022-12-22T01:07:51Z")

</div>

Hello,

For legacy Catalyst support in EDF’s code\_saturne tool, we generate a test project, using:  
`cmake -DCMAKE_MODULE_PATH=<paraview_prefix_path> <mini_project_dir>`

Where the `mini_project_dir` contains a CMakeLists.txt and CoProcessingTest.cxx files, as per [https://github.com/code-saturne/code\_saturne/tree/master/build-aux/catalyst](https://github.com/code-saturne/code_saturne/tree/master/build-aux/catalyst).

With CMake 3.22 and below, I get some warnings, but mostly working code, with the following output

> /home/D43345/usr/bin/cmake -DCMAKE\_PREFIX\_PATH=/home/D43345/opt/paraview-5.11/scibian10\_egl -DCMAKE\_MODULE\_PATH=/home/D43345/opt/paraview-5.11/scibian10\_egl ~/test/cmake/catalyst  
> – The CXX compiler identification is GNU 8.3.0  
> – The C compiler identification is GNU 8.3.0  
> – Detecting CXX compiler ABI info  
> – Detecting CXX compiler ABI info - done  
> – Check for working CXX compiler: /usr/bin/c++ - skipped  
> – Detecting CXX compile features  
> – Detecting CXX compile features - done  
> – Detecting C compiler ABI info  
> – Detecting C compiler ABI info - done  
> – Check for working C compiler: /usr/bin/cc - skipped  
> – Detecting C compile features  
> – Detecting C compile features - done  
> – Found MPI\_C: /usr/lib/x86\_64-linux-gnu/openmpi/lib/libmpi.so (found version “3.1”)  
> – Found MPI\_CXX: /usr/lib/x86\_64-linux-gnu/openmpi/lib/libmpi\_cxx.so (found version “3.1”)  
> – Found MPI: TRUE (found version “3.1”) found components: C CXX  
> – Looking for pthread.h  
> – Looking for pthread.h - found  
> – Performing Test CMAKE\_HAVE\_LIBC\_PTHREAD  
> – Performing Test CMAKE\_HAVE\_LIBC\_PTHREAD - Failed  
> – Looking for pthread\_create in pthreads  
> – Looking for pthread\_create in pthreads - not found  
> – Looking for pthread\_create in pthread  
> – Looking for pthread\_create in pthread - found  
> – Found Threads: TRUE  
> – Could NOT find TBB (missing: TBB\_DIR)  
> CMake Warning at /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/ParFlow-vtk-module-find-packages.cmake:115 (find\_package):  
> By not providing “Findnlohmann\_json.cmake” in CMAKE\_MODULE\_PATH this  
> project has asked CMake to find a package configuration file provided by  
> “nlohmann\_json”, but CMake did not find one.
> 
> Could not find a package configuration file provided by “nlohmann\_json”  
> with any of the following names:
> 
> ```
> nlohmann_jsonConfig.cmake
> nlohmann_json-config.cmake
> 
> ```
> 
> Add the installation prefix of “nlohmann\_json” to CMAKE\_PREFIX\_PATH or set  
> “nlohmann\_json\_DIR” to a directory containing one of the above files. If  
> “nlohmann\_json” provides a separate development package or SDK, be sure it  
> has been installed.  
> Call Stack (most recent call first):  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/ParaViewPlugins-paraview\_plugins-targets-depends.cmake:246 (include)  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/paraview-config.cmake:92 (include)  
> CMakeLists.txt:6 (find\_package)
> 
> – Could not find the ParFlow package due to a missing dependency: nlohmann\_json  
> – Found MPI: TRUE (found version “3.1”) found components: C  
> – Found Python3: /usr/bin/python3.7 (found suitable version “3.7.3”, minimum required is “3.7”) found components: Interpreter Development.Module Development.Embed  
> – Found ZLIB: /usr/lib/x86\_64-linux-gnu/libz.so (found version “1.2.11”)  
> – Could NOT find TBB (missing: TBB\_DIR)  
> – Configuring done  
> – Generating done  
> – Build files have been written to: /home/D43345/test/cmake/build

I can then use the generated project to extract compile and link flags.

With CMake 3.23 and above, I get:

> /home/D43345/opt/cmake-3.25/bin/cmake -DCMAKE\_PREFIX\_PATH=/home/D43345/opt/paraview-5.11/scibian10\_egl -DCMAKE\_MODULE\_PATH=/home/D43345/opt/paraview-5.11/scibian10\_egl ~/test/cmake/mini  
> – The CXX compiler identification is GNU 8.3.0  
> – The C compiler identification is GNU 8.3.0  
> – Detecting CXX compiler ABI info  
> – Detecting CXX compiler ABI info - done  
> – Check for working CXX compiler: /usr/bin/c++ - skipped  
> – Detecting CXX compile features  
> – Detecting CXX compile features - done  
> – Detecting C compiler ABI info  
> – Detecting C compiler ABI info - done  
> – Check for working C compiler: /usr/bin/cc - skipped  
> – Detecting C compile features  
> – Detecting C compile features - done  
> – Found MPI\_C: /usr/lib/x86\_64-linux-gnu/openmpi/lib/libmpi.so (found version “3.1”)  
> – Found MPI\_CXX: /usr/lib/x86\_64-linux-gnu/openmpi/lib/libmpi\_cxx.so (found version “3.1”)  
> – Found MPI: TRUE (found version “3.1”) found components: C CXX  
> – Performing Test CMAKE\_HAVE\_LIBC\_PTHREAD  
> – Performing Test CMAKE\_HAVE\_LIBC\_PTHREAD - Failed  
> – Looking for pthread\_create in pthreads  
> – Looking for pthread\_create in pthreads - not found  
> – Looking for pthread\_create in pthread  
> – Looking for pthread\_create in pthread - found  
> – Found Threads: TRUE  
> – Could NOT find TBB (missing: TBB\_DIR)  
> CMake Warning at /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/ParFlow-vtk-module-find-packages.cmake:115 (find\_package):  
> By not providing “Findnlohmann\_json.cmake” in CMAKE\_MODULE\_PATH this  
> project has asked CMake to find a package configuration file provided by  
> “nlohmann\_json”, but CMake did not find one.
> 
> Could not find a package configuration file provided by “nlohmann\_json”  
> with any of the following names:
> 
> ```
> nlohmann_jsonConfig.cmake
> nlohmann_json-config.cmake
> 
> ```
> 
> Add the installation prefix of “nlohmann\_json” to CMAKE\_PREFIX\_PATH or set  
> “nlohmann\_json\_DIR” to a directory containing one of the above files. If  
> “nlohmann\_json” provides a separate development package or SDK, be sure it  
> has been installed.  
> Call Stack (most recent call first):  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/ParaViewPlugins-paraview\_plugins-targets-depends.cmake:246 (include)  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/paraview-config.cmake:92 (include)  
> CMakeLists.txt:6 (find\_package)
> 
> – Could not find the ParFlow package due to a missing dependency: nlohmann\_json  
> CMake Error at /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/vtk/VTK-vtk-module-find-packages.cmake:162 (find\_package):  
> By not providing “Findospray.cmake” in CMAKE\_MODULE\_PATH this project has  
> asked CMake to find a package configuration file provided by “ospray”, but  
> CMake did not find one.
> 
> Could not find a package configuration file provided by “ospray” (requested  
> version 2.1) with any of the following names:
> 
> ```
> osprayConfig.cmake
> ospray-config.cmake
> 
> ```
> 
> Add the installation prefix of “ospray” to CMAKE\_PREFIX\_PATH or set  
> “ospray\_DIR” to a directory containing one of the above files. If “ospray”  
> provides a separate development package or SDK, be sure it has been  
> installed.  
> Call Stack (most recent call first):  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/vtk/vtk-config.cmake:152 (include)  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/paraview-config.cmake:170 (find\_package)  
> CMakeLists.txt:6 (find\_package)
> 
> – Configuring incomplete, errors occurred!  
> See also “/home/D43345/test/cmake/build/CMakeFiles/CMakeOutput.log”.  
> See also “/home/D43345/test/cmake/build/CMakeFiles/CMakeError.log”.

The mentioned logs are low level and actually contain similar information in both cases, so provide no additional information here.

Part of the issue seems to be related to building Ospray and Embree using ParaView Superbuild, which does not install the relevant cmake directories in lib even when installing the SDK (it only does so for ParaView itself). This was not an apparent issue for CMake 2.22 though (all the libraries are in a same directory, and the project does not need to access the matching low-level headers).

Copying missing cmake files, headers, and some library symbolic links from the superbuild’s `install` directory to the ParView install directory, I still get an issue for other packages:

> /home/D43345/opt/cmake-3.25/bin/cmake -DCMAKE\_PREFIX\_PATH=/home/D43345/opt/paraview-5.11/scibian10\_egl ~/test/cmake/catalyst/  
> – The CXX compiler identification is GNU 8.3.0  
> – The C compiler identification is GNU 8.3.0  
> – Detecting CXX compiler ABI info  
> – Detecting CXX compiler ABI info - done  
> – Check for working CXX compiler: /usr/bin/c++ - skipped  
> – Detecting CXX compile features  
> – Detecting CXX compile features - done  
> – Detecting C compiler ABI info  
> – Detecting C compiler ABI info - done  
> – Check for working C compiler: /usr/bin/cc - skipped  
> – Detecting C compile features  
> – Detecting C compile features - done  
> – Found MPI\_C: /usr/lib/x86\_64-linux-gnu/openmpi/lib/libmpi.so (found version “3.1”)  
> – Found MPI\_CXX: /usr/lib/x86\_64-linux-gnu/openmpi/lib/libmpi\_cxx.so (found version “3.1”)  
> – Found MPI: TRUE (found version “3.1”) found components: C CXX  
> – Performing Test CMAKE\_HAVE\_LIBC\_PTHREAD  
> – Performing Test CMAKE\_HAVE\_LIBC\_PTHREAD - Failed  
> – Looking for pthread\_create in pthreads  
> – Looking for pthread\_create in pthreads - not found  
> – Looking for pthread\_create in pthread  
> – Looking for pthread\_create in pthread - found  
> – Found Threads: TRUE  
> – Found nlohmann\_json: /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/nlohmann\_json/nlohmann\_jsonConfig.cmake (found version “3.9.1”)  
> – Found MPI: TRUE (found version “3.1”) found components: C  
> – Found Python3: /usr/bin/python3.7 (found suitable version “3.7.3”, minimum required is “3.7”) found components: Interpreter Development.Module Development.Embed  
> – Found ZLIB: /usr/lib/x86\_64-linux-gnu/libz.so (found version “1.2.11”)  
> – Configuring done  
> CMake Error at /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/vtk/VTK-targets.cmake:582 (set\_target\_properties):  
> The link interface of target “VTK::opengl” contains:
> 
> ```
> OpenGL::OpenGL
> 
> ```
> 
> but the target was not found. Possible reasons include:
> 
> ```
> * There is a typo in the target name.
> * A find_package call is missing for an IMPORTED target.
> * An ALIAS target is missing.
> 
> ```
> 
> Call Stack (most recent call first):  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/vtk/vtk-config.cmake:138 (include)  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/paraview-config.cmake:66 (find\_package)  
> CMakeLists.txt:6 (find\_package)
> 
> CMake Error at /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/vtk/VTK-targets.cmake:730 (set\_target\_properties):  
> The link interface of target “VTK::RenderingRayTracing” contains:
> 
> ```
> ospray::ospray
> 
> ```
> 
> but the target was not found. Possible reasons include:
> 
> ```
> * There is a typo in the target name.
> * A find_package call is missing for an IMPORTED target.
> * An ALIAS target is missing.
> 
> ```
> 
> Call Stack (most recent call first):  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/vtk/vtk-config.cmake:138 (include)  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/paraview-config.cmake:66 (find\_package)  
> CMakeLists.txt:6 (find\_package)
> 
> CMake Error at /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/vtk/VTK-targets.cmake:1316 (set\_target\_properties):  
> The link interface of target “VTK::IOCatalystConduit” contains:
> 
> ```
> catalyst::catalyst
> 
> ```
> 
> but the target was not found. Possible reasons include:
> 
> ```
> * There is a typo in the target name.
> * A find_package call is missing for an IMPORTED target.
> * An ALIAS target is missing.
> 
> ```
> 
> Call Stack (most recent call first):  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/vtk/vtk-config.cmake:138 (include)  
> /home/D43345/opt/paraview-5.11/scibian10\_egl/lib/cmake/paraview-5.11/paraview-config.cmake:66 (find\_package)  
> CMakeLists.txt:6 (find\_package)
> 
> – Generating done  
> CMake Generate step failed. Build files cannot be regenerated correctly.

So there are 2 issues here:

- Superbuild only installs the ParaView SDK, not those of prerequisites, which is not enough
- CMake does not simply provide warnings about system libraries which do not have associated `.cmake` files anymore, but fails when searching for such libraries.

The first issue I can work around using a 2 step install, using Superbuild only for the prerequisites, then installing ParaView (or inserting a copy between SuperBuild’s “make” and “make install”.

The second issue, which did not occur prior to CMake 3.23, I do not know how to handle. I did not see anything in the 3.23 release notes which seems relevant, so I guess I missed something.

I won’t have this issue with Catalyst 2 (using a simpler build), but I have only gotten started, and need to support our legacy adapter for some time. Sticking with an old CMake does not seem the right way to handle this…

---

<div class="post-metadata">

### Author: ![YvanFournier](https://discourse.paraview.org/user_avatar/discourse.paraview.org/yvanfournier/32/2876_2.png) [@YvanFournier](https://discourse.paraview.org/u/YvanFournier)
#### Post date: [December 22, 2022, 1:52am UTC](https://discourse.paraview.org/t/issue-detecting-build-configuration-with-legacy-catalyst-with-cmake-versions-3-23-and-above/11059/2 "2022-12-22T01:52:05Z")

</div>

Addendum: by bisection, I can see that the line in CMakeLists leading to the cascade of errors is the one containing:  
`ParaView::PythonCatalyst`

In the

```auto
target_link_libraries(CoProcessingTest
  PRIVATE

```

Section. Lower level VTK dependencies seem OK.

Also, I have the same issue using CMake with the `Examples/Catalyst` directory of the PAraView source tree itself. So I guess there may be some configuration or command-line option to solve this, but I can’t find which.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 22, 2022, 7:36am UTC](https://discourse.paraview.org/t/issue-detecting-build-configuration-with-legacy-catalyst-with-cmake-versions-3-23-and-above/11059/3 "2022-12-22T07:36:48Z")

</div>

FYI @Charles_Gueunet @nicolas.vuaille @Francois_Mazen

Hi @YvanFournier ,

Which version of the superbuild and ParaView are you trying to build exactly ?

Best,

---

<div class="post-metadata">

### Author: ![YvanFournier](https://discourse.paraview.org/user_avatar/discourse.paraview.org/yvanfournier/32/2876_2.png) [@YvanFournier](https://discourse.paraview.org/u/YvanFournier)
#### Post date: [December 22, 2022, 10:12am UTC](https://discourse.paraview.org/t/issue-detecting-build-configuration-with-legacy-catalyst-with-cmake-versions-3-23-and-above/11059/4 "2022-12-22T10:12:54Z")

</div>

Hello @Mathieu Westphal, @Charles_Gueunet @nicolas.vuaille @Francois_Mazen,  
I’m trying to build ParaView 5.11 (using the 5.11.0 tag on the Superbuild).  
But I also reproduce it with my ParaView 5.9 or intermediate version builds, or a ParaView 5.11 buiild from SALOME 9.10, as soon as as use CMake 3.23 or above to build the project based on ParaView.

I had initially encountered this type error earlier, using ParaView 5.9 on a different machine, but thought it might be a packaging issue. Seeing that the same issue occurs with CMake 3.24 (binary from SALOME) or 3.25 (my local build), this seems to be due to some change in CMake.

---

<div class="post-metadata">

### Author: ![YvanFournier](https://discourse.paraview.org/user_avatar/discourse.paraview.org/yvanfournier/32/2876_2.png) [@YvanFournier](https://discourse.paraview.org/u/YvanFournier)
#### Post date: [December 22, 2022, 2:41pm UTC](https://discourse.paraview.org/t/issue-detecting-build-configuration-with-legacy-catalyst-with-cmake-versions-3-23-and-above/11059/5 "2022-12-22T14:41:50Z")

</div>

I ran a bisection on Cmake, and on the master branch, the issue appears with the following commit, from Dec 16 2021:

_ea050286e7 CMP0028: Report the target whose link interface has an offending item_

With the previous commit:

_a97c92e46e CMP0028: Report backtrace to link item rather than target creation_

Everything still works.

That helped me see that adding:  
`cmake_policy(SET CMP0028 OLD)`

in the CMakeLists.txt can work around this issue. As this old policy is deprecated, this is still an issue. Any suggestions (maybe a syntax change) ? As mentioned above, this also affects the legacy Catalyst examples. If the old policy is deprecated but can still be used in 2 years, that should allow the switch to Catalyst 2 with some overlap. Otherwise we may have a regression sometime.

Any help in porting to the new behavior (or update of the Catalyst examples relative to this issue) would be welcome.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 23, 2022, 8:26am UTC](https://discourse.paraview.org/t/issue-detecting-build-configuration-with-legacy-catalyst-with-cmake-versions-3-23-and-above/11059/6 "2022-12-23T08:26:10Z")

</div>

Maybe @ben.boeckel have an idea.

---

<div class="post-metadata">

### Author: ![mirenradia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@mirenradia](https://discourse.paraview.org/u/mirenradia)
#### Post date: [February 7, 2023, 5:03pm UTC](https://discourse.paraview.org/t/issue-detecting-build-configuration-with-legacy-catalyst-with-cmake-versions-3-23-and-above/11059/7 "2023-02-07T17:03:49Z")

</div>

I think this is the same as [the ParaView issue I reported last April](https://gitlab.kitware.com/paraview/paraview/-/issues/21361). Is there any update on resolving this, @mwestphal, @ben.boeckel, @nicolas.vuaille?
