I’m trying to build a demo QT application using the Point Cloud Library (PCL) and its provided visualiser component (#include <pcl/visualization/pcl_visualizer.h>
). I’m using Cmake for the build system. Cmake finds PCL without issue, but trying to include that header throws an error about VTK smart pointers. When I try to include VTK in my CMakeLists, I get an error about MPI components for VTK:
/usr/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:230: error: Could NOT find MPI (missing: MPI_C_FOUND C) (found version "3.1")
Reason given by package: MPI component 'C' was requested, but language C is not enabled.
/usr/share/cmake-3.27/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.27/Modules/FindMPI.cmake:1837 (find_package_handle_standard_args) CMakeLists.txt:22 (find_package)
This works, but fails to compile due to a missing VTK include (but confirms that PCL is found OK and that MPI seems partially installed):
find_package(MPI COMPONENTS CXX REQUIRED)
find_package(PCL REQUIRED)
This does not:
find_package(VTK REQUIRED)
find_package(PCL REQUIRED)
Nor does this:
find_package(MPI COMPONENTS C CXX REQUIRED)
find_package(PCL REQUIRED)
Some googling suggests that there was an issue with FindMPI in older versions of Cmake, but that this was fixed (3.15 seems to be problematic).
I’m running Kubuntu 23.04 and both PCL (libpcl-dev
) and VTK (libvtk9-dev
) have been installed via apt
. I’ve also installed MPI (mpich openmpi-bin openmpi-common openmpi-doc libopenmpi-dev
). mpicc
and mpicxx
are present in /usr/bin
and I’ve tried passing them as Cmake config options (-DMPI_C_COMPILER:PATH=/usr/bin/mpicc
), but I don’t really know where the problem is coming from. If possible I would prefer not to build VTK from source.