Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vtk: new recipe #24808

Open
wants to merge 193 commits into
base: master
Choose a base branch
from
Open

vtk: new recipe #24808

wants to merge 193 commits into from

Conversation

valgur
Copy link
Contributor

@valgur valgur commented Aug 3, 2024

Summary

Changes to recipe: vtk/9.3.1

Motivation

The Visualization Toolkit (VTK) is open source software for manipulating and displaying scientific data. It comes with state-of-the-art tools for 3D rendering, a suite of widgets for 3D interaction, and extensive 2D plotting capability.

https://vtk.org/
https://gitlab.kitware.com/vtk/vtk

Packaging status

Details

Continues from #10776 by @paulharris with significant rewrites to tame the scope and complexity to more manageable levels. The project packages around 200 components and has about 70 dependencies (of which 56 are currently provided via Conan, 130 with transitive deps).

  • I dropped the full YES/WANT/DONT_WANT/NO dependency resolution, which was complex enough to warrant a suite of unit tests, imo, and replaced it with a simpler alternative, which works well enough as long as the user sticks to only YES/NO choices.
  • Module groups and kits are not supported. Kits "compile VTK into a smaller set of libraries" and "can be useful on platforms where VTK takes a long time to launch due to expensive disk access." Realistically, I would say supporting kits does not provide much value when static library output is available. The consumer is free to link the hundreds of modules down into a single executable if the number of shared libraries becomes a performance concern.
  • Every module that can be built with the given set of external deps is built. Alternatively, want_all_modules can be set to False to build only the core modules and a specific subset of modules (and their internal dependencies) selected by the user instead.
  • I expect the consumer to take care to link only against the relevant set of modules, since linking everything would be very unadvisable for this library. No catch-all VTK::VTK CMake target is exported for that reason (which matches the project's behavior). Instead, a poison target is included to prohibit the use of the aggregate vtk::vtk target when all modules are being built by default.
  • The Conan component definition is almost fully dynamic to cope with the up to 200 total components exported by the project. The process is:
    1. Gather all CMake targets defined by CMakeDeps into a map of CMake->Conan targets and store it for later use.
    2. Parse the installed VTK-targets.cmake file for CMake targets and their properties. This provides the list of actually exported targets, whether they are real or interface ones, a list of internal and external public CMake target dependencies, system libs, frameworks and preprocessor defines.
    3. Parse the module.json build output to get the list of private dependencies for each component and some extra implementable/implements metadata for autoinit header generation.
    4. Generate autoinit headers required for static factory components defined in other modules to work. This is normally done in the project's CMake modules. The recipe implements a modified version that works for non-CMake generators as well. See the additional description in the code for more details.
    5. Map the CMake targets to Conan targets and store the component metadata in a JSON file in the package folder for the binary package.
    6. Apply the defined components in package_info() and add the private external dependencies that are not covered by the modules.json file (which itself is derived from the module.vtk files in the project).
  • All external dependencies that are available on CCI are supported and work. At least on x86_64 Linux. I have not yet tested on other platforms.
  • I did not add support for Python and Java wrappers or Python components in general.
  • The recipe includes a Python script to generate the options/<version>.json files with ./update_options.py <vtk-source-location>. A --dump-metadata flag can be used to dump the metadata gathered from the module.vtk files as JSON instead, which provides a good overview of all modules and should be useful for diffing the metadata for changes for new releases. Keep in mind that many external dependencies are not listed as VTK modules, though, and are accessed directly through a find_package() wrapper.

TODO:

  • Add a recipe for VTK-m, which is basically a CUDA/HIP etc accelerated backend for VTK.

Here's a list of related PRs for optional dependencies that are currently missing from CCI:

To conclude, I would like to thank @paulharris for the very hard work on the recipe. It was tremendously helpful, even if much of it got rewritten beyond recognition. ❤️

Build logs

All logs are for GCC 11 on x86_64 Linux.

  • All external dependencies enabled (including the ones not yet available on CCI):
  • All external dependencies disabled:

Build times are:

  • minimal - 6 minutes
  • default - 15 minutes
  • full - 17 minutes

@valgur valgur mentioned this pull request Aug 5, 2024
3 tasks
@paulharris
Copy link
Contributor

Nice to see some action, but just so you know, I'm using my VTK recipe in production and its working well.

I like the sound of the poison target, and it is interesting that you are parsing the cmake target file.

Looking forward to seeing it progress further!

@valgur valgur mentioned this pull request Aug 23, 2024
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@valgur valgur marked this pull request as ready for review August 31, 2024 17:20
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

Warning

Conan Center will stop receiving updates for Conan 1.x packages soon - please see announcement.

All green in build 17 (f199ea6d58a037761f03ade06270369c6e99f3dc):

  • vtk/9.3.1:
    No packages built ⚠️ (All logs)

@gillesgui
Copy link

gillesgui commented Oct 23, 2024

Hi,
Any updates on this recipe? I am currently trying to use it in order to build vtk 9.3.1 with support for Qt5. After some minor tweaks I am almost successful. Last failure I can see is in package_info():

Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\conan\cli\cli.py", line 193, in run
    command.run(self._conan_api, args[0][1:])
  File "C:\Python311\Lib\site-packages\conan\cli\command.py", line 171, in run
    info = self._method(conan_api, parser, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\conan\cli\commands\install.py", line 75, in install
    conan_api.install.install_binaries(deps_graph=deps_graph, remotes=remotes)
  File "C:\Python311\Lib\site-packages\conan\api\subapi\install.py", line 29, in install_binaries
    installer.install(deps_graph, remotes, install_order=install_order)
  File "C:\Python311\Lib\site-packages\conans\client\installer.py", line 259, in install
    self._handle_package(package, install_reference, handled_count, package_count)
  File "C:\Python311\Lib\site-packages\conans\client\installer.py", line 343, in _handle_package
    self._call_package_info(conanfile, conanfile.package_folder, is_editable=False)
  File "C:\Python311\Lib\site-packages\conans\client\installer.py", line 458, in _call_package_info
    conanfile.cpp_info.check_component_requires(conanfile)
  File "C:\Python311\Lib\site-packages\conans\model\build_info.py", line 574, in check_component_requires
    raise ConanException(
conans.errors.ConanException: vtk/9.3.0: required component package 'directx::' not in dependencies

ERROR: vtk/9.3.0: required component package 'directx::' not in dependencies

Any ideas on what can go wrong here?

@leolcao
Copy link

leolcao commented Nov 4, 2024

hi, @valgur , thanks for the hard work firstly, but this PR seems been held for long time, do u know why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants