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.
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…