VTK-vtk-module-find-packages.cmake fails to find Boost

Hi,

I got and build the latest version of paraview from gitlab. When building my code with paraview, I get a weird error. CMake finds boost as expected:

find_package(Boost 1.53 REQUIRED COMPONENTS python):

– Boost version: 1.53.0
– Found the following Boost libraries:
– python
– Boost_FOUND=1
– Boost_FIND_VERSION_EXACT=
– Version/minor /
– :CMAKE_CXX_COMPILER_VERSION=3.8
– Boost_VERSION=105300
– Boost_FIND_VERSION=
– Boost_FIND_VERSION_MINOR=
– Boost_LIBRARIES=/usr/lib64/libboost_python-mt.so
– Boost_INCLUDE_DIRS=/usr/include
– Boost_LIBRARY_DIRS=/usr/lib64

Later, find_package(Boost) is called again from vtk/VTK-vtk-module-find-packages.cmake:313:

find_package(Boost

EXACT

${_vtk_module_find_package_quiet}
${_vtk_module_find_package_required}
COMPONENTS         
OPTIONAL_COMPONENTS )

and fails:
CMake Error at /ascldap/users/tesari/local/cmake/3.14.4/share/cmake-3.14/Modules/FindBoost.cmake:1148 (message): When requesting a specific version of Boost, you must provide at least the major and minor version numbers, e.g., 1.34

Call Stack (most recent call first):
/ascldap/users/tesari/projects/paraview/build/lib64/cmake/paraview-5.6/vtk/VTK-vtk-module-find-packages.cmake:313 (find_package)
/ascldap/users/tesari/projects/paraview/build/lib64/cmake/paraview-5.6/vtk/vtk-config.cmake:115 (include)
/ascldap/users/tesari/projects/paraview/build/lib64/cmake/paraview-5.6/paraview-config.cmake:41 (find_package)
/ascldap/users/tesari/projects/paraview/build/paraview-config.cmake:1 (include)
CMakeLists.txt:347 (
find_package(ParaView 5.6 NO_PACKAGE_ROOT_PATH REQUIRED COMPONENTS ${CATALYST_LIBRARIES})

I am working with cmake 3.14.4 on Linux x86_64. I tried to find boost without specifying a version, same result. What do I miss here?

Any help is highly appreciated.

Thanks,

Ted

Hmm. It seems that our version extraction failed when compiling VTK itself. "@Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@.@Boost_SUBMINOR_VERSION@" should be configured to get the version number. If you log what’s going on with _vtk_find_package_version in vtkModule.cmake when configuring VTK around line 3600, what do you see?

HI,

  Looks like that configuration never reaches line 3600. To make

sure that is the case, I put ** message(FATAL_ERROR
…** at line 3600, removed VTK from the build
directory, and run cmake again. VTK was reconfigured.

Thanks,

Ted


           string(REGEX REPLACE
"${_vtk_find_package_version_regex}" "\\1"
                _vtk_find_package_found_version
"${_vtk_find_package_version}")
              unset(_vtk_find_package_version_regex)
              unset(_vtk_find_package_version)

        **          message(FATAL_ERROR "_vtk_find_package_version =
${_vtk_find_package_version}")**

              set_property(GLOBAL

I don’t think line 3600 is exact (it depends on what version of the file you’re looking at). There’s logic around there that sets the _vtk_find_package_version variable:

      string(FIND "${_vtk_find_package_VERSION_VAR}" "@" _vtk_find_package_idx)
      if (_vtk_find_package_idx EQUAL -1)
        if (NOT DEFINED "${_vtk_find_package_VERSION_VAR}")
          message(FATAL_ERROR
            "The `${_vtk_find_package_VERSION_VAR}` variable is not defined.")
        endif ()
        set(_vtk_find_package_version "${${_vtk_find_package_VERSION_VAR}}")
      else ()
        string(CONFIGURE "${_vtk_find_package_VERSION_VAR}" _vtk_find_package_version)
      endif ()
      message(FATAL_ERROR ...) # add this line
I moved message(FATAL_ERROR ...)
where you pointed, no difference. Configuration is successful, with no interruption and no error messages. As to the configuration failure of the release branch, shall I open a separate ticket?

Hmm. What distribution of Boost are you using and on what platform?

I was using the system version of Boost, I think 1.40. I build a
custom version, 1.70.0, and rebuild paraview from scratch. Now
configuration failed at the message(FATAL_ERROR) with _vtk_find_package_version = 2.7.16. Below is
the error related to VTK-vtk-module-find-packages:

      -- Found Boost 1.70.0 at
/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/Boost-1.70.0
      --   Requested configuration: QUIET REQUIRED COMPONENTS
system;filesystem;python
      -- Found boost_headers 1.70.0 at
/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/boost_headers-1.70.0
      -- Found boost_system 1.70.0 at
/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/boost_system-1.70.0
      -- Boost toolset is unknown (compiler  3.8)
      --   libboost_system.so.1.70.0
      -- Adding boost_system dependencies: headers
      -- Found boost_filesystem 1.70.0 at
/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/boost_filesystem-1.70.0
      -- Boost toolset is unknown (compiler  3.8)
      --   libboost_filesystem.so.1.70.0
      -- Adding boost_filesystem dependencies: headers
      -- Found boost_python 1.70.0 at
/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/boost_python-1.70.0
      -- Boost toolset is unknown (compiler  3.8)
      --   libboost_python27.so.1.70.0
      -- Adding boost_python dependencies: headers
      -- Boost  found.
      -- Found Boost components:
         system;filesystem;python

      -- Boost_FOUND           = 1
      -- Boost_INCLUDE_DIRS    =
/ascldap/users/tesari/local/boost_1_70_0/include
      -- Boost_LIBRARY_DIRS    =
/ascldap/users/tesari/local/boost_1_70_0/lib
      -- Boost_LIBRARIES       =
      -- Boost_VERSION         = 1.70.0
      -- Boost_LIB_VERSION     =
      -- Boost_MAJOR_VERSION   =
      -- Boost_MINOR_VERSION   =
      -- Boost_SUBMINOR_VERSION=
      -- Boost_VERSION_STRING  =
      -- Boost_LIBRARY_DIR=/ascldap/users/tesari/local/boost_1_70_0/lib
      PACKAGE_PREFIX_DIR=
      CATALYST_ROOT=/ascldap/users/tesari/projects/paraview/build

      CMake Error at
/ascldap/users/tesari/local/cmake/3.14.4/share/cmake-3.14/Modules/FindBoost.cmake:1148
(message):
        When requesting a specific version of Boost, you must provide at
least the
        major and minor version numbers, e.g., 1.34
      Call Stack (most recent call first):
       
/ascldap/users/tesari/projects/paraview/build/lib64/cmake/paraview-5.6/vtk/VTK-vtk-module-find-packages.cmake:360
(find_package)
       
/ascldap/users/tesari/projects/paraview/build/lib64/cmake/paraview-5.6/vtk/vtk-config.cmake:115
(include)
       
/ascldap/users/tesari/projects/paraview/build/lib64/cmake/paraview-5.6/paraview-config.cmake:41
(find_package)
       
/ascldap/users/tesari/projects/paraview/build/paraview-config.cmake:1
(include)
        CMakeLists.txt:360 (find_package)

      CMake Error at
/ascldap/users/tesari/local/cmake/3.14.4/share/cmake-3.14/Modules/FindBoost.cmake:2155
(message):
        Unable to find the requested Boost libraries.

        Boost version: 1.70.0

        Boost include path:
/ascldap/users/tesari/local/boost_1_70_0/include

        Detected version of Boost is too new.  Requested version was
0.0.
      Call Stack (most recent call first):
       
/ascldap/users/tesari/projects/paraview/build/lib64/cmake/paraview-5.6/vtk/VTK-vtk-module-find-packages.cmake:360
(find_package)
       
/ascldap/users/tesari/projects/paraview/build/lib64/cmake/paraview-5.6/vtk/vtk-config.cmake:115
(include)
       
/ascldap/users/tesari/projects/paraview/build/lib64/cmake/paraview-5.6/paraview-config.cmake:41
(find_package)
       
/ascldap/users/tesari/projects/paraview/build/paraview-config.cmake:1
(include)
        CMakeLists.txt:360 (find_package)

      -- Could not find the VTK package due to a missing dependency:
Boost
      CMake Error at CMakeLists.txt:360 (find_package):
        Found package configuration file:

         
/ascldap/users/tesari/projects/paraview/build/paraview-config.cmake

        but it set ParaView_FOUND to FALSE so package "ParaView" is
considered to
        be NOT FOUND.  Reason given by package:

        Could not find the ParaView package with the following required
components:
        vtkPVPythonCatalyst.

      -- Configuring incomplete, errors occurred!

Forgot to add system info: Linux
3.10.0-957.el7.x86_64, cmake version 3.14.4

Hmm. If you change the instances of VERSION_VAR "@Boost_…" in the following files:

  • Infovis/Boost/CMakeLists.txt
  • Infovis/BoostGraphAlgorithms/CMakeLists.txt
  • ThirdParty/xdmf3/vtkxdmf3/core/CMakeLists.txt

with VERSION_VAR Boost_VERSION, and then rebuild ParaView, does that solve the issue? We may need to do some different logic for different versions of FindBoost here.

Is this correct?

    # VERSION_VAR        

)
VERSION_VAR “@Boost_VERSION@”)

I eplaced

  # VERSION_VAR         )

with

VERSION_VAR “@Boost_VERSION@”).

and rebuilt paraview. Now configuration pass VTK-vtk-module-find-packages,
but fail with ‘Could not find …
vtkPVPythonCatalyst’.
vtkPVPythonCatalyst is
present under …/build/lib64/python2.7/site-packages/paraview/module,
and have it LD_LIBRARY_PATH and PYTHONPATH (see below).

I suspect you forgot to paste the information you mention. However, find_package doesn’t care about LD_LIBRARY_PATH or PYTHONPATH anyways. There should be more information in the error message that it couldn’t find the component. The actual issue here is that the component is called PythonCatalyst (the vtkPV is just a library name differentiator; it shows up in CMake as ParaView::PythonCatalyst which is where the component name comes from).

I sent it in a separate mail. Here it is:

There should be more information in the
error message that it couldn’t find the component.

  Not sure how to make it more verbose. The lines below are from

find_package(ParaView), and it is all I see. Attached are the
error and output logs. Please let me know if need more
information.

    -- Found Boost 1.70.0 at

/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/Boost-1.70.0

    --   Requested configuration: QUIET REQUIRED

    -- Boost 1.70.0 found.

    CMake Error at CMakeLists.txt:360 (find_package):

      Found package configuration file:

/ascldap/users/tesari/projects/paraview/build/paraview-config.cmake

      but it set ParaView_FOUND to FALSE so package "ParaView" is

considered to

      be NOT FOUND.  Reason given by package:

      Could not find the ParaView package with the following

required components:

      vtkPVPythonCatalyst.

CMakeError.log (2.06 KB)

CMakeOutput.log (126 KB)

Change your find_package(ParaView REQUIRED COMPONENTS vtkPVPythonCatalyst) to find_package(ParaView REQUIRED COMPONENTS PythonCatalyst).

I’ll test out 1.70.0 here locally to see what’s up, but yes, that will work.

Yes, configuration is successful, thanks!

I have some issue building my code, e.g. “Cannot
find vtkNew.h” . When I use a Catalyst build, I have
something like:

    find_package(ParaView 5.6 NO_PACKAGE_ROOT_PATH

REQUIRED COMPONENTS vtkPVPythonCatalyst)

      include("${PARAVIEW_USE_FILE}")

When building the code with Paraview, there is no ${PARAVIEW_USE_FILE}. Is
there ${ParaView_INCLUDE_DIR }?
Where can I look what variables are set by find_package(ParaView)?

So I downloaded 1.70.0 from boost.org and built/installed it. Using CMake 3.14.4, VTK got find_package(Boost) set up properly in the VTK-vtk-module-find-packages.cmake file, so debugging to figure out why the Boost_MAJOR_VERSION and related variables are not defined in your case would be required, but I can’t reproduce myself it here with the information available here.

Not sure that thsi relates to the issue, but I just noticed that
Found Boost 1.70.0 alternates with Boost 1.40 found:

    -- Found Boost 1.70.0 at

/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/Boost-1.70.0

    --   Requested configuration: QUIET

    -- Found boost_headers 1.70.0 at

/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/boost_headers-1.70.0

    -- Boost  found.

    -- Found Boost 1.70.0 at

/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/Boost-1.70.0

    --   Requested configuration: QUIET REQUIRED

    -- Found boost_headers 1.70.0 at

/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/boost_headers-1.70.0

    -- Boost 1.40 found.

    -- Found X11: /usr/include  

    -- Found Boost 1.70.0 at

/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/Boost-1.70.0

    --   Requested configuration: QUIET REQUIRED

    -- Found boost_headers 1.70.0 at

/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/boost_headers-1.70.0

    -- Boost 1.40 found.

    -- Found Boost 1.70.0 at

/ascldap/users/tesari/local/boost_1_70_0/lib/cmake/Boost-1.70.0

    --   Requested configuration: QUIET REQUIRED

    -- Boost  found.

When building the code with Paraview, there is no ${PARAVIEW_USE_FILE}.

This is no longer a thing. ParaView is ready-to-use right after find_package now. It is also consumed by targets now, so ParaView_INCLUDE_DIR isn’t necessary anymore. Instead, just link to ParaView::Catalyst or whichever targets you’d like to use (vtk_module_autoinit may be required for some usecases). The list of available variables can be found at the top of paraview-config.cmake: https://gitlab.kitware.com/paraview/paraview/blob/master/CMake/paraview-config.cmake.in

Uh, that could certainly be a problem. I also see -- Boost found. there which is a Boost found without a version number. I suspect something is quite wrong with your Boost install(s). Make sure that all Boost variables in the cache for ParaView and your project are consistently using a single Boost version.