diff --git a/geometry/proximity/BUILD.bazel b/geometry/proximity/BUILD.bazel index a9733bd764a9..7790d458e9ee 100644 --- a/geometry/proximity/BUILD.bazel +++ b/geometry/proximity/BUILD.bazel @@ -831,9 +831,9 @@ drake_cc_library( ], deps = [ "@fmt", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonDataModel", - "@vtk//:vtkIOLegacy", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonDataModel", + "@vtk_internal//:vtkIOLegacy", ], ) diff --git a/geometry/render_gl/BUILD.bazel b/geometry/render_gl/BUILD.bazel index 29cc9856f7c5..0db38315c4e2 100644 --- a/geometry/render_gl/BUILD.bazel +++ b/geometry/render_gl/BUILD.bazel @@ -192,10 +192,10 @@ drake_cc_library_ubuntu_only( ":internal_opengl_context", ], deps = [ - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonDataModel", - "@vtk//:vtkIOImage", - "@vtk//:vtkImagingCore", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonDataModel", + "@vtk_internal//:vtkIOImage", + "@vtk_internal//:vtkImagingCore", ], ) @@ -242,9 +242,9 @@ drake_cc_googletest_ubuntu_only( "//common/test_utilities:expect_throws_message", "//geometry/render:render_label", "//systems/sensors:color_palette", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonDataModel", - "@vtk//:vtkIOImage", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonDataModel", + "@vtk_internal//:vtkIOImage", ], ) diff --git a/geometry/render_gltf_client/BUILD.bazel b/geometry/render_gltf_client/BUILD.bazel index 311ed15fdae7..afc996cbaf91 100644 --- a/geometry/render_gltf_client/BUILD.bazel +++ b/geometry/render_gltf_client/BUILD.bazel @@ -100,9 +100,9 @@ drake_cc_library( "//systems/sensors:image", "//systems/sensors:vtk_image_reader_writer", "@picosha2_internal//:picosha2", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonDataModel", - "@vtk//:vtkIOImage", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonDataModel", + "@vtk_internal//:vtkIOImage", ], ) @@ -124,10 +124,10 @@ drake_cc_library( "//geometry/render_vtk:internal_render_engine_vtk", "//systems/sensors:image", "@nlohmann_internal//:nlohmann", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonMath", - "@vtk//:vtkIOExport", - "@vtk//:vtkRenderingCore", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonMath", + "@vtk_internal//:vtkIOExport", + "@vtk_internal//:vtkRenderingCore", ], ) @@ -246,8 +246,8 @@ drake_cc_googletest( "//common/test_utilities:expect_throws_message", "//systems/sensors/test_utilities:image_compare", "@nlohmann_internal//:nlohmann", - "@vtk//:vtkCommonMath", - "@vtk//:vtkRenderingCore", + "@vtk_internal//:vtkCommonMath", + "@vtk_internal//:vtkRenderingCore", ], ) @@ -273,12 +273,12 @@ drake_cc_binary( "//systems/sensors:color_palette", "//systems/sensors:image", "@gflags", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonMath", - "@vtk//:vtkIOImage", - "@vtk//:vtkIOImport", - "@vtk//:vtkRenderingCore", - "@vtk//:vtkRenderingOpenGL2", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonMath", + "@vtk_internal//:vtkIOImage", + "@vtk_internal//:vtkIOImport", + "@vtk_internal//:vtkRenderingCore", + "@vtk_internal//:vtkRenderingOpenGL2", ], ) diff --git a/geometry/render_vtk/BUILD.bazel b/geometry/render_vtk/BUILD.bazel index dd1f61acb8dd..5d0638985c8e 100644 --- a/geometry/render_vtk/BUILD.bazel +++ b/geometry/render_vtk/BUILD.bazel @@ -62,16 +62,16 @@ drake_cc_library( "//geometry/render_vtk:render_engine_vtk_params", "//systems/sensors:color_palette", "@eigen", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonExecutionModel", - "@vtk//:vtkCommonTransforms", - "@vtk//:vtkFiltersSources", - "@vtk//:vtkIOGeometry", - "@vtk//:vtkIOImage", - "@vtk//:vtkIOImport", - "@vtk//:vtkImagingCore", - "@vtk//:vtkRenderingCore", - "@vtk//:vtkRenderingOpenGL2", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonExecutionModel", + "@vtk_internal//:vtkCommonTransforms", + "@vtk_internal//:vtkFiltersSources", + "@vtk_internal//:vtkIOGeometry", + "@vtk_internal//:vtkIOImage", + "@vtk_internal//:vtkIOImport", + "@vtk_internal//:vtkImagingCore", + "@vtk_internal//:vtkRenderingCore", + "@vtk_internal//:vtkRenderingOpenGL2", ], ) @@ -87,12 +87,12 @@ drake_cc_library( "//geometry:shape_specification", "//geometry/render:render_material", "//geometry/render:render_mesh", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonDataModel", - "@vtk//:vtkCommonExecutionModel", - "@vtk//:vtkCommonTransforms", - "@vtk//:vtkFiltersGeneral", - "@vtk//:vtkFiltersSources", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonDataModel", + "@vtk_internal//:vtkCommonExecutionModel", + "@vtk_internal//:vtkCommonTransforms", + "@vtk_internal//:vtkFiltersGeneral", + "@vtk_internal//:vtkFiltersSources", ], ) @@ -106,9 +106,9 @@ drake_cc_library( "//common:essential", "//math:geometric_transform", "@eigen", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonTransforms", - "@vtk//:vtkFiltersSources", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonTransforms", + "@vtk_internal//:vtkFiltersSources", ], ) @@ -138,6 +138,7 @@ drake_cc_googletest( "RenderEngineVtkTest.PreservePropertyTexturesOverClone", "RenderEngineVtkTest.RemoveVisual", "RenderEngineVtkTest.SimpleClone", + "RenderEngineVtkTest.SingleLight", "RenderEngineVtkTest.SphereTest", "RenderEngineVtkTest.TerrainTest", ]), @@ -155,9 +156,9 @@ drake_cc_googletest( "//geometry/test_utilities:dummy_render_engine", "//math:geometric_transform", "//systems/sensors/test_utilities:image_compare", - "@vtk//:vtkIOImage", - "@vtk//:vtkRenderingCore", - "@vtk//:vtkRenderingOpenGL2", + "@vtk_internal//:vtkIOImage", + "@vtk_internal//:vtkRenderingCore", + "@vtk_internal//:vtkRenderingOpenGL2", ], ) @@ -165,9 +166,9 @@ drake_cc_googletest( name = "internal_vtk_util_test", deps = [ ":internal_vtk_util", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonDataModel", - "@vtk//:vtkFiltersSources", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonDataModel", + "@vtk_internal//:vtkFiltersSources", ], ) diff --git a/geometry/render_vtk/factory.h b/geometry/render_vtk/factory.h index 21d4d4e7a3e3..68ea7fb58162 100644 --- a/geometry/render_vtk/factory.h +++ b/geometry/render_vtk/factory.h @@ -15,6 +15,11 @@ namespace geometry { /** Constructs a RenderEngine implementation which uses a VTK-based OpenGL renderer. + @warning On macOS, we've observed that RenderEngineVtk sometimes does not obey + render::ColorRenderCamera::show_window when it's set to `true`. Refer to issue + #20144 + for further discussion. + @anchor render_engine_vtk_properties

Geometry perception properties

diff --git a/setup/mac/binary_distribution/Brewfile b/setup/mac/binary_distribution/Brewfile index 825e69846296..91171cb772a3 100644 --- a/setup/mac/binary_distribution/Brewfile +++ b/setup/mac/binary_distribution/Brewfile @@ -6,23 +6,21 @@ tap 'robotlocomotion/director' cask 'adoptopenjdk' unless system '/usr/libexec/java_home --version 1.8+ --failfast &> /dev/null' brew 'cmake' -brew 'double-conversion' brew 'eigen' brew 'gcc' brew 'fmt' -brew 'glew' brew 'glib' brew 'graphviz' brew 'ipopt' +brew 'jpeg' brew 'libpng' -brew 'lz4' +brew 'libtiff' brew 'numpy' brew 'openblas' brew 'pkg-config' brew 'python@3.11' brew 'spdlog' brew 'tinyxml' -brew 'robotlocomotion/director/vtk@9.1.0' brew 'xz' brew 'yaml-cpp' brew 'zeromq' diff --git a/setup/ubuntu/binary_distribution/packages-focal.txt b/setup/ubuntu/binary_distribution/packages-focal.txt index c8d422ec6f32..9a8033532703 100644 --- a/setup/ubuntu/binary_distribution/packages-focal.txt +++ b/setup/ubuntu/binary_distribution/packages-focal.txt @@ -18,8 +18,6 @@ libjchart2d-java libjpeg-turbo8 libjsoncpp1 liblapack3 -liblz4-1 -liblzma5 libmumps-seq-5.2.1 libnetcdf15 libogg0 diff --git a/setup/ubuntu/binary_distribution/packages-jammy.txt b/setup/ubuntu/binary_distribution/packages-jammy.txt index 0eb2f33dbf3d..feb622279f9e 100644 --- a/setup/ubuntu/binary_distribution/packages-jammy.txt +++ b/setup/ubuntu/binary_distribution/packages-jammy.txt @@ -3,12 +3,9 @@ default-jre jupyter-notebook libblas-dev libbz2-1.0 -libdouble-conversion3 libeigen3-dev libexpat1 -libfreetype6 libgfortran5 -libglew2.2 libglib2.0-0 libglu1-mesa libglx0 @@ -18,8 +15,6 @@ libjchart2d-java libjpeg-turbo8 libjsoncpp25 liblapack3 -liblz4-1 -liblzma5 libmumps-seq-5.4 libnetcdf19 libogg0 @@ -34,7 +29,6 @@ libspdlog-dev libsqlite3-0 libtheora0 libtiff5 -libvtk9.1 libx11-6 libxml2 libxt6 diff --git a/setup/ubuntu/source_distribution/packages-focal.txt b/setup/ubuntu/source_distribution/packages-focal.txt index 82e603aa726c..41da5464efb7 100644 --- a/setup/ubuntu/source_distribution/packages-focal.txt +++ b/setup/ubuntu/source_distribution/packages-focal.txt @@ -6,16 +6,12 @@ git libblas-dev libbz2-dev libclang-12-dev -libdouble-conversion-dev libexpat1-dev libgl-dev -libglew-dev libglib2.0-dev libglx-dev libjpeg-turbo8-dev liblapack-dev -liblz4-dev -liblzma-dev libmumps-seq-dev libopengl-dev libpng-dev diff --git a/setup/ubuntu/source_distribution/packages-jammy.txt b/setup/ubuntu/source_distribution/packages-jammy.txt index 544d81905f44..118c83a982bd 100644 --- a/setup/ubuntu/source_distribution/packages-jammy.txt +++ b/setup/ubuntu/source_distribution/packages-jammy.txt @@ -5,23 +5,18 @@ gfortran git libbz2-dev libclang-12-dev -libdouble-conversion-dev libexpat1-dev libgl-dev -libglew-dev libglib2.0-dev libglx-dev libjpeg-turbo8-dev liblapack-dev -liblz4-dev -liblzma-dev libmumps-seq-dev libopengl-dev libpng-dev libtiff-dev libtinyxml-dev libtool -libvtk9-dev libx11-dev ocl-icd-opencl-dev opencl-headers diff --git a/systems/sensors/BUILD.bazel b/systems/sensors/BUILD.bazel index 5e7697f5d172..cf10133089c6 100644 --- a/systems/sensors/BUILD.bazel +++ b/systems/sensors/BUILD.bazel @@ -216,8 +216,8 @@ drake_cc_library( ":lcm_image_traits", ":vtk_image_reader_writer", "//lcmtypes:image_array", - "@vtk//:vtkCommonCore", - "@vtk//:vtkIOImage", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkIOImage", "@zlib", ], ) @@ -321,9 +321,9 @@ drake_cc_library( ], deps = [ ":vtk_image_reader_writer", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonDataModel", - "@vtk//:vtkIOImage", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkCommonDataModel", + "@vtk_internal//:vtkIOImage", ], ) @@ -350,8 +350,8 @@ drake_cc_library( deps = [ ":image_file_format", "//common:unused", - "@vtk//:vtkCommonCore", - "@vtk//:vtkIOImage", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkIOImage", ], ) @@ -607,31 +607,6 @@ drake_cc_googletest( ":vtk_image_reader_writer", "//common:temp_directory", "//common/test_utilities:expect_throws_message", - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonDataModel", - "@vtk//:vtkIOImage", - ], -) - -# This "reader writer canary" is the same test program as above, but linked -# with @vtk_internal (VTK built from source) instead of @vtk (the host VTK). -# This is a temporary measure for CI to help us understand if the VTK source -# build is satisfactory. Once all of Drake has switched to @vtk_internal, we -# can (and should) remove this test rule, since it will be redundant. -drake_cc_googletest( - name = "vtk_image_reader_writer_canary_test", - srcs = [ - "image_file_format.cc", - "image_file_format.h", - "test/vtk_image_reader_writer_test.cc", - "vtk_image_reader_writer.cc", - "vtk_image_reader_writer.h", - ], - deps = [ - "//common:essential", - "//common:temp_directory", - "//common:unused", - "//common/test_utilities:expect_throws_message", "@vtk_internal//:vtkCommonCore", "@vtk_internal//:vtkCommonDataModel", "@vtk_internal//:vtkIOImage", diff --git a/systems/sensors/test_utilities/BUILD.bazel b/systems/sensors/test_utilities/BUILD.bazel index cd3e723b44aa..2634b0bc2bd8 100644 --- a/systems/sensors/test_utilities/BUILD.bazel +++ b/systems/sensors/test_utilities/BUILD.bazel @@ -24,8 +24,8 @@ drake_cc_library( deps = [ "//systems/sensors:image", "@gtest//:without_main", - "@vtk//:vtkCommonCore", - "@vtk//:vtkIOImage", + "@vtk_internal//:vtkCommonCore", + "@vtk_internal//:vtkIOImage", ], ) diff --git a/third_party/com_github_bazelbuild_rules_cc/whole_archive.bzl b/third_party/com_github_bazelbuild_rules_cc/whole_archive.bzl index f998661e5b51..12a571c15ca1 100644 --- a/third_party/com_github_bazelbuild_rules_cc/whole_archive.bzl +++ b/third_party/com_github_bazelbuild_rules_cc/whole_archive.bzl @@ -52,6 +52,20 @@ def _cc_whole_archive_library_impl(ctx): old_libraries = old_linker_input.libraries new_libraries = [] for old_library in old_libraries: + # Objective-C libraries (objc_library(...)) need special treatment. + # We want the objc object code itself, but not its redundant copy + # of the nearby C++ object code (the "applebin"). + is_objc_library = any([ + "_objc/non_arc/" in obj.path + for obj in old_library.objects + ]) + static_path = getattr(old_library.static_library, "path", "") + if not is_objc_library and "/applebin_macos-darwin" in static_path: + # Avoid double-linking from objc_library() deps; see + # https://github.com/bazelbuild/rules_apple/issues/1474. + continue + + # Make a new_library (identical to old_library, but always linked). new_library = cc_common.create_library_to_link( actions = ctx.actions, feature_configuration = feature_configuration, diff --git a/tools/dynamic_analysis/lsan.supp b/tools/dynamic_analysis/lsan.supp index aad947a2aa93..e69de29bb2d1 100644 --- a/tools/dynamic_analysis/lsan.supp +++ b/tools/dynamic_analysis/lsan.supp @@ -1,2 +0,0 @@ -# Suppress leaks from global variables in VTK's dynamic libraries. -leak:libvtk*-9.1.so.1 diff --git a/tools/dynamic_analysis/tsan.supp b/tools/dynamic_analysis/tsan.supp index f781eb82b878..3b3481209223 100644 --- a/tools/dynamic_analysis/tsan.supp +++ b/tools/dynamic_analysis/tsan.supp @@ -50,7 +50,7 @@ race:__cxa_finalize mutex:__cxa_finalize # Issue #16494. -race:vtkNew::~vtkNew +race:drake_vendor::vtkNew::~vtkNew # In the lcm_memq handler, while correctly holding a mutex it obtains exclusive # access to the next message by popping it off of the queue, but then it diff --git a/tools/dynamic_analysis/valgrind.supp b/tools/dynamic_analysis/valgrind.supp index a2afdb4eae00..0a20b28dd186 100644 --- a/tools/dynamic_analysis/valgrind.supp +++ b/tools/dynamic_analysis/valgrind.supp @@ -262,11 +262,3 @@ fun:_ZN19ClpSimplexNonlinear6primalEv fun:_ZN10ClpSimplex6primalEii } - -{ - VTK: file reader compare header line vs garbage - Memcheck:Cond - fun:_ZN13vtkDataReader10ReadHeaderEPKc - ... - fun:_ZN5drake8geometry8internal19ReadVtkToVolumeMeshERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEd -} diff --git a/tools/install/libdrake/BUILD.bazel b/tools/install/libdrake/BUILD.bazel index 565d63219b49..08ed3e5d4a4b 100644 --- a/tools/install/libdrake/BUILD.bazel +++ b/tools/install/libdrake/BUILD.bazel @@ -165,28 +165,6 @@ cc_library( }), ) -# Depend on the subset of VTK's shared libraries that Drake uses. -cc_library( - name = "vtk_deps", - deps = [ - # TODO(jwnimmer-tri) This duplicates the list of VTK libraries needed - # by //sensors. We should find a way for ":drake_shared_library" to be - # declared without having to repeat this list here. - "@vtk//:vtkCommonCore", - "@vtk//:vtkCommonDataModel", - "@vtk//:vtkCommonExecutionModel", - "@vtk//:vtkCommonTransforms", - "@vtk//:vtkFiltersGeneral", - "@vtk//:vtkFiltersSources", - "@vtk//:vtkIOExport", - "@vtk//:vtkIOGeometry", - "@vtk//:vtkIOImage", - "@vtk//:vtkIOImport", - "@vtk//:vtkRenderingCore", - "@vtk//:vtkRenderingOpenGL2", - ], -) - # Depend on X11 iff on Ubuntu and not MacOS. cc_library( name = "x11_deps", @@ -229,7 +207,6 @@ cc_library( ":gurobi_deps", ":ipopt_deps", ":mosek_deps", - ":vtk_deps", ":x11_deps", "//common:drake_marker_shared_library", "@lcm", diff --git a/tools/wheel/Dockerfile b/tools/wheel/Dockerfile index 027538d40d45..54b22fc61f2b 100644 --- a/tools/wheel/Dockerfile +++ b/tools/wheel/Dockerfile @@ -25,11 +25,6 @@ ADD image/build-dependencies.sh /image/ RUN /image/build-dependencies.sh -ADD image/vtk-args /opt/drake-wheel-build/vtk/ -ADD image/build-vtk.sh /image/ - -RUN /image/build-vtk.sh - # ----------------------------------------------------------------------------- # Install Python. # ----------------------------------------------------------------------------- diff --git a/tools/wheel/image/build-vtk.sh b/tools/wheel/image/build-vtk.sh deleted file mode 100755 index 45ecd7672c40..000000000000 --- a/tools/wheel/image/build-vtk.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# Internal script to build VTK for use in a Drake wheel. -# -# NOTE: If you need to update this file, please refer to -# tools/workspace/vtk/README for important details. - -set -eu -o pipefail - -readonly VTK_DIR=/opt/drake-wheel-build/vtk -readonly VTK_VERSION=9.1.0 - -mkdir -p ${VTK_DIR} -cd ${VTK_DIR} - -git clone \ - --branch v${VTK_VERSION} --depth 1 \ - https://gitlab.kitware.com/vtk/vtk.git src - -mkdir -p ${VTK_DIR}/build -cd ${VTK_DIR}/build - -mapfile -t VTK_CMAKE_ARGS < \ - <(sed -e '/^#/d' -e 's/^/-D/' < ${VTK_DIR}/vtk-args) - -cmake "${VTK_CMAKE_ARGS[@]}" -GNinja -Wno-dev ${VTK_DIR}/src - -ninja install/strip - -# Place the license files from VTK where build-wheel.sh will copy from. -# See also: vtk-args, CMAKE_INSTALL_PREFIX/CMAKE_INSTALL_LICENSEDIR. -mkdir -p /opt/drake-dependencies/licenses -cp -r /opt/vtk/share/doc/vtk-9.1 /opt/drake-dependencies/licenses diff --git a/tools/wheel/image/build-wheel.sh b/tools/wheel/image/build-wheel.sh index 0cf8b6db3830..72cf2d88afc8 100755 --- a/tools/wheel/image/build-wheel.sh +++ b/tools/wheel/image/build-wheel.sh @@ -63,7 +63,7 @@ if [[ "$(uname)" == "Linux" ]]; then /opt/drake-wheel-content/* fi -# NOTE: build-vtk.sh also puts licenses in /opt/drake-dependencies/licenses. +# Copy the license files from third party dependencies we vendor. cp -r -t ${WHEEL_DIR}/pydrake/doc \ /opt/drake-dependencies/licenses/* diff --git a/tools/wheel/image/dependencies/projects.cmake b/tools/wheel/image/dependencies/projects.cmake index dbd371b18638..75eec51ae48d 100644 --- a/tools/wheel/image/dependencies/projects.cmake +++ b/tools/wheel/image/dependencies/projects.cmake @@ -19,12 +19,6 @@ set(bzip2_url "https://sourceware.org/pub/bzip2/bzip2-${bzip2_version}.tar.gz") set(bzip2_md5 "67e051268d0c475ea773822f7500d0e5") list(APPEND ALL_PROJECTS bzip2) -# lz4 -set(lz4_version 1.9.3) -set(lz4_url "https://github.com/lz4/lz4/archive/v${lz4_version}/lz4-${lz4_version}.tar.gz") -set(lz4_md5 "3a1ab1684e14fc1afc66228ce61b2db3") -list(APPEND ALL_PROJECTS lz4) - # xz set(xz_version 5.2.5) set(xz_url "https://drake-mirror.csail.mit.edu/other/xz/xz-${xz_version}.tar.gz") @@ -43,6 +37,9 @@ set(png_url "https://downloads.sourceforge.net/project/libpng/libpng16/${png_ver set(png_md5 "122e6b7837811698563083b352bc8ca2") list(APPEND ALL_PROJECTS png) +# TODO(jwnimmer-tri) When we purge `libtiff`, we can also purge `xz`, above. +# The only user of `xz` is `libtiff`. +# # libtiff set(libtiff_version 4.1.0) set(libtiff_url "http://download.osgeo.org/libtiff/tiff-${libtiff_version}.tar.gz") @@ -64,12 +61,6 @@ endif() set(eigen_dlname "eigen-${eigen_version}.tar.gz") list(APPEND ALL_PROJECTS eigen) -# double-conversion -set(double-conversion_version 3.1.5) -set(double-conversion_url "https://github.com/google/double-conversion/archive/v${double-conversion_version}/double-conversion-${double-conversion_version}.tar.gz") -set(double-conversion_md5 "e94d3a33a417e692e5600e75019f0272") -list(APPEND ALL_PROJECTS double-conversion) - # lapack (blas) set(lapack_version 3.10.0) set(lapack_url "https://github.com/Reference-LAPACK/lapack/archive/v${lapack_version}.tar.gz") diff --git a/tools/wheel/image/dependencies/projects/double-conversion.cmake b/tools/wheel/image/dependencies/projects/double-conversion.cmake deleted file mode 100644 index ad54c3f8c468..000000000000 --- a/tools/wheel/image/dependencies/projects/double-conversion.cmake +++ /dev/null @@ -1,14 +0,0 @@ -ExternalProject_Add(double-conversion - URL ${double-conversion_url} - URL_MD5 ${double-conversion_md5} - ${COMMON_EP_ARGS} - ${COMMON_CMAKE_EP_ARGS} - CMAKE_ARGS - ${COMMON_CMAKE_ARGS} - ) - -# Note: double-conversion ships both a COPYING and a LICENSE, but they are -# identical, so there is no need for us to ship both. -extract_license(double-conversion - COPYING -) diff --git a/tools/wheel/image/dependencies/projects/lz4.cmake b/tools/wheel/image/dependencies/projects/lz4.cmake deleted file mode 100644 index cc6863c6153c..000000000000 --- a/tools/wheel/image/dependencies/projects/lz4.cmake +++ /dev/null @@ -1,18 +0,0 @@ -ExternalProject_Add(lz4 - URL ${lz4_url} - URL_MD5 ${lz4_md5} - ${COMMON_EP_ARGS} - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND "" - BUILD_COMMAND make - BUILD_SHARED=no - "CFLAGS=-fPIC -O3" - INSTALL_COMMAND make - BUILD_SHARED=no - PREFIX=${CMAKE_INSTALL_PREFIX} - install - ) - -extract_license(lz4 - lib/LICENSE -) diff --git a/tools/wheel/image/vtk-args b/tools/wheel/image/vtk-args deleted file mode 100644 index 4321862a52c2..000000000000 --- a/tools/wheel/image/vtk-args +++ /dev/null @@ -1,291 +0,0 @@ -# NOTE: If you need to update this file, please refer to -# tools/workspace/vtk/README for important details. -# Basic build configuration. NOTE: wheel builds should be static. -CMAKE_BUILD_TYPE:STRING=Release -BUILD_SHARED_LIBS:BOOL=OFF -CMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -CMAKE_CXX_STANDARD:STRING=17 -CMAKE_PREFIX_PATH:PATH=/opt/drake-dependencies -CMAKE_INSTALL_PREFIX:PATH=/opt/vtk -# VTK by default installs license files to `share/licenses/PROJECT_NAME`, we -# want the license files to end up in `share/doc/PROJECT_NAME`. -CMAKE_INSTALL_LICENSEDIR:STRING=share/doc/vtk-9.1 -# VTK-specific build configuration. -BUILD_TESTING:BOOL=OFF -VTK_ENABLE_WRAPPING:BOOL=OFF -VTK_WRAP_PYTHON:BOOL=OFF -# Third party libraries. These configurations should be identical to -# tools/workspace/vtk/image/vtk-args, except: -# -# 1) Disable fontconfig: -# VTK_MODULE_ENABLE_VTK_RenderingFreeTypeFontConfig:STRING=DONT_WANT -# -# 3) Request vtk builds more thirdparty libraries internally. See -# tools/wheel/image/dependencies/projects folder, if something is ON here, -# there must be a corresponding project there. -# VTK_MODULE_USE_EXTERNAL_VTK_expat:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_freetype:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_glew:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_jsoncpp:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_libxml2:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_lzma:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_netcdf:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_ogg:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_sqlite:BOOL=OFF -# VTK_MODULE_USE_EXTERNAL_VTK_theora:BOOL=OFF -VTK_BUILD_ALL_MODULES:BOOL=OFF -VTK_GROUP_ENABLE_Imaging:STRING=YES -VTK_GROUP_ENABLE_MPI:STRING=DONT_WANT -VTK_GROUP_ENABLE_Qt:STRING=NO -VTK_GROUP_ENABLE_Rendering:STRING=YES -VTK_GROUP_ENABLE_StandAlone:STRING=DONT_WANT -VTK_GROUP_ENABLE_Views:STRING=DONT_WANT -VTK_GROUP_ENABLE_Web:STRING=DONT_WANT -VTK_LEGACY_REMOVE:BOOL=ON -VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmCore:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmDataModel:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmFilters:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_ChartsCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_CommonArchive:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_CommonColor:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonComputationalGeometry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_CommonCore:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonDataModel:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonExecutionModel:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonMath:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonMisc:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonSystem:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonTransforms:STRING=YES -VTK_MODULE_ENABLE_VTK_DICOMParser:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_DomainsChemistry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_DomainsChemistryOpenGL2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_DomainsMicroscopy:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_DomainsParallelChemistry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersAMR:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersCore:STRING=YES -VTK_MODULE_ENABLE_VTK_FiltersExtraction:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersFlowPaths:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersGeneral:STRING=YES -VTK_MODULE_ENABLE_VTK_FiltersGeneric:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersGeometry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersHybrid:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersHyperTree:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersImaging:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersModeling:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersOpenTURNS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallel:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelDIY2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelFlowPaths:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelGeometry:STRING=WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelImaging:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelMPI:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelStatistics:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelVerdict:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersPoints:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersProgrammable:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersReebGraph:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersSMP:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersSelection:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersSources:STRING=YES -VTK_MODULE_ENABLE_VTK_FiltersStatistics:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersTexture:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersTopology:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersVerdict:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GUISupportQt:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GUISupportQtQuick:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GUISupportQtSQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GeovisCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GeovisGDAL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOADIOS2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOAMR:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOAsynchronous:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOCGNSReader:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOCONVERGECFD:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOChemistry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOCityGML:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOCore:STRING=YES -VTK_MODULE_ENABLE_VTK_IOEnSight:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOExodus:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOExport:STRING=YES -VTK_MODULE_ENABLE_VTK_IOExportGL2PS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOExportPDF:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOFFMPEG:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOFides:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOGDAL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOGeoJSON:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOGeometry:STRING=YES -VTK_MODULE_ENABLE_VTK_IOH5Rage:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOH5part:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOHDF:STRING=WANT -VTK_MODULE_ENABLE_VTK_IOIOSS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOImage:STRING=YES -VTK_MODULE_ENABLE_VTK_IOImport:STRING=YES -VTK_MODULE_ENABLE_VTK_IOInfovis:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOLAS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOLSDyna:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOLegacy:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMINC:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMPIImage:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMPIParallel:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMotionFX:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMovie:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMySQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IONetCDF:STRING=YES -VTK_MODULE_ENABLE_VTK_IOODBC:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOOMF:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOOggTheora:STRING=WANT -VTK_MODULE_ENABLE_VTK_IOOpenVDB:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOPDAL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOPIO:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOPLY:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallel:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelExodus:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelLSDyna:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelNetCDF:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelXML:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelXdmf3:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOPostgreSQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOSQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOSegY:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOTRUCHAS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOTecplotTable:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOVPIC:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOVeraOut:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOVideo:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOXML:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOXMLParser:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOXdmf2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOXdmf3:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingColor:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingCore:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingFourier:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingGeneral:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingHybrid:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingMath:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingMorphological:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingOpenGL2:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingSources:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingStatistics:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingStencil:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InfovisBoost:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InfovisBoostGraphAlgorithms:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InfovisCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InfovisLayout:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InteractionImage:STRING=WANT -VTK_MODULE_ENABLE_VTK_InteractionStyle:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InteractionWidgets:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ParallelCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ParallelDIY:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ParallelMPI:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_Python:STRING=NO -VTK_MODULE_ENABLE_VTK_PythonInterpreter:STRING=NO -VTK_MODULE_ENABLE_VTK_RenderingAnnotation:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingContext2D:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingCore:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingExternal:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingFFMPEGOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingFreeType:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingFreeTypeFontConfig:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingGL2PSOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingImage:STRING=WANT -VTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingLOD:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingLabel:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingMatplotlib:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_RenderingOpenGL2:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingOpenVR:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_RenderingParallel:STRING=WANT -VTK_MODULE_ENABLE_VTK_RenderingParallelLIC:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingQt:STRING=NO -VTK_MODULE_ENABLE_VTK_RenderingRayTracing:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingSceneGraph:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingUI:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingVR:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_RenderingVolume:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingVolumeAMR:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingVtkJS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_TestingCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_TestingGenericBridge:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_TestingIOSQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_TestingRendering:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_UtilitiesBenchmarks:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ViewsContext2D:STRING=WANT -VTK_MODULE_ENABLE_VTK_ViewsCore:STRING=WANT -VTK_MODULE_ENABLE_VTK_ViewsInfovis:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ViewsQt:STRING=NO -VTK_MODULE_ENABLE_VTK_WebCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_WebGLExporter:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_WrappingPythonCore:STRING=NO -VTK_MODULE_ENABLE_VTK_WrappingTools:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_cgns:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_cli11:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_diy2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_doubleconversion:STRING=YES -VTK_MODULE_ENABLE_VTK_eigen:STRING=YES -VTK_MODULE_ENABLE_VTK_exodusII:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_expat:STRING=YES -VTK_MODULE_ENABLE_VTK_exprtk:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_fides:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_fmt:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_freetype:STRING=YES -VTK_MODULE_ENABLE_VTK_gl2ps:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_glew:STRING=YES -VTK_MODULE_ENABLE_VTK_h5part:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_hdf5:STRING=YES -VTK_MODULE_ENABLE_VTK_ioss:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_jpeg:STRING=YES -VTK_MODULE_ENABLE_VTK_jsoncpp:STRING=YES -VTK_MODULE_ENABLE_VTK_kissfft:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_kwiml:STRING=YES -VTK_MODULE_ENABLE_VTK_libharu:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_libproj:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_libxml2:STRING=WANT -VTK_MODULE_ENABLE_VTK_loguru:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_lz4:STRING=YES -VTK_MODULE_ENABLE_VTK_lzma:STRING=YES -VTK_MODULE_ENABLE_VTK_metaio:STRING=YES -VTK_MODULE_ENABLE_VTK_netcdf:STRING=YES -VTK_MODULE_ENABLE_VTK_octree:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ogg:STRING=YES -VTK_MODULE_ENABLE_VTK_opengl:STRING=YES -VTK_MODULE_ENABLE_VTK_pegtl:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_png:STRING=YES -VTK_MODULE_ENABLE_VTK_pugixml:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_sqlite:STRING=YES -VTK_MODULE_ENABLE_VTK_theora:STRING=YES -VTK_MODULE_ENABLE_VTK_tiff:STRING=YES -VTK_MODULE_ENABLE_VTK_utf8:STRING=WANT -VTK_MODULE_ENABLE_VTK_verdict:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_vpic:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_vtkm:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_vtksys:STRING=YES -VTK_MODULE_ENABLE_VTK_xdmf2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_xdmf3:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_zfp:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_zlib:STRING=YES -VTK_MODULE_USE_EXTERNAL_VTK_doubleconversion:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_eigen:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_expat:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_exprtk:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_fmt:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_freetype:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_glew:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_jpeg:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_jsoncpp:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_libharu:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_libxml2:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_lz4:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_lzma:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_netcdf:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_ogg:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_png:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_pugixml:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_sqlite:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_theora:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_tiff:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_utf8:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_zlib:BOOL=ON diff --git a/tools/wheel/macos/build-wheel.sh b/tools/wheel/macos/build-wheel.sh index e360ddc86502..b25b48f838c3 100755 --- a/tools/wheel/macos/build-wheel.sh +++ b/tools/wheel/macos/build-wheel.sh @@ -70,17 +70,6 @@ if [[ -n "$build_deps" ]]; then "/opt/drake-wheel-build/dependencies/src" "$resource_root/image/build-dependencies.sh" - - rm -rf /opt/vtk - - rm -rf "/opt/drake-wheel-build/vtk" - mkdir -p "/opt/drake-wheel-build/vtk" - - cp \ - "$resource_root/image/vtk-args" \ - "/opt/drake-wheel-build/vtk/vtk-args" - - "$resource_root/image/build-vtk.sh" fi # ----------------------------------------------------------------------------- diff --git a/tools/wheel/wheel_builder/macos.py b/tools/wheel/wheel_builder/macos.py index 6188a17c5487..52c3d811d916 100644 --- a/tools/wheel/wheel_builder/macos.py +++ b/tools/wheel/wheel_builder/macos.py @@ -117,7 +117,6 @@ def build(options): shutil.copy2(wheel, options.output_dir) if not options.keep_build: - shutil.rmtree('/opt/vtk') shutil.rmtree('/opt/drake-dependencies') shutil.rmtree('/opt/drake') shutil.rmtree(build_root) diff --git a/tools/workspace/BUILD.bazel b/tools/workspace/BUILD.bazel index a609d2dfc6b9..419b8916137c 100644 --- a/tools/workspace/BUILD.bazel +++ b/tools/workspace/BUILD.bazel @@ -113,7 +113,7 @@ _DRAKE_EXTERNAL_PACKAGE_INSTALLS = ["@%s//:install" % p for p in [ "tinyxml2_internal", "usockets_internal", "uwebsockets_internal", - "vtk", + "vtk_internal", "yaml_cpp_internal", ]] + ["//tools/workspace/%s:install" % p for p in [ "abseil_cpp_internal", diff --git a/tools/workspace/default.bzl b/tools/workspace/default.bzl index a4bf80a26c0a..1ce15d65f1e1 100644 --- a/tools/workspace/default.bzl +++ b/tools/workspace/default.bzl @@ -166,6 +166,8 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): if "curl_internal" not in excludes: curl_internal_repository(name = "curl_internal", mirrors = mirrors) if "double_conversion" not in excludes: + # The @double_conversion external is deprecated in Drake's WORKSPACE + # and will be removed on or after 2024-01-01. double_conversion_repository(name = "double_conversion") if "doxygen" not in excludes: doxygen_repository(name = "doxygen", mirrors = mirrors) @@ -192,6 +194,8 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): if "github3_py_internal" not in excludes: github3_py_internal_repository(name = "github3_py_internal", mirrors = mirrors) # noqa if "glew" not in excludes: + # The @glew external is deprecated in Drake's WORKSPACE and will be + # removed on or after 2024-01-01. glew_repository(name = "glew") if "glib" not in excludes: glib_repository(name = "glib") @@ -235,8 +239,12 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): if "liblapack" not in excludes: liblapack_repository(name = "liblapack") if "liblz4" not in excludes: + # The @liblz4 external is deprecated in Drake's WORKSPACE and will be + # removed on or after 2024-01-01. liblz4_repository(name = "liblz4") if "liblzma" not in excludes: + # The @liblzma external is deprecated in Drake's WORKSPACE and will be + # removed on or after 2024-01-01. liblzma_repository(name = "liblzma") if "libpfm" not in excludes: libpfm_repository(name = "libpfm") @@ -355,6 +363,8 @@ def add_default_repositories(excludes = [], mirrors = DEFAULT_MIRRORS): if "voxelized_geometry_tools" not in excludes: voxelized_geometry_tools_repository(name = "voxelized_geometry_tools", mirrors = mirrors) # noqa if "vtk" not in excludes: + # The @vtk external is deprecated in Drake's WORKSPACE and will be + # removed on or after 2024-01-01. vtk_repository(name = "vtk", mirrors = mirrors) if "vtk_internal" not in excludes: vtk_internal_repository(name = "vtk_internal", mirrors = mirrors) diff --git a/tools/workspace/double_conversion/package.BUILD.bazel b/tools/workspace/double_conversion/package.BUILD.bazel index 8c8dd5746e35..b52a8094b89f 100644 --- a/tools/workspace/double_conversion/package.BUILD.bazel +++ b/tools/workspace/double_conversion/package.BUILD.bazel @@ -14,4 +14,5 @@ cc_library( "-ldouble-conversion", ], visibility = ["//visibility:public"], + deprecation = "The @double_conversion external is deprecated in Drake's WORKSPACE and will be removed on or after 2024-01-01.", # noqa ) diff --git a/tools/workspace/glew/repository.bzl b/tools/workspace/glew/repository.bzl index feb6f380bef9..4047835d2e6c 100644 --- a/tools/workspace/glew/repository.bzl +++ b/tools/workspace/glew/repository.bzl @@ -15,5 +15,6 @@ def glew_repository( licenses = licenses, modname = modname, pkg_config_paths = pkg_config_paths, + deprecation = "The @glew external is deprecated in Drake's WORKSPACE and will be removed on or after 2024-01-01.", # noqa **kwargs ) diff --git a/tools/workspace/liblz4/repository.bzl b/tools/workspace/liblz4/repository.bzl index d59267da7393..94855d85c895 100644 --- a/tools/workspace/liblz4/repository.bzl +++ b/tools/workspace/liblz4/repository.bzl @@ -15,5 +15,6 @@ def liblz4_repository( licenses = licenses, modname = modname, pkg_config_paths = pkg_config_paths, + extra_deprecation = "The @liblz4 external is deprecated in Drake's WORKSPACE and will be removed on or after 2024-01-01.", # noqa **kwargs ) diff --git a/tools/workspace/liblzma/repository.bzl b/tools/workspace/liblzma/repository.bzl index f836f01003c8..00dd9d93e9a4 100644 --- a/tools/workspace/liblzma/repository.bzl +++ b/tools/workspace/liblzma/repository.bzl @@ -15,5 +15,6 @@ def liblzma_repository( licenses = licenses, modname = modname, pkg_config_paths = pkg_config_paths, + deprecation = "The @liblzma external is deprecated in Drake's WORKSPACE and will be removed on or after 2024-01-01.", # noqa **kwargs ) diff --git a/tools/workspace/mirrors.bzl b/tools/workspace/mirrors.bzl index ce394d7b0509..960d3c436e42 100644 --- a/tools/workspace/mirrors.bzl +++ b/tools/workspace/mirrors.bzl @@ -53,6 +53,7 @@ DEFAULT_MIRRORS = { "https://drake-mirror.csail.mit.edu/pypi_wheel/{package}/{package}-{version}-{tag}.tar.gz", # noqa "https://s3.amazonaws.com/drake-mirror/pypi_wheel/{package}/{package}-{version}-{tag}.tar.gz", # noqa ], + # On 2024-01-01 upon completion of @vtk deprecation, remove this stanza. "vtk": [ "https://drake-packages.csail.mit.edu/vtk/{archive}", "https://s3.amazonaws.com/drake-packages/vtk/{archive}", diff --git a/tools/workspace/vtk/.dockerignore b/tools/workspace/vtk/.dockerignore deleted file mode 100644 index fe662b2656a8..000000000000 --- a/tools/workspace/vtk/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -/* -!/image/ diff --git a/tools/workspace/vtk/BUILD.bazel b/tools/workspace/vtk/BUILD.bazel index b7a025a70e53..b77b93ae0dbc 100644 --- a/tools/workspace/vtk/BUILD.bazel +++ b/tools/workspace/vtk/BUILD.bazel @@ -3,4 +3,4 @@ load("//tools/lint:lint.bzl", "add_lint_tests") -add_lint_tests(python_lint_extra_srcs = ["find_vtk_headers.py"]) +add_lint_tests() diff --git a/tools/workspace/vtk/Dockerfile b/tools/workspace/vtk/Dockerfile deleted file mode 100644 index c702462641cb..000000000000 --- a/tools/workspace/vtk/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# This Dockerfile and the accompanying shell scripts and patch files are used -# by the project maintainers to create the precompiled vtk binaries that are -# downloaded during the build. They are neither called during the build nor -# expected to be called by most developers or users of the project. - -ARG PLATFORM=ubuntu:20.04 - -# ----------------------------------------------------------------------------- -# Create a base provisioned image. -# ----------------------------------------------------------------------------- - -FROM ${PLATFORM} AS base - -ADD image/provision.sh /image/ -ADD image/prereqs /image/ - -RUN /image/provision.sh - -# ----------------------------------------------------------------------------- -# Build VTK. -# ----------------------------------------------------------------------------- - -FROM base AS vtk - -ADD image/build-vtk.sh /image/ -ADD image/vtk-args /vtk/ - -RUN /image/build-vtk.sh - -ADD image/package.sh /image/ - -RUN /image/package.sh diff --git a/tools/workspace/vtk/README.md b/tools/workspace/vtk/README.md deleted file mode 100644 index 0b87ddb0be75..000000000000 --- a/tools/workspace/vtk/README.md +++ /dev/null @@ -1,456 +0,0 @@ -# VTK - -The files in this directory should by and large be ignored by consumers. -Developers will need to make updates here in order to expose additional features -of VTK, or to update the version of VTK being used by drake. - -The `repository.bzl` file is the core file that enumerates all of the VTK header -files and libraries that are in use by drake's codebase. It does **not** -enumerate all possible files or libraries available in VTK. - -## Distributions - -### Ubuntu - -Compiled artifacts are produced by `build_binaries_with_docker`, and the -associated `Dockerfile` and `image/` directory in this folder. The artifacts -are compiled once by developers and uploaded to drake's `drake-packages` S3 -bucket. When a consumer compiles drake, the `.tar.gz` archive for VTK is -downloaded and extracted as part of the build. As such, any modifications to -the VTK build should modify the naming scheme of the `.tar.gz` file by updating -the `image/package.sh` file's `build_number` variable. Never overwrite a build -artifact of the same name on `drake-packages` as doing so will break any users -trying to perform a historical build. - -The file `image/vtk-args` contains the full set of CMake configuration arguments -used to produce the `vtk*.tar.gz` binaries that are downloaded and extracted -during a normal build of drake. This `vtk-args` file should be considered the -"gold standard" where VTK configurations are concerned. Any differences to this -file for macOS or wheel builds should be documented in their corresponding build -file. - -When developing an upgrade to a new VTK version, developers will need to modify: - -- `image/build-vtk.sh`: update the version of VTK being downloaded to compile. -- `image/vtk-args`: update any CMake configurations needed. Pay close attention - to the docker build during the CMake configure phase. Each VTK upgrade has - potential to change, eliminate, or add new CMake configuration variables. Any - argument in `vtk-args` that is outdated will be warned about by CMake, along - the lines of `Manually-specified variables were not used by the project:`. - These usually indicate that a given CMake variable for VTK has changed. Until - you have arrived at your final changes to `vtk-args`, you are encouraged to - add `-Werror=dev` to the `cmake` invocation in `image/build-vtk.sh`. -- `image/package.sh`: the `vtk_tag` field, which should match `build-vtk.sh`. -- `repository.bzl`: discussed below after the relevant changes for the other - distributions. -- `image/prereqs`: in the event that additional libraries (or fewer) are needed - to compile a new VTK version. Make sure that the corresponding binary - packages are installed in drake's - `setup/ubuntu/binary_distribution/packages-*.txt` file. - -While developing, the primary files to be editing will be `image/vtk-args` and -`repository.bzl`, using the `build_binaries_with_docker` script to produce the -`vtk*.tar.gz` archives. As noted above, a typical consumer drake build will be -downloading archives from `drake-packages`, however for development editing the -`tools/workspace/mirrors.bzl` file will be sufficient to instruct `bazel` to -obtain the `vtk*.tar.gz` from an alternate location. An example change: - -```diff - DEFAULT_MIRRORS = { - # ... other projects ... - "vtk": [ -+ # NOTE: ↓↓↓ there must be three slashes. -+ "file:///abs/path/to/drake/tools/workspace/vtk/{archive}", -+ # "https://drake-packages.csail.mit.edu/vtk/{archive}", -+ # "https://s3.amazonaws.com/drake-packages/vtk/{archive}", -- "https://drake-packages.csail.mit.edu/vtk/{archive}", -- "https://s3.amazonaws.com/drake-packages/vtk/{archive}", - ], - } -``` - -Comment out the existing archive URLs, and add a `file://` URL to the directory -where the artifacts from `build_binaries_with_docker` reside on your local -machine. You will additionally need to modify `repository.bzl` to update the -`sha256` for the corresponding archives (search `sha256` in that file). - -VTK archives for compiling drake hosted at -https://drake-packages.csail.mit.edu/vtk are accessible for 5 years after the -date of creation. Afterward they are moved to glacier storage on s3 and will -not be available for public download. - -### macOS - -Compiled artifacts are produced by -[`homebrew-director`](https://github.com/RobotLocomotion/homebrew-director), -which is tapped and the corresponding VTK version installed in -`setup/mac/binary_distribution/Brewfile`. The associated VTK `.rb` file under -the `Formula` directory in that repository contains the relevant CMake -configurations. They should match the `image/vtk-args` file in this directory -as closely as possible. The only differences should be possible external -dependencies available via `brew` that drake does not depend on, and some -`brew` specific items such as `-DCMAKE_INSTALL_RPATH:STRING=#{lib}`. Any other -differences to `image/vtk-args` should be documented in that file. - -Precompiled binaries for `brew` are called "bottles". When the macOS consumer -of drake runs `setup/mac/install_prereqs.sh`, the precompiled bottles for this -new VTK formula in `homebrew-director` will be downloaded and installed from -the `drake-homebrew` S3 bucket. Additional bottling instructions are available -in the "Drake Continuous Integration Details" internal document. - -Note: when testing your pull request / bottles, make sure to request an -unprovisioned build from the jenkins bot for macOS. - -### Pip Wheels (`manylinux`) - -The wheel build docker infrastructure and the docker infrastructure in this -folder are as similar as possible, and generally speaking the instructions in -the Ubuntu section above apply here (except for `mirrors.bzl`, which is -irrelevant, and there is no correlated `package.sh`). The primary differences -between the `image/vtk-args` in this directory and the wheel build: - -- The wheel builds are static to avoid linker / `LD_LIBRARY_PATH` wrangling for - the resultant pip wheels. -- The `CMAKE_CXX_FLAGS` found in `image/vtk-args` in this directory, for example - `-D_FORTIFY_SOURCE=2`, are excluded as they introduce additional complexity - for the wheel build that is not desirable. Those flags are used in - `image/vtk-args` in this directory to mirror what `bazel` compiles the rest - of drake with, which does not apply to the wheel builds. -- The `vtk-args` for the wheel builds request that VTK builds more of its - external dependencies as part of its build. Any external dependency for the - wheel builds must be packaged in `tools/wheel/image/dependencies/projects`. - If an external dependency of VTK is already packaged there, it is reused. - Otherwise, since the wheel builds are static, the configurations there request - that VTK builds it internally. - -Any discrepancies between `image/vtk-args` in this directory and -`tools/wheel/image/vtk-args` should be documented at the top of the file. - -## `repository.bzl` - -This file enumerates all of the header files and VTK libraries consumed directly -or indirectly (transitively) by drake. There are two kinds of libraries: a -"private VTK library" (something vendored by VTK as part of its build, e.g., -`vtksys`), or a "public VTK library". - -### Private VTK Libraries - -For each library, it is necessary to supply the appropriate dependencies as well -as for `manylinux` (wheel) supply the appropriate linker flags (e.g., add `-ldl` -and/or `-lpthread`). Each internal / private library from VTK is all lower -case, which makes it easy to distinguish them from the public VTK libraries. -Assuming you have built a `vtk*.tar.gz` archive using -`build_binaries_with_docker`, and extracted that archive in a directory called -`vtk_extract`, you can create the following script to help identify what the -`deps` of a given `_vtk_cc_library` call will be: - -```py -from pathlib import Path -import subprocess - -this_file_dir = Path(__file__).parent.absolute() - -# NOTE: update "vtk_extract" to wherever you have extracted the VTK .tar.gz. -lib_dir = this_file_dir / "vtk_extract" / "lib" -for lib in sorted(lib_dir.glob("*.so")): - if lib.name.lower() == lib.name: - vsep = "*" * 44 - print(f"{vsep}\n* {lib.name}\n{vsep}") - subprocess.run(["ldd", str(lib)]) -``` - -The private VTK libraries should not include any `hdrs` in their call to -`_vtk_cc_library`. The `vtkkwiml` library is the only exception, its headers -are needed. The above script will help you identify what the `deps` are. -Additionally, as you can see in the `repository.bzl`, any time that libdl or -pthread show up in the output for `ldd`, a switch is needed: - -```py -if os_result.is_manylinux: - file_content += _vtk_cc_library( - os_result, - "vtkloguru", - linkopts = ["-ldl", "-pthread"], - ) -else: - file_content += _vtk_cc_library(os_result, "vtkloguru") -``` - -### Public VTK Libraries - -The majority of your time and effort when updating to a new VTK version will be -spent identifying any new or changed libraries that drake consumes directly. -The library names and targets do not usually change very often (except for -possibly the introduction of a new library or changed internal dependencies), -but you should expect that the header files will change or possibly be deleted. -The `_vtk_cc_library` command will by default mark any library that does not -have `hdrs` defined as "private visibility", meaning other packages within drake -will not be able to link directly against this. Conversely, the libraries that -are currently being used elsewhere in drake will need to have the header files -that are `#include`ed (directly, and transitively). - -What you will need to update are the `hdrs` and `deps` for each public library. -To see what the VTK module dependencies are, you can inspect VTK's source -tree. For example, for `vtkCommonCore` and `vtkCommonDataModel`: - -- `VTK/Common/Core/vtk.module` -- `VTK/Common/DataModel/vtk.module` - -Make sure to include the sections from both `DEPENDS` and `PRIVATE_DEPENDS`. -The vtk.module file will help determine what the `deps` field for a given -library should be. Where header files are concerned, a bit of manual effort is -required to determine which header files to include. You can obtain a full list -of header files a given VTK module produces by running the `find_vtk_headers.py` -file. This full list can be used to determine which libraries drake is actually -consuming. You can obtain the current list of header files drake uses by: - -```console -# invoke just the `grep` command to see which files. -$ grep -rH '#include ' . | \ - sed 's/.*\(#include.*\)/\1/g' | sort | uniq > headers.txt -``` - -You can also find all of the locations where a drake component depends on a -vtk library by - -```console -# Invoke just the `grep` command to see which files. -$ grep -rH '@vtk//' . | \ - sed 's#.*\(@vtk//.*\)#\1#g' | sort | uniq > deps.txt -``` - -Compare headers with the list(s) produced by `find_vtk_headers.py` to determine -which VTK modules are needed _directly_ by drake. With your list of direct -dependencies, the `vtk.module` dependencies will enumerate the indirect -dependencies of libraries consumed by drake. - -While there may be a more direct way to solve which transitive headers are -needed (e.g., with IWYU), the header list for each `_vtk_cc_library` call -started by enumerating every header available (commented out) and -iteratively re-compiling / un-commenting a given header file until all -compilation errors were resolved. Then delete all remaining commented out -header files. You can begin with `bazel build //geometry/render/...` which -currently contains a large subset of the VTK usage within drake, but you will -need to compile other targets such as `bazel build //manipulation/util:stl2obj` -and eventually `bazel build //...`. - -When you believe that you have the final list of libraries updated, you must -run the tests. To begin, the core tests that will affect your work are going -to be `bazel test //geometry/render/...`, but you will eventually need to make -sure that `bazel test //...` works as expected (for testing installation). -The VTK test tags are defined in `tools/skylark/test_tags.bzl:vtk_test_tags()`, -currently you can run - -```console -$ bazel test \ - --test_tag_filters=no_drd,no_helgrind,no_lsan,no_memcheck,no-sandbox \ - //... -``` - -or to test the install logic specifically: - -```console -$ bazel test //:py/install_test -``` - -## Bisecting VTK - -During the upgrade, you may have failing tests particularly from -`bazel test //geometry/render/...` that may not be obvious to fix. Since you -will likely be upgrading against a significant amount of changes within VTK, the -best approach will be to bisect VTK by temporarily manipulating the build system -in drake to point to an externally compiled (by you) source tree of VTK. To -begin, you will need to update `repository.bzl` to point to the right locations. -Since some of the library dependencies or names may change, you may need to -temporarily update `*.bzl` files outside of the `tools/workspace/vtk` folder, -address those as needed. For updates to `repository.bzl`, - -1. In the `_vtk_cc_library` function, it may serve to your advantage to just - make every library publicly visible (related to temporary updates outside of - `tools/workspace/vtk`). - - ```diff - + visibility = ["//visibility:public"] - + - if not deps: - deps = [] - ``` - -2. In the `_vtk_cc_library` function, you might need to update to use linker - options rather than specify srcs. In the past, we've used this change while - bisecting, but it might not have been strictly required. - - ```diff - elif os_result.is_ubuntu: - if not header_only: - - srcs = ["lib/lib{}-{}.so.1".format(name, VTK_MAJOR_MINOR_VERSION)] - + lib_dir = "/abs/path/to/custom/vtk/install/lib" - + linkopts = linkopts + [ - + "-L{}".format(lib_dir), - + "-l{}-{}".format(name, VTK_MAJOR_MINOR_VERSION) - + ] - ``` - -3. In the `_impl(repository_ctx)` function, you will need to comment out the - ubuntu section that sets `archive`, `sha256`, and calls - `repository_ctx.download_and_extract`. Replace it with something like - - ```py - inc_dir = "/abs/path/to/custom/vtk/install/include" - repository_ctx.symlink(inc_dir, "include") - ``` - -4. At the top of `repository.bzl` you will need to update - `VTK_MAJOR_MINOR_VERSION` (as it is used in the linker options from (2)). - As you bisect, the VTK major/minor version can be found most easily by - - ```console - $ find /abs/path/to/custom/vtk/lib -name "*.so" - ``` - - and examine the library suffixes. You may see `libvtkFiltersPoints-8.90.so` - (so `VTK_MAJOR_MINOR_VERSION = "8.90"`), or `libvtkFiltersPoints-9.0.so` - (so `VTK_MAJOR_MINOR_VERSION = "9.0"`). - -5. As you bisect, you may need to comment out `_vtk_cc_library` calls for - private internal vtk libraries (such as `vtkmft`) and their corresponding - usage in `deps` of other libraries (so comment out `":vtkmft"`). - -6. Similarly, different header files may not be found, or new files that are - not currently enumerated in `repository.bzl` may be required. For header - files reported as not found by `bazel`, simply comment them out. For header - files that are needed but not listed yet, the fastest solution to make them - available to every location is by adding them to the `hdrs` of - `"vtkCommonCore"`. - -7. You will probably need to comment out the `fail()` clause in - `_check_licenses_impl` the file `tools/install/check_licenses.bzl`. - -8. Until your work is complete, you will be best served to keep your bisected - builds / installation trees around. If you need to bisect a second time, - since you will be starting with the same `good` and `bad` commits, you will - be able to reuse them until the bisect diverges. - -A successful workflow was to have the following directory structure (outside of -your drake repository): - -``` -vtk-bisect/ -├── rebuild.sh -├── vtk-build -├── vtk-installs -└── vtk-src -``` - -where - -- `vtk-src` is a git clone of the VTK source tree. This is where you will be - bisecting. -- `vtk-build` is just a scratch build directory. -- `vtk-installs` is where each bisected commit is getting installed. -- `rebuild.sh` is a helper script to aid you in producing the installations, - assuming you have `vtk-src` as your clone directory. Its contents are below: - -```bash -#!/usr/bin/env bash - -set -x -# Assumes you are always running `./rebuild.sh`! Updated accordingly... -here="$(pwd)" -# Wherever your `git clone` of the VTK source lives. -src="$here/vtk-src" -# As you bisect, each commit will produce different results for `git describe`. -inst="$here/vtk-installs/$(git -C "$src" describe)" -if ! [[ -d "$inst" ]]; then - echo "I am building" - rm -rf vtk-build - mkdir vtk-build - cd vtk-build - # If desired, you can update the below to also add whatever is in - # image/vtk-args to reduce the total size of the build by turning off - # various dependencies or unnecessary VTK components. - cmake -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$inst \ - -DVTK_BUILD_TESTING=OFF \ - $src - ninja install -else - echo "DONE: $inst already exists!" -fi -``` - -With the infrastructure in place, you will need to begin bisecting. In one -terminal in `vtk-src`, `git bisect start` and then use `git bisect good vX.Y.Z` -where `vX.Y.Z` is the VTK git tag that you are updating away from (what drake is -currently using). Now `git bisect bad vA.B.C` where `vA.B.C` is the VTK git tag -that you are upgrading drake to. The `git bisect` will then put you at some -specific commit to begin your work. Now that the bisect has started, the -process works as follows: - -1. Run `rebuild.sh` to produce a VTK installation of the current commit under - inspection. - -2. Update `repository.bzl` according to the instructions above to change the - `VTK_MAJOR_MINOR_VERSION`, `lib_dir`, and `inc_dir` to point to the new - locations. If you forget which directory you were installing to, recall that - in the terminal that is performing the `git bisect` you can run - `git describe` and then look at `vtk-installs` to see which one it is. - -3. Run your test or program, noting that you will need to set `LD_LIBRARY_PATH` - for most scenarios. If you were failing a specific test in a given test file - then you could comment out all of the other tests, and then run - `LD_LIBRARY_PATH=${lib_dir} bazel test //the/test/that:fails` where - `${lib_dir}` would be the same absolute path you updated `repository.bzl` to - and `//the/test/that:fails` is the actual test target. Or, if you are - inspecting visual results, - `LD_LIBRARY_PATH=${lib_dir} bazel run //the/target/under:inspection`. - - During this phase is when you will encounter various build errors such as - not being able to find a library that was created using `_vtk_cc_library` - (step (5) above, comment it out), or comment out / add header files as needed - (step (6) above). Eventually your test or program will run after making the - requisite modifications. As you continue the bisect, the number of changes - needed for libraries / headers will likely decrease. - -4. Now that (3) runs, identify whether the test or application behaves correctly - or not and in the `vtk-src` directory `git bisect good` or `git bisect bad` - accordingly. Now `rebuild.sh` using steps 1-4 here again until the process - is complete. - -The process is fairly time consuming as each step requires a rebuild and install -of VTK as well as modifying `LD_LIBRARY_PATH` for `bazel` commands will require -many items to be rebuilt. Avoid rebuilding more of drake than you need to by -only testing / running the specific target that you need to. The rest of drake -that depends on VTK will not be rebuilt. - -## `drake_visualizer` - -During the upgrade to VTK-9, the `tools/workspace/drake_visualizer` folder was -updated to build VTK-8 from source. Its `Dockerfile` and related infrastructure -is closely related to the infrastructure found in this folder, but will become -irrelevant when `drake_visualizer` support is dropped. Previously the -`drake_visualizer` build would consume the same `vtk*.tar.gz` archive that drake -used in its build for VTK-8. As a result, it would contain libraries looking -for eventual linker references to VTK-8 libraries that would come together at -the end of build or install. The VTK-9 update required keeping VTK-8 available -for `drake_visualizer`, which meant that - -1. The `drake_visualizer` build needed to build VTK-8 internally and bundle it. -2. Both VTK-8 and VTK-9 are installed side-by-side with drake. - -Where (2) is concerned, the special cases in - -- `tools/install/bazel/drake.BUILD.bazel` -- `tools/install/installer.py` - -for VTK-8 or "director" (what `drake_visualizer` uses) specific libraries should -be removed. - -As part of the testing process for the VTK-9 upgrade, given the side-by-side -VTK-8 and VTK-9 install, it was required to include in the testing process -`rm -rf ${prefix} && bazel run //:install -- ${prefix}`, where `${prefix}` is -any temporary directory to install cleanly upon. Then make sure that you can -run `${prefix}/bin/drake-visualizer` (to validate that the `LD_LIBRARY_PATH`, -rpath, and `PYTHONPATH` manipulations work correctly) in addition to validating -that `bazel run //tools:drake_visualizer` works. diff --git a/tools/workspace/vtk/build_binaries_with_docker b/tools/workspace/vtk/build_binaries_with_docker deleted file mode 100755 index 98c4869a2007..000000000000 --- a/tools/workspace/vtk/build_binaries_with_docker +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -# This shell script and the accompanying Dockerfile and patch files are used by -# the project maintainers to create the precompiled vtk binaries that are -# downloaded during the build. They are neither called during the build nor -# expected to be called by most developers or users of the project. - -set -eu -o pipefail - -salt=$(dd if=/dev/urandom bs=2 count=4 | od -An -x | tr -d ' ') -tag_prefix=vtk:$(date -u +%Y%m%d%H%M%S)-$salt - -declare -a images - -trap cleanup EXIT - -############################################################################### - -cleanup() -{ - [ ${#images[@]} -gt 0 ] && docker image rm "${images[@]}" -} - -build() -{ - local tag=${tag_prefix}-$1 - shift 1 - - docker build \ - --force-rm --tag $tag \ - "$@" "$(dirname "${BASH_SOURCE}")" - images+=($tag) -} - -extract() -{ - local tag=${tag_prefix}-$1 - - docker run --rm $tag \ - bash -c 'tar -cf - /opt/vtk/vtk-*.tar.gz{,.sha256}' | \ - tar --strip-components=2 -xf - -} - -############################################################################### - -rm -f vtk-*.tar.gz{,.sha256} - -build focal --build-arg PLATFORM=ubuntu:20.04 -extract focal - -# On Ubuntu 22.04 non-wheel builds, we use Ubuntu's build of VTK 9.1 in order -# to improve ABI compatibility with the host operating system, so we don't need -# to build a binary archive here for it. diff --git a/tools/workspace/vtk/find_vtk_headers.py b/tools/workspace/vtk/find_vtk_headers.py deleted file mode 100644 index 63c60ba6b129..000000000000 --- a/tools/workspace/vtk/find_vtk_headers.py +++ /dev/null @@ -1,258 +0,0 @@ -""" -Utility module for helping discover which vtk library produces which headers. - -For creating repository.bzl, we seek a listing of the relevant header files a -given vtk library produces. This module enumerates all possible header files -that a given vtk library produces. Since the VTK build generates header files -the prerequisite for running this file is that you have: - -1. An extracted (or cloned) VTK source tree. -2. A CMake configured build directory of (1). You do not need to compile or - install this build tree, but the CMake configure step will produce - additional header files for a given VTK module. You should use the same - CMake arguments as specified in /tools/workspace/vtk/image/vtk-args. -3. A drake vtk-*.tar.gz tarball, as produced by ``build_binaries_with_docker``. - This will be parsed as the "install reference", not all VTK headers get - installed and we only want to enumerate headers that can actually be - consumed. VTK installs to a flat tree, meaning the install tree does not - provide us with the ability to recover which VTK module a given header file - came from. - -The final argument to the script is the name of the VTK module to parse, e.g., -``vtkCommonCore``. This module will then compare all headers found in (1) and -(2) with headers found in (3). There is a --debug option enabled to enumerate -everything that was found and skipped, but it is disabled by default to enable -piping this script to e.g., ``xclip -i -selection clipboard`` to paste into -``repository.bzl``. -""" -import argparse -from pathlib import Path -import tarfile -import sys - -this_file_dir = Path(__file__).parent.absolute() - -VTK_MODULES = [ - "vtkCommonColor", - "vtkCommonComputationalGeometry", - "vtkCommonCore", - "vtkCommonDataModel", - "vtkCommonExecutionModel", - "vtkCommonMath", - "vtkCommonMisc", - "vtkCommonSystem", - "vtkCommonTransforms", - "vtkDICOMParser", - "vtkFiltersCore", - "vtkFiltersGeometry", - "vtkFiltersGeneral", - "vtkFiltersHybrid", - "vtkFiltersSources", - "vtkImagingCore", - "vtkImagingMath", - "vtkImagingSources", - "vtkIOCore", - "vtkIOExport", - "vtkIOGeometry", - "vtkIOImage", - "vtkIOImport", - "vtkIOLegacy", - "vtkIOXML", - "vtkIOXMLParser", - "vtkRenderingCore", - "vtkRenderingContext2D", - "vtkRenderingFreeType", - "vtkRenderingOpenGL2", - "vtkRenderingSceneGraph", - "vtkRenderingUI", - "vtkRenderingVtkJS", -] -""" -A non-exhaustive list of vtk modules under consideration. - -Each element must also be entered as a key in VTK_SOURCE_MAP below. -""" - -VTK_SOURCE_MAP = { - "vtkCommonColor": Path("Common") / "Color", - "vtkCommonComputationalGeometry": Path("Common") / "ComputationalGeometry", - "vtkCommonCore": Path("Common") / "Core", - "vtkCommonDataModel": Path("Common") / "DataModel", - "vtkCommonExecutionModel": Path("Common") / "ExecutionModel", - "vtkCommonMath": Path("Common") / "Math", - "vtkCommonMisc": Path("Common") / "Misc", - "vtkCommonSystem": Path("Common") / "System", - "vtkCommonTransforms": Path("Common") / "Transforms", - "vtkDICOMParser": Path("Utilities") / "DICOMParser", - "vtkFiltersCore": Path("Filters") / "Core", - "vtkFiltersGeometry": Path("Filters") / "Geometry", - "vtkFiltersGeneral": Path("Filters") / "General", - "vtkFiltersHybrid": Path("Filters") / "Hybrid", - "vtkFiltersSources": Path("Filters") / "Sources", - "vtkImagingCore": Path("Imaging") / "Core", - "vtkImagingMath": Path("Imaging") / "Math", - "vtkImagingSources": Path("Imaging") / "Sources", - "vtkIOCore": Path("IO") / "Core", - "vtkIOExport": Path("IO") / "Export", - "vtkIOGeometry": Path("IO") / "Geometry", - "vtkIOImage": Path("IO") / "Image", - "vtkIOImport": Path("IO") / "Import", - "vtkIOLegacy": Path("IO") / "Legacy", - "vtkIOXML": Path("IO") / "XML", - "vtkIOXMLParser": Path("IO") / "XMLParser", - "vtkRenderingCore": Path("Rendering") / "Core", - "vtkRenderingContext2D": Path("Rendering") / "Context2D", - "vtkRenderingFreeType": Path("Rendering") / "FreeType", - "vtkRenderingOpenGL2": Path("Rendering") / "OpenGL2", - "vtkRenderingSceneGraph": Path("Rendering") / "SceneGraph", - "vtkRenderingUI": Path("Rendering") / "UI", - "vtkRenderingVtkJS": Path("Rendering") / "VtkJS", -} -""" -Map of vtk library name to path under the source tree that the library lives. -""" - - -def main(): - parser = argparse.ArgumentParser( - description="Find header files for a given VTK module.", - formatter_class=argparse.RawDescriptionHelpFormatter, - epilog=__doc__, - ) - - parser.add_argument( - "-s", - "--source-tree", - dest="source_tree", - type=str, - help="The VTK source tree root (contains top-level CMakeLists.txt).", - required=True, - ) - parser.add_argument( - "-b", - "--build-tree", - dest="build_tree", - type=str, - help="The VTK source build tree (where you configured CMake).", - required=True, - ) - parser.add_argument( - "-i", - "--install-tarball", - dest="install_tarball", - type=str, - help="VTK install tarball to parse.", - required=True, - ) - parser.add_argument("--debug", action="store_true") - parser.add_argument( - "module", type=str, help="VTK module to parse.", choices=VTK_MODULES - ) - - args = parser.parse_args() - - module = args.module - - source_root = Path(args.source_tree).absolute() - if not source_root.is_dir(): - sys.stderr.write( - f"Provided source tree '{str(source_root)}' is not a directory!\n" - ) - sys.exit(1) - if ( - not (source_root / "CMakeLists.txt").is_file() - or not (source_root / "Common" / "Core").is_dir() - ): - sys.stderr.write( - f"Source tree '{str(source_root)}' did not have top-level " - "CMakeLists.txt, or sub-directory 'Common/Core'. Is this a VTK " - "source tree?\n" - ) - sys.exit(1) - - build_root = Path(args.build_tree).absolute() - if not build_root.is_dir(): - sys.stderr.write( - f"Build folder '{str(build_root)}' is not a directory!\n" - ) - sys.exit(1) - if not (build_root / "CMakeCache.txt").is_file(): - sys.stderr.write( - f"Did not find CMakeCache.txt in '{str(build_root)}', did you " - "already configure the VTK build using CMake?\n" - ) - sys.exit(1) - - install_tarball = Path(args.install_tarball).absolute() - if not install_tarball.is_file() or not install_tarball.name.endswith( - ".tar.gz" - ): - sys.stderr.write( - f"Install tarball '{str(install_tarball)}' must be a file with " - "`.tar.gz` suffix!\n" - ) - sys.exit(1) - - # First gather all of the installed files from the tarball. - installed_headers = [] - HEADER_EXTS = [".h", ".hpp", ".hxx", ".txx"] - try: - with tarfile.open(install_tarball, "r") as vtk_tar_f: - for name in vtk_tar_f.getnames(): - # NOTE: this does give some false positive results from e.g., - # kwwiml and other utility libraries, but we can ignore them - # since we do an intersection below. - if name.startswith("include"): - name_p = Path(name) - if ( - name_p.name.startswith("vtk") - and name_p.suffix in HEADER_EXTS - ): - installed_headers.append(name_p.name) - except Exception as e: - sys.stderr.write(f"Error parsing '{str(install_tarball)}': {e}\n") - sys.exit(1) - - # Gather all headers available in the source and build trees. - source_module = source_root / VTK_SOURCE_MAP[module] - sources = [] - mod = VTK_SOURCE_MAP[module] - for ext in HEADER_EXTS: - for tree in [source_root / mod, build_root / mod]: - tree_glob = tree.glob(f"**/*{ext}") - for tg in tree_glob: - sources.append(tg.name) - sources = list(set(sources)) - sources.sort() - - # End goal is the intersection of installed and source tree headers. - found = list(set(installed_headers) & set(sources)) - found.sort() - - # NOTE: depending on CMake configure, you may get many more skipped headers - # than if you were to run this within the docker build somehow. This can - # generally be ignored, the out-of-docker build will be a superset. - if args.debug: - vsep = "*" * 88 - print(f"{vsep}\n* Sources found:\n{vsep}") - for s in sources: - print(s) - - skipped = list(set(sources) - set(found)) - skipped.sort() - - print(f"\n{vsep}\n* Skipped:\n{vsep}") - if skipped: - for s in skipped: - print(s) - else: - print("NONE") - - print(f"\n{vsep}\n* Install found:\n{vsep}") - - for f in found: - print(f) - - -if __name__ == "__main__": - main() diff --git a/tools/workspace/vtk/image/build-vtk.sh b/tools/workspace/vtk/image/build-vtk.sh deleted file mode 100755 index 6f9c88b6817b..000000000000 --- a/tools/workspace/vtk/image/build-vtk.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -readonly VTK_VERSION=9.1.0 - -mkdir -p /vtk -cd /vtk - -git clone \ - --branch v${VTK_VERSION} --depth 1 \ - https://gitlab.kitware.com/vtk/vtk.git src - -mkdir -p /vtk/build -cd /vtk/build - -mapfile -t VTK_CMAKE_ARGS < <(sed -e '/^#/d' -e 's/^/-D/' < /vtk/vtk-args) - -cmake "${VTK_CMAKE_ARGS[@]}" -GNinja -Wno-dev /vtk/src - -ninja install/strip diff --git a/tools/workspace/vtk/image/package.sh b/tools/workspace/vtk/image/package.sh deleted file mode 100755 index 0ab9da97627c..000000000000 --- a/tools/workspace/vtk/image/package.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -# Get various version numbers. -readonly vtk_tag=vtk-9.1.0 -# To re-package, increase build_number by 1 and update repository.bzl to avoid -# overwriting artifacts thus breaking historical builds. -readonly build_number=3 -readonly platform=$(lsb_release --codename --short)-$(uname --processor) - -# Create archive named: -# vtk- -# - -# - -# -.tar.gz -readonly archive=${vtk_tag}-${build_number}-${platform}.tar.gz -cd /opt/vtk - -tar czf $archive -- * -shasum --algorithm 256 $archive | tee $archive.sha256 diff --git a/tools/workspace/vtk/image/prereqs b/tools/workspace/vtk/image/prereqs deleted file mode 100644 index e625927939f9..000000000000 --- a/tools/workspace/vtk/image/prereqs +++ /dev/null @@ -1,33 +0,0 @@ -ca-certificates -cmake -g++ -gcc -git -gpg -libdouble-conversion-dev -libeigen3-dev -libexpat1-dev -libfreetype6-dev -libgl1-mesa-dev -libglew-dev -libglib2.0-dev -libglu1-mesa-dev -libglvnd-dev -libhdf5-dev -libjpeg-turbo8-dev -libjsoncpp-dev -liblz4-dev -liblzma-dev -libnetcdf-dev -libogg-dev -libpng-dev -libsqlite3-dev -libtheora-dev -libtiff5-dev -libxml2-dev -libxt-dev -lsb-release -ninja-build -python-is-python3 -wget -zlib1g-dev diff --git a/tools/workspace/vtk/image/provision.sh b/tools/workspace/vtk/image/provision.sh deleted file mode 100755 index db570517fc5e..000000000000 --- a/tools/workspace/vtk/image/provision.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -export DEBIAN_FRONTEND=noninteractive - -# Install prerequisites. -apt-get -y update -apt-get -y upgrade - -xargs -d$'\n' apt-get -y install --no-install-recommends < /image/prereqs diff --git a/tools/workspace/vtk/image/vtk-args b/tools/workspace/vtk/image/vtk-args deleted file mode 100644 index 96b1373f29f9..000000000000 --- a/tools/workspace/vtk/image/vtk-args +++ /dev/null @@ -1,274 +0,0 @@ -# Basic build configuration. -CMAKE_BUILD_TYPE:STRING=Release -BUILD_SHARED_LIBS:BOOL=ON -CMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON -CMAKE_CXX_STANDARD:STRING=17 -CMAKE_INSTALL_PREFIX:PATH=/opt/vtk -# VTK by default installs license files to `share/licenses/PROJECT_NAME`, we -# want the license files to end up in `share/doc/PROJECT_NAME`. -CMAKE_INSTALL_LICENSEDIR:STRING=share/doc/vtk-9.1 -CMAKE_C_FLAGS:STRING='-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wno-deprecated-declarations' -CMAKE_CXX_FLAGS:STRING='-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wno-deprecated-declarations' -CMAKE_EXE_LINKER_FLAGS:STRING='-Wl,-Bsymbolic-functions -Wl,-z,now -Wl,-z,relro' -CMAKE_MODULE_LINKER_FLAGS:STRING='-Wl,-Bsymbolic-functions -Wl,-z,now -Wl,-z,relro' -CMAKE_SHARED_LINKER_FLAGS:STRING='-Wl,-Bsymbolic-functions -Wl,-z,now -Wl,-z,relro' -# VTK-specific build configuration. -BUILD_TESTING:BOOL=OFF -VTK_ENABLE_WRAPPING:BOOL=OFF -VTK_WRAP_PYTHON:BOOL=OFF -# Third party libraries. -VTK_BUILD_ALL_MODULES:BOOL=OFF -VTK_GROUP_ENABLE_Imaging:STRING=YES -VTK_GROUP_ENABLE_MPI:STRING=DONT_WANT -VTK_GROUP_ENABLE_Qt:STRING=NO -VTK_GROUP_ENABLE_Rendering:STRING=YES -VTK_GROUP_ENABLE_StandAlone:STRING=DONT_WANT -VTK_GROUP_ENABLE_Views:STRING=DONT_WANT -VTK_GROUP_ENABLE_Web:STRING=DONT_WANT -VTK_LEGACY_REMOVE:BOOL=ON -VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmCore:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmDataModel:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_AcceleratorsVTKmFilters:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_ChartsCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_CommonArchive:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_CommonColor:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonComputationalGeometry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_CommonCore:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonDataModel:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonExecutionModel:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonMath:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonMisc:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonSystem:STRING=YES -VTK_MODULE_ENABLE_VTK_CommonTransforms:STRING=YES -VTK_MODULE_ENABLE_VTK_DICOMParser:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_DomainsChemistry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_DomainsChemistryOpenGL2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_DomainsMicroscopy:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_DomainsParallelChemistry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersAMR:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersCore:STRING=YES -VTK_MODULE_ENABLE_VTK_FiltersExtraction:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersFlowPaths:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersGeneral:STRING=YES -VTK_MODULE_ENABLE_VTK_FiltersGeneric:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersGeometry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersHybrid:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersHyperTree:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersImaging:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersModeling:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersOpenTURNS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallel:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelDIY2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelFlowPaths:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelGeometry:STRING=WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelImaging:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelMPI:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelStatistics:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersParallelVerdict:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersPoints:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersProgrammable:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersReebGraph:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersSMP:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersSelection:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersSources:STRING=YES -VTK_MODULE_ENABLE_VTK_FiltersStatistics:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersTexture:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersTopology:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_FiltersVerdict:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GUISupportQt:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GUISupportQtQuick:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GUISupportQtSQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GeovisCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_GeovisGDAL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOADIOS2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOAMR:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOAsynchronous:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOCGNSReader:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOCONVERGECFD:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOChemistry:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOCityGML:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOCore:STRING=YES -VTK_MODULE_ENABLE_VTK_IOEnSight:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOExodus:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOExport:STRING=YES -VTK_MODULE_ENABLE_VTK_IOExportGL2PS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOExportPDF:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOFFMPEG:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOFides:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOGDAL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOGeoJSON:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOGeometry:STRING=YES -VTK_MODULE_ENABLE_VTK_IOH5Rage:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOH5part:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOHDF:STRING=WANT -VTK_MODULE_ENABLE_VTK_IOIOSS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOImage:STRING=YES -VTK_MODULE_ENABLE_VTK_IOImport:STRING=YES -VTK_MODULE_ENABLE_VTK_IOInfovis:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOLAS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOLSDyna:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOLegacy:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMINC:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMPIImage:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMPIParallel:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMotionFX:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMovie:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOMySQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IONetCDF:STRING=YES -VTK_MODULE_ENABLE_VTK_IOODBC:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOOMF:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOOggTheora:STRING=WANT -VTK_MODULE_ENABLE_VTK_IOOpenVDB:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOPDAL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOPIO:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOPLY:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallel:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelExodus:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelLSDyna:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelNetCDF:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelXML:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOParallelXdmf3:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOPostgreSQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOSQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOSegY:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOTRUCHAS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOTecplotTable:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOVPIC:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOVeraOut:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOVideo:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOXML:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOXMLParser:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOXdmf2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_IOXdmf3:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingColor:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingCore:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingFourier:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingGeneral:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingHybrid:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingMath:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingMorphological:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingOpenGL2:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingSources:STRING=YES -VTK_MODULE_ENABLE_VTK_ImagingStatistics:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ImagingStencil:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InfovisBoost:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InfovisBoostGraphAlgorithms:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InfovisCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InfovisLayout:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InteractionImage:STRING=WANT -VTK_MODULE_ENABLE_VTK_InteractionStyle:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_InteractionWidgets:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ParallelCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ParallelDIY:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ParallelMPI:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_Python:STRING=NO -VTK_MODULE_ENABLE_VTK_PythonInterpreter:STRING=NO -VTK_MODULE_ENABLE_VTK_RenderingAnnotation:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingContext2D:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingCore:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingExternal:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingFFMPEGOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingFreeType:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingFreeTypeFontConfig:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingGL2PSOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingImage:STRING=WANT -VTK_MODULE_ENABLE_VTK_RenderingLICOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingLOD:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingLabel:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingMatplotlib:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_RenderingOpenGL2:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingOpenVR:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_RenderingParallel:STRING=WANT -VTK_MODULE_ENABLE_VTK_RenderingParallelLIC:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingQt:STRING=NO -VTK_MODULE_ENABLE_VTK_RenderingRayTracing:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingSceneGraph:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingUI:STRING=YES -VTK_MODULE_ENABLE_VTK_RenderingVR:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_RenderingVolume:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingVolumeAMR:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2:STRING=DEFAULT -VTK_MODULE_ENABLE_VTK_RenderingVtkJS:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_TestingCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_TestingGenericBridge:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_TestingIOSQL:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_TestingRendering:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_UtilitiesBenchmarks:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ViewsContext2D:STRING=WANT -VTK_MODULE_ENABLE_VTK_ViewsCore:STRING=WANT -VTK_MODULE_ENABLE_VTK_ViewsInfovis:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ViewsQt:STRING=NO -VTK_MODULE_ENABLE_VTK_WebCore:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_WebGLExporter:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_WrappingPythonCore:STRING=NO -VTK_MODULE_ENABLE_VTK_WrappingTools:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_cgns:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_cli11:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_diy2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_doubleconversion:STRING=YES -VTK_MODULE_ENABLE_VTK_eigen:STRING=YES -VTK_MODULE_ENABLE_VTK_exodusII:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_expat:STRING=YES -VTK_MODULE_ENABLE_VTK_exprtk:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_fides:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_fmt:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_freetype:STRING=YES -VTK_MODULE_ENABLE_VTK_gl2ps:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_glew:STRING=YES -VTK_MODULE_ENABLE_VTK_h5part:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_hdf5:STRING=YES -VTK_MODULE_ENABLE_VTK_ioss:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_jpeg:STRING=YES -VTK_MODULE_ENABLE_VTK_jsoncpp:STRING=YES -VTK_MODULE_ENABLE_VTK_kissfft:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_kwiml:STRING=YES -VTK_MODULE_ENABLE_VTK_libharu:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_libproj:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_libxml2:STRING=WANT -VTK_MODULE_ENABLE_VTK_loguru:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_lz4:STRING=YES -VTK_MODULE_ENABLE_VTK_lzma:STRING=YES -VTK_MODULE_ENABLE_VTK_metaio:STRING=YES -VTK_MODULE_ENABLE_VTK_netcdf:STRING=YES -VTK_MODULE_ENABLE_VTK_octree:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_ogg:STRING=YES -VTK_MODULE_ENABLE_VTK_opengl:STRING=YES -VTK_MODULE_ENABLE_VTK_pegtl:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_png:STRING=YES -VTK_MODULE_ENABLE_VTK_pugixml:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_sqlite:STRING=YES -VTK_MODULE_ENABLE_VTK_theora:STRING=YES -VTK_MODULE_ENABLE_VTK_tiff:STRING=YES -VTK_MODULE_ENABLE_VTK_utf8:STRING=WANT -VTK_MODULE_ENABLE_VTK_verdict:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_vpic:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_vtkm:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_vtksys:STRING=YES -VTK_MODULE_ENABLE_VTK_xdmf2:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_xdmf3:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_zfp:STRING=DONT_WANT -VTK_MODULE_ENABLE_VTK_zlib:STRING=YES -VTK_MODULE_USE_EXTERNAL_VTK_doubleconversion:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_eigen:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_expat:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_exprtk:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_fmt:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_freetype:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_glew:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_jpeg:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_jsoncpp:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_libharu:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_libxml2:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_lz4:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_lzma:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_netcdf:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_ogg:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_png:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_pugixml:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_sqlite:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_theora:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_tiff:BOOL=ON -VTK_MODULE_USE_EXTERNAL_VTK_utf8:BOOL=OFF -VTK_MODULE_USE_EXTERNAL_VTK_zlib:BOOL=ON diff --git a/tools/workspace/vtk/repository.bzl b/tools/workspace/vtk/repository.bzl index b847ced920f7..96e7f2d85ee4 100644 --- a/tools/workspace/vtk/repository.bzl +++ b/tools/workspace/vtk/repository.bzl @@ -150,6 +150,8 @@ def _impl(repository_ctx): file_content = """# DO NOT EDIT: generated by vtk_repository() +print("The @vtk external is deprecated in Drake's WORKSPACE and will be removed on or after 2024-01-01.") # noqa + licenses([ "notice", # Apache-2.0 AND BSD-3-Clause AND MIT "reciprocal", # GL2PS @@ -981,26 +983,6 @@ filegroup( ) """ - if os_result.is_macos: - # Use Homebrew VTK. - files_to_install = [] - elif os_result.is_ubuntu and os_result.ubuntu_release == "22.04": - # Use Ubuntu VTK. - files_to_install = [] - else: - # Install all files. - files_to_install = [":vtk"] - - file_content += """ -load("@drake//tools/install:install.bzl", "install_files") -install_files( - name = "install", - dest = ".", - files = {}, - visibility = ["//visibility:public"], -) -""".format(files_to_install) - repository_ctx.file( "BUILD.bazel", content = file_content, diff --git a/tools/workspace/vtk_internal/BUILD.bazel b/tools/workspace/vtk_internal/BUILD.bazel index 67914ea7e0a0..f1360592ff9d 100644 --- a/tools/workspace/vtk_internal/BUILD.bazel +++ b/tools/workspace/vtk_internal/BUILD.bazel @@ -1,3 +1,5 @@ load("//tools/lint:lint.bzl", "add_lint_tests") +exports_files(glob(["gen/**"])) + add_lint_tests() diff --git a/tools/workspace/vtk_internal/gen/README.md b/tools/workspace/vtk_internal/gen/README.md new file mode 100644 index 000000000000..a0f4aa7800b9 --- /dev/null +++ b/tools/workspace/vtk_internal/gen/README.md @@ -0,0 +1,30 @@ + +This directory contains copies of CMake-generated source code that is too +difficult to re-generate from Bazel. + +- vtkRenderingOpenGL2ObjectFactory: supports the vtkAutoInit dependency +injection framework as related to VTK rendering. The `*.cc` file has further +been customized by hand to conditionally support COCOA vs X using #ifdef, +and to remove vtkHyperTreeGridMapper. + +TODO(jwnimmer-tri) Add some kind of vtk-upgrade helper script, that refreshes +these files and/or cross-checks the result. In the meantime, when upgrading VTK +you can refresh these files by hand: + +(1) Get the VTK source (e.g., clone VTK and check out the git sha you want, or +unzip the VTK archive that the bazel workspace refers to). + +(2) Run CMake to to generate the upstream flavor of these files: + $ cd vtk + $ mkdir build + $ cd build + $ cmake .. -Werror=dev -G Ninja -DVTK_MODULE_ENABLE_VTK_RenderingOpenGL2=YES + +(3) Use your IDE's diff-merge tool to meld the new copies of the files ... + vtk/build/Rendering/OpenGL2/vtkRenderingOpenGL2ObjectFactory.h + vtk/build/Rendering/OpenGL2/vtkRenderingOpenGL2ObjectFactory.cxx +... with the files in Drake's source tree. The Drake customizations that we +should retain are summarized above in this README, and also highlighted with +comments in the C++ code. Other differences versus upstream should probably +be melded back into the Drake copy. Anything that passes `bazel test //...` +is sufficient. diff --git a/tools/workspace/vtk_internal/gen/vtkRenderingOpenGL2ObjectFactory.cxx b/tools/workspace/vtk_internal/gen/vtkRenderingOpenGL2ObjectFactory.cxx new file mode 100644 index 000000000000..dc14fee64277 --- /dev/null +++ b/tools/workspace/vtk_internal/gen/vtkRenderingOpenGL2ObjectFactory.cxx @@ -0,0 +1,169 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkRenderingOpenGL2ObjectFactory.cxx + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +// Object factories should never have deprecation warnings. +#define VTK_DEPRECATION_LEVEL 0 + +#include "vtkRenderingOpenGLConfigure.h" // Added this line for Drake. +#include "vtkRenderingOpenGL2ObjectFactory.h" +#include "vtkVersion.h" + +// Include all of the classes we want to create overrides for. +#include "vtkDummyGPUInfoList.h" +#include "vtkOpenGLActor.h" +#include "vtkOpenGLBillboardTextActor3D.h" +#include "vtkOpenGLCamera.h" +#include "vtkOpenGLLabeledContourMapper.h" +#include "vtkOpenGLHardwareSelector.h" +#include "vtkOpenGLImageMapper.h" +#include "vtkOpenGLImageSliceMapper.h" +#include "vtkOpenGLGlyph3DMapper.h" +// Removed the next line for Drake. +// #include "vtkOpenGLHyperTreeGridMapper.h" +#include "vtkOpenGLLight.h" +#include "vtkOpenGLPointGaussianMapper.h" +#include "vtkOpenGLPolyDataMapper.h" +#include "vtkOpenGLPolyDataMapper2D.h" +#include "vtkOpenGLProperty.h" +#include "vtkOpenGLShaderProperty.h" +#include "vtkOpenGLUniforms.h" +#include "vtkOpenGLRenderer.h" +#include "vtkOpenGLRenderTimerLog.h" +#include "vtkOpenGLSkybox.h" +#include "vtkOpenGLTextActor.h" +#include "vtkOpenGLTextActor3D.h" +#include "vtkOpenGLTextMapper.h" +#include "vtkOpenGLTexture.h" + +// This stanza is customized for Drake. +#ifdef VTK_USE_COCOA +#include "vtkCocoaRenderWindow.h" +#endif + +// This stanza is customized for Drake. +#ifdef VTK_USE_X +#include "vtkXOpenGLRenderWindow.h" +#endif + + +VTK_ABI_NAMESPACE_BEGIN + +vtkStandardNewMacro(vtkRenderingOpenGL2ObjectFactory); + +// Now create the functions to create overrides with. +VTK_CREATE_CREATE_FUNCTION(vtkDummyGPUInfoList) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLActor) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLBillboardTextActor3D) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLCamera) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLLabeledContourMapper) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLHardwareSelector) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLImageMapper) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLImageSliceMapper) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLGlyph3DMapper) +// Removed the next line for Drake. +// VTK_CREATE_CREATE_FUNCTION(vtkOpenGLHyperTreeGridMapper) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLLight) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLPointGaussianMapper) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLPolyDataMapper) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLPolyDataMapper2D) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLProperty) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLShaderProperty) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLUniforms) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLRenderer) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLRenderTimerLog) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLSkybox) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLTextActor) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLTextActor3D) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLTextMapper) +VTK_CREATE_CREATE_FUNCTION(vtkOpenGLTexture) + +// This stanza is customized for Drake. +#ifdef VTK_USE_COCOA +VTK_CREATE_CREATE_FUNCTION(vtkCocoaRenderWindow) +#endif + +// This stanza is customized for Drake. +#ifdef VTK_USE_X +VTK_CREATE_CREATE_FUNCTION(vtkXOpenGLRenderWindow) +#endif + +vtkRenderingOpenGL2ObjectFactory::vtkRenderingOpenGL2ObjectFactory() +{ +this->RegisterOverride("vtkGPUInfoList", "vtkDummyGPUInfoList", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkDummyGPUInfoList); +this->RegisterOverride("vtkActor", "vtkOpenGLActor", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLActor); +this->RegisterOverride("vtkBillboardTextActor3D", "vtkOpenGLBillboardTextActor3D", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLBillboardTextActor3D); +this->RegisterOverride("vtkCamera", "vtkOpenGLCamera", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLCamera); +this->RegisterOverride("vtkLabeledContourMapper", "vtkOpenGLLabeledContourMapper", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLLabeledContourMapper); +this->RegisterOverride("vtkHardwareSelector", "vtkOpenGLHardwareSelector", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLHardwareSelector); +this->RegisterOverride("vtkImageMapper", "vtkOpenGLImageMapper", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLImageMapper); +this->RegisterOverride("vtkImageSliceMapper", "vtkOpenGLImageSliceMapper", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLImageSliceMapper); +this->RegisterOverride("vtkGlyph3DMapper", "vtkOpenGLGlyph3DMapper", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLGlyph3DMapper); +// Removed the next line for Drake. +// this->RegisterOverride("vtkHyperTreeGridMapper", "vtkOpenGLHyperTreeGridMapper", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLHyperTreeGridMapper); +this->RegisterOverride("vtkLight", "vtkOpenGLLight", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLLight); +this->RegisterOverride("vtkPointGaussianMapper", "vtkOpenGLPointGaussianMapper", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLPointGaussianMapper); +this->RegisterOverride("vtkPolyDataMapper", "vtkOpenGLPolyDataMapper", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLPolyDataMapper); +this->RegisterOverride("vtkPolyDataMapper2D", "vtkOpenGLPolyDataMapper2D", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLPolyDataMapper2D); +this->RegisterOverride("vtkProperty", "vtkOpenGLProperty", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLProperty); +this->RegisterOverride("vtkShaderProperty", "vtkOpenGLShaderProperty", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLShaderProperty); +this->RegisterOverride("vtkUniforms", "vtkOpenGLUniforms", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLUniforms); +this->RegisterOverride("vtkRenderer", "vtkOpenGLRenderer", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLRenderer); +this->RegisterOverride("vtkRenderTimerLog", "vtkOpenGLRenderTimerLog", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLRenderTimerLog); +this->RegisterOverride("vtkSkybox", "vtkOpenGLSkybox", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLSkybox); +this->RegisterOverride("vtkTextActor", "vtkOpenGLTextActor", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLTextActor); +this->RegisterOverride("vtkTextActor3D", "vtkOpenGLTextActor3D", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLTextActor3D); +this->RegisterOverride("vtkTextMapper", "vtkOpenGLTextMapper", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLTextMapper); +this->RegisterOverride("vtkTexture", "vtkOpenGLTexture", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkOpenGLTexture); + +// This stanza is customized for Drake. +#ifdef VTK_USE_COCOA +this->RegisterOverride("vtkRenderWindow", "vtkCocoaRenderWindow", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkCocoaRenderWindow); +#endif + +// This stanza is customized for Drake. +#ifdef VTK_USE_X +this->RegisterOverride("vtkRenderWindow", "vtkXOpenGLRenderWindow", "Override for VTK::RenderingOpenGL2 module", 1, vtkObjectFactoryCreatevtkXOpenGLRenderWindow); +#endif +} + +const char * vtkRenderingOpenGL2ObjectFactory::GetVTKSourceVersion() +{ + return VTK_SOURCE_VERSION; +} + +void vtkRenderingOpenGL2ObjectFactory::PrintSelf(ostream &os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} + +// Registration of object factories. +static unsigned int vtkRenderingOpenGL2Count = 0; + +VTKRENDERINGOPENGL2_EXPORT void vtkRenderingOpenGL2_AutoInit_Construct() +{ + if(++vtkRenderingOpenGL2Count == 1) + { + + + vtkRenderingOpenGL2ObjectFactory* factory = vtkRenderingOpenGL2ObjectFactory::New(); + if (factory) + { + // vtkObjectFactory keeps a reference to the "factory", + vtkObjectFactory::RegisterFactory(factory); + factory->Delete(); + } + } +} +VTK_ABI_NAMESPACE_END diff --git a/tools/workspace/vtk_internal/gen/vtkRenderingOpenGL2ObjectFactory.h b/tools/workspace/vtk_internal/gen/vtkRenderingOpenGL2ObjectFactory.h new file mode 100644 index 000000000000..cc71372bcbc1 --- /dev/null +++ b/tools/workspace/vtk_internal/gen/vtkRenderingOpenGL2ObjectFactory.h @@ -0,0 +1,46 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkRenderingOpenGL2ObjectFactory.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#ifndef vtkRenderingOpenGL2ObjectFactory_h +#define vtkRenderingOpenGL2ObjectFactory_h + +#include "vtkRenderingOpenGL2Module.h" // For export macro +#include "vtkObjectFactory.h" + +VTK_ABI_NAMESPACE_BEGIN + +class VTKRENDERINGOPENGL2_EXPORT vtkRenderingOpenGL2ObjectFactory : public vtkObjectFactory +{ +public: + static vtkRenderingOpenGL2ObjectFactory * New(); + vtkTypeMacro(vtkRenderingOpenGL2ObjectFactory, vtkObjectFactory); + + const char * GetDescription() override { return "vtkRenderingOpenGL2 factory overrides."; } + + const char * GetVTKSourceVersion() override; + + void PrintSelf(ostream &os, vtkIndent indent) override; + +protected: + vtkRenderingOpenGL2ObjectFactory(); + +private: + vtkRenderingOpenGL2ObjectFactory(const vtkRenderingOpenGL2ObjectFactory&) = delete; + void operator=(const vtkRenderingOpenGL2ObjectFactory&) = delete; +}; + +VTK_ABI_NAMESPACE_END + +#endif // vtkRenderingOpenGL2ObjectFactory_h diff --git a/tools/workspace/vtk_internal/package.BUILD.bazel b/tools/workspace/vtk_internal/package.BUILD.bazel index 0a97652f3045..84b704bc4540 100644 --- a/tools/workspace/vtk_internal/package.BUILD.bazel +++ b/tools/workspace/vtk_internal/package.BUILD.bazel @@ -1,10 +1,15 @@ # -*- bazel -*- +load( + "@drake//tools/install:install.bzl", + "install", +) load( "@drake//tools/workspace/vtk_internal:rules.bzl", "compile_all_modules", "generate_abi_namespace", "generate_common_core_sources", + "generate_rendering_opengl2_sources", "vtk_cc_module", ) @@ -20,6 +25,8 @@ generate_abi_namespace() generate_common_core_sources() +generate_rendering_opengl2_sources() + # Help solve a circular dependency between CommonCore <=> CommonDataModel. # This library inter-operates with both the VTK::CommonCore in settings.bzl # and the repository patch file patches/common_core_vs_data_model_cycle.patch. @@ -39,3 +46,17 @@ cc_library( # their required transitive dependency modules (per the vtk.module metadata). compile_all_modules() + +# Install any license notices. + +install( + name = "install", + docs = [ + "Copyright.txt", + "ThirdParty/doubleconversion/vtkdoubleconversion/COPYING", + "ThirdParty/glew/vtkglew/LICENSE.txt", + "ThirdParty/pugixml/vtkpugixml/LICENSE.md", + "ThirdParty/utf8/vtkutf8/LICENSE", + ], + visibility = ["//visibility:public"], +) diff --git a/tools/workspace/vtk_internal/rules.bzl b/tools/workspace/vtk_internal/rules.bzl index 65c530dd1479..1a16a31ed974 100644 --- a/tools/workspace/vtk_internal/rules.bzl +++ b/tools/workspace/vtk_internal/rules.bzl @@ -154,6 +154,16 @@ def _vtk_cc_module_impl( ) deps = deps + [objc_lib_name] + # For ASan & LSan, compile VTK without symbols (symbols are too big). + copts = copts + select({ + "@drake//tools:using_sanitizer": ["-g0"], + "//conditions:default": [], + }) + features = select({ + "@drake//tools:using_sanitizer": ["-per_object_debug_info"], + "//conditions:default": [], + }) + # Declare the library using its upstream module name. native.cc_library( name = module_name, @@ -163,6 +173,7 @@ def _vtk_cc_module_impl( defines = defines_extra, copts = copts, linkopts = linkopts, + features = features, deps = deps, linkstatic = True, ) @@ -523,3 +534,45 @@ def generate_common_core_sources(): generate_common_core_type_list_macros() generate_common_core_vtk_type_arrays() generate_common_core_array_instantiations() + +def cxx_embed(*, src, out, constant_name): + """Mimics the vtkEncodeString.cmake logic. + Generates an `*.h` file with the contents of a data file. + """ + header = """ +#pragma once +VTK_ABI_NAMESPACE_BEGIN +constexpr char {constant_name}[] = R"drakevtkinternal( +""".format(constant_name = constant_name) + footer = """ +)drakevtkinternal"; +VTK_ABI_NAMESPACE_END +""" + native.genrule( + name = "_genrule_" + out, + srcs = [src], + outs = [out], + cmd = " && ".join([ + "(echo '" + header + "' > $@)", + "(cat $< >> $@)", + "(echo '" + footer + "' >> $@)", + ]), + ) + +def _path_stem(src): + """Returns e.g. "quux" when given "foo/bar/quux.ext". + """ + return src.split("/")[-1].split(".")[0] + +def generate_rendering_opengl2_sources(): + name = "generated_rendering_opengl2_sources" + hdrs = [] + for src in native.glob([ + "Rendering/OpenGL2/glsl/*.glsl", + "Rendering/OpenGL2/textures/*.jpg", + ]): + stem = _path_stem(src) + hdr = "Rendering/OpenGL2/" + stem + ".h" + cxx_embed(src = src, out = hdr, constant_name = stem) + hdrs.append(hdr) + native.filegroup(name = name, srcs = hdrs) diff --git a/tools/workspace/vtk_internal/settings.bzl b/tools/workspace/vtk_internal/settings.bzl index ed5221f44d4b..3888f666c85c 100644 --- a/tools/workspace/vtk_internal/settings.bzl +++ b/tools/workspace/vtk_internal/settings.bzl @@ -85,6 +85,17 @@ MODULE_SETTINGS = { }, # Second, we'll configure the modules Drake needs (in alphabetical order). + "VTK::CommonColor": { + # This isn't used directly by Drake, but is used by other VTK modules. + }, + "VTK::CommonComputationalGeometry": { + # This module has a lot of code we don't need. We'll opt-out of the + # default srcs glob, and instead just specify what Drake needs. + "srcs_glob_exclude": ["**"], + "srcs_extra": [ + "Common/ComputationalGeometry/vtkKochanekSpline.cxx", + ], + }, "VTK::CommonCore": { "visibility": ["//visibility:public"], "hdrs_glob_exclude": [ @@ -191,12 +202,15 @@ MODULE_SETTINGS = { "visibility": ["//visibility:public"], }, "VTK::CommonMath": { + "visibility": ["//visibility:public"], # This module has a lot of code we don't need. We'll opt-out of the # default srcs glob, and instead just specify what Drake needs. "srcs_glob_exclude": ["**"], "srcs_extra": [ + "Common/Math/vtkFunctionSet.cxx", "Common/Math/vtkMatrix3x3.cxx", "Common/Math/vtkMatrix4x4.cxx", + "Common/Math/vtkQuaternionInterpolator.cxx", ], "module_deps_ignore": [ "VTK::kissfft", @@ -207,6 +221,7 @@ MODULE_SETTINGS = { # default srcs glob, and instead just specify what Drake needs. "srcs_glob_exclude": ["**"], "srcs_extra": [ + "Common/Misc/vtkContourValues.cxx", "Common/Misc/vtkErrorCode.cxx", "Common/Misc/vtkHeap.cxx", ], @@ -224,7 +239,7 @@ MODULE_SETTINGS = { ], }, "VTK::CommonTransforms": { - # This isn't used directly by Drake, but is used by other VTK modules. + "visibility": ["//visibility:public"], }, "VTK::FiltersCore": { "visibility": ["//visibility:public"], @@ -240,6 +255,58 @@ MODULE_SETTINGS = { "Filters/Core/vtkTriangleFilter.cxx", ], }, + "VTK::FiltersGeneral": { + "visibility": ["//visibility:public"], + # This module has a lot of code we don't need. We'll opt-out of the + # default srcs glob, and instead just specify what Drake needs. + "srcs_glob_exclude": ["**"], + "srcs_extra": [ + "Filters/General/vtkExtractSelectedFrustum.cxx", + "Filters/General/vtkExtractSelectionBase.cxx", + "Filters/General/vtkGraphToPoints.cxx", + "Filters/General/vtkIconGlyphFilter.cxx", + "Filters/General/vtkImageDataToPointSet.cxx", + "Filters/General/vtkRectilinearGridToPointSet.cxx", + "Filters/General/vtkSphericalHarmonics.cxx", + "Filters/General/vtkTransformFilter.cxx", + "Filters/General/vtkTransformPolyDataFilter.cxx", + "Filters/General/vtkVertexGlyphFilter.cxx", + ], + }, + "VTK::FiltersGeometry": { + # This module has a lot of code we don't need. We'll opt-out of the + # default srcs glob, and instead just specify what Drake needs. + "srcs_glob_exclude": ["**"], + "srcs_extra": [ + "Filters/Geometry/vtkDataSetSurfaceFilter.cxx", + "Filters/Geometry/vtkGeometryFilter.cxx", + "Filters/Geometry/vtkRectilinearGridGeometryFilter.cxx", + "Filters/Geometry/vtkStructuredGridGeometryFilter.cxx", + "Filters/Geometry/vtkUnstructuredGridGeometryFilter.cxx", + ], + }, + "VTK::FiltersHybrid": { + # This module has a lot of code we don't need. We'll opt-out of the + # default srcs glob, and instead just specify what Drake needs. + "srcs_glob_exclude": ["**"], + "srcs_extra": [ + "Filters/Hybrid/vtkWeightedTransformFilter.cxx", + ], + "included_cxxs": [ + "Filters/Hybrid/vtkEarthSourceData.cxx", + ], + "module_deps_ignore": [ + "VTK::ImagingSources", + ], + }, + "VTK::FiltersSources": { + "visibility": ["//visibility:public"], + "srcs_glob_exclude": [ + # Avoid the use of VTK::CommonComputationalGeometry. + "**/vtkPartitionedDataSetCollectionSource.cxx", + "**/vtkPartitionedDataSetSource.cxx", + ], + }, "VTK::IOCore": { "srcs_glob_exclude": [ # Skip code we don't need. @@ -258,22 +325,43 @@ MODULE_SETTINGS = { "VTK::lzma", ], }, + "VTK::IOExport": { + "visibility": ["//visibility:public"], + # This module has a lot of code we don't need. We'll opt-out of the + # default srcs glob, and instead just specify what Drake needs. + "srcs_glob_exclude": ["**"], + "srcs_extra": [ + "IO/Export/vtkExporter.cxx", + "IO/Export/vtkGLTFExporter.cxx", + ], + "module_deps_ignore": [ + "VTK::DomainsChemistry", + "VTK::FiltersCore", + "VTK::FiltersGeometry", + "VTK::IOImage", + "VTK::IOXML", + "VTK::ImagingCore", + "VTK::RenderingContext2D", + "VTK::RenderingFreeType", + "VTK::RenderingVtkJS", + "VTK::libharu", + ], + }, "VTK::IOGeometry": { "visibility": ["//visibility:public"], # This module has a lot of code we don't need. We'll opt-out of the # default srcs glob, and instead just specify what Drake needs. "srcs_glob_exclude": ["**"], "srcs_extra": [ + "IO/Geometry/vtkGLTFDocumentLoader.cxx", + "IO/Geometry/vtkGLTFDocumentLoaderInternals.cxx", + "IO/Geometry/vtkGLTFReader.cxx", + "IO/Geometry/vtkGLTFUtils.cxx", + "IO/Geometry/vtkGLTFWriter.cxx", + "IO/Geometry/vtkGLTFWriterUtils.cxx", "IO/Geometry/vtkOBJWriter.cxx", "IO/Geometry/vtkSTLReader.cxx", ], - "module_deps_ignore": [ - "VTK::IOLegacy", - "VTK::FiltersGeneral", - "VTK::FiltersHybrid", - "VTK::RenderingCore", - "VTK::nlohmannjson", - ], }, "VTK::IOImage": { "visibility": ["//visibility:public"], @@ -298,11 +386,136 @@ MODULE_SETTINGS = { "VTK::metaio", ], }, + "VTK::IOImport": { + "visibility": ["//visibility:public"], + # This module has a lot of code we don't need. We'll opt-out of the + # default srcs glob, and instead just specify what Drake needs. + "srcs_glob_exclude": ["**"], + "srcs_extra": [ + "IO/Import/vtkImporter.cxx", + "IO/Import/vtkGLTFImporter.cxx", + ], + }, + "VTK::IOLegacy": { + "visibility": ["//visibility:public"], + # This module has a lot of code we don't need. We'll opt-out of the + # default srcs glob, and instead just specify what Drake needs. + "srcs_glob_exclude": ["**"], + "srcs_extra": [ + "IO/Legacy/vtkDataReader.cxx", + "IO/Legacy/vtkUnstructuredGridReader.cxx", + ], + }, "VTK::ImagingCore": { "visibility": ["//visibility:public"], }, + "VTK::RenderingCore": { + "visibility": ["//visibility:public"], + "copts_extra": [ + # Match the VTK defaults. + "-DVTK_OPENGL2", + ], + }, + "VTK::RenderingOpenGL2": { + "visibility": ["//visibility:public"], + "cmake_defines": select({ + ":osx": [ + "VTK_USE_COCOA", + ], + "//conditions:default": [ + "VTK_USE_X", + ], + }), + "cmake_undefines": [ + "VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN", + "VTK_OPENGL_ENABLE_STREAM_ANNOTATIONS", + "VTK_OPENGL_HAS_EGL", + "VTK_OPENGL_HAS_OSMESA", + "VTK_REPORT_OPENGL_ERRORS", + "VTK_REPORT_OPENGL_ERRORS_IN_RELEASE_BUILDS", + "VTK_USE_CORE_GRAPHICS", + "VTK_USE_DIRECTX", + "VTK_USE_NVCONTROL", + ] + select({ + ":osx": [ + "VTK_USE_X", + ], + "//conditions:default": [ + "VTK_USE_COCOA", + ], + }), + "hdrs_extra": [ + ":generated_rendering_opengl2_sources", + ], + "srcs_glob_exclude": [ + # This is configure-time setup code, not library code. + "**/vtkProbe*", + # Avoid building unnecessary VTK::RenderingHyperTreeGrid. + "**/*HyperTreeGrid*", + # Exclude all renderers by default; we'll incorporate the necessary + # ones using with srcs_extra immediately below. + "**/vtkCocoa*", + "**/vtkEGL*", + "**/vtkOSOpenGL*", + "**/vtkSDL2OpenGL*", + "**/vtkWin32OpenGL*", + "**/vtkXOpenGL*", + ], + "srcs_objc_non_arc": select({ + ":osx": [ + "Rendering/OpenGL2/vtkCocoaGLView.mm", + "Rendering/OpenGL2/vtkCocoaRenderWindow.mm", + ], + "//conditions:default": [], + }), + "srcs_extra": select({ + ":osx": [], + "//conditions:default": [ + "Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx", + ], + }) + [ + # The vtkObjectFactory.cmake logic for vtk_object_factory_configure + # is too difficult to implement in Bazel at the moment. Instead, + # we'll commit the two generated files and directly mention them. + "@drake//tools/workspace/vtk_internal:gen/vtkRenderingOpenGL2ObjectFactory.h", # noqa + "@drake//tools/workspace/vtk_internal:gen/vtkRenderingOpenGL2ObjectFactory.cxx", # noqa + ], + "linkopts_extra": select({ + ":osx": [ + # Mimic vtk_module_link(... "-framework Cocoa") from upstream. + "-framework Cocoa", + ], + "//conditions:default": [], + }), + "deps_extra": select({ + ":osx": [], + "//conditions:default": [ + # Mimic vtk_module_link(... X11::X11) from upstream. + "@x11", + ], + }), + "module_deps_ignore": [ + "VTK::RenderingHyperTreeGrid", + ], + }, + "VTK::RenderingUI": { + # This module has a lot of code we don't need. We'll opt-out of the + # default srcs glob, and instead just specify what Drake needs. + "srcs_glob_exclude": ["**"], + "srcs_extra": [ + "Rendering/UI/vtkGenericRenderWindowInteractor.cxx", + ], + }, # Third, we'll configure dependencies that come from Drake's WORKSPACE. + "VTK::fmt": { + "cmake_defines": [ + "VTK_MODULE_USE_EXTERNAL_VTK_fmt=1", + ], + "deps_extra": [ + "@fmt", + ], + }, "VTK::jpeg": { "cmake_defines": [ "VTK_MODULE_USE_EXTERNAL_vtkjpeg=1", @@ -317,6 +530,19 @@ MODULE_SETTINGS = { "@libjpeg", ], }, + "VTK::nlohmannjson": { + "cmake_defines": [ + "VTK_MODULE_USE_EXTERNAL_vtknlohmannjson=1", + ], + "deps_extra": [ + "@nlohmann_internal//:nlohmann", + ], + }, + "VTK::opengl": { + "deps_extra": [ + "@opengl", + ], + }, "VTK::png": { "cmake_defines": [ "VTK_MODULE_USE_EXTERNAL_vtkpng=1", @@ -349,7 +575,11 @@ MODULE_SETTINGS = { }, # Fourth, we'll configure dependencies that we let VTK build and vendor on - # its own, because nothing else in Drake needs these. + # its own, because nothing else in Drake needs these. Anything added here + # must have its license file added to the install in `package.BUILD.bazel`. + # VTK's name mangling of these is a little bit weak (it just adds "vtk" to + # the front, leaving them as public symbols); we might want to improve upon + # that later on. "VTK::doubleconversion": { "cmake_undefines": [ "VTK_MODULE_USE_EXTERNAL_vtkdoubleconversion", @@ -364,6 +594,28 @@ MODULE_SETTINGS = { "ThirdParty/doubleconversion/**/*.cc", ], }, + "VTK::glew": { + "cmake_undefines": [ + "VTK_GLEW_SHARED", + "VTK_MODULE_USE_EXTERNAL_vtkglew", + "VTK_MODULE_vtkglew_GLES3", + ], + "srcs_extra": [ + "ThirdParty/glew/vtkglew/src/glew.c", + ], + "copts_extra": [ + "-Iexternal/vtk_internal/ThirdParty/glew/vtkglew/include", + # Match the target_compile_definitions() from CMakeLists.txt. + "-DGLEW_NO_GLU", + ], + "linkopts_extra": select({ + ":osx": [], + "//conditions:default": [ + "-lX11", + "-lGLX", + ], + }), + }, "VTK::pugixml": { # TODO(jwnimmer-tri) The only user of pugixml is vtkDataAssembly. # Possibly there is some way to disable XML I/O support on that