Skip to content

Commit

Permalink
VTK: update to master and add mangling
Browse files Browse the repository at this point in the history
Mangling VTK uses an inline namespace to change the VTK symbols in the
binary so as to allow multiple VTK binaries to coexist
  • Loading branch information
CharlesGueunet authored and Julien Fausty committed Apr 26, 2023
1 parent 26aa03d commit a716a79
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 26 deletions.
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ endif()
################################
if( ENABLE_VTK )
set( VTK_DIR "${CMAKE_INSTALL_PREFIX}/vtk" )
set( VTK_URL "${TPL_MIRROR_DIR}/VTK-9.1.0.tar.gz" )
set( VTK_URL "${TPL_MIRROR_DIR}/VTK-49361a2058784db4be05980476457c06d86890e7.tar.gz" )

message( STATUS "Building VTK found at ${VTK_URL}" )

Expand All @@ -1082,6 +1082,12 @@ if( ENABLE_VTK )
# I'm no cmake expert and I do not know if there was a better way to deal with it.
set( VTK_CMAKE_INSTALL_LIBDIR "lib" )

# This compile option will enclose all of the VTK library within a vtk_geosx namespace.
# This mangling is needed in order to ensure that the VTK included with geosx does
# not interfere with another VTK version that may be linked dynamically at runtime
# (when using ParaView's Catalyst implementation for example).
set( VTK_ABI_NAMESPACE_NAME "vtk_geosx" )

if( ENABLE_MPI )
set( VTK_C_COMPILER ${MPI_C_COMPILER} )
set( VTK_CXX_COMPILER ${MPI_CXX_COMPILER} )
Expand All @@ -1100,9 +1106,8 @@ endif( ENABLE_MPI )
PREFIX ${PROJECT_BINARY_DIR}/vtk
URL ${VTK_URL}
INSTALL_DIR ${VTK_DIR}
PATCH_COMMAND patch -p0 < ${TPL_MIRROR_DIR}/VTK-9.1.0-disable_traits.patch
COMMAND patch -p0 < ${TPL_MIRROR_DIR}/VTK-9.1.0-duplicate-points-fix.patch
COMMAND patch -p0 < ${TPL_MIRROR_DIR}/VTK-9.1.0-cmake-fix.patch
PATCH_COMMAND patch -p0 < ${TPL_MIRROR_DIR}/VTK-49361a2-disable_traits.patch
COMMAND patch -p0 < ${TPL_MIRROR_DIR}/VTK-49361a2-cmake-fix.patch
BUILD_COMMAND ${TPL_BUILD_COMMAND}
INSTALL_COMMAND "${TPL_INSTALL_COMMAND}"
CMAKE_GENERATOR ${TPL_GENERATOR}
Expand All @@ -1129,7 +1134,8 @@ endif( ENABLE_MPI )
-D VTK_MODULE_ENABLE_VTK_IOXML=YES
-D VTK_MODULE_ENABLE_VTK_IOLegacy=YES
-D VTK_BUILD_TESTING=OFF
-D VTK_LEGACY_REMOVE=ON )
-D VTK_LEGACY_REMOVE=ON
-D VTK_ABI_NAMESPACE_NAME=${VTK_ABI_NAMESPACE_NAME} )

list( APPEND build_list vtk )
endif( ENABLE_VTK )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,3 @@
string(APPEND _MPI_${LANG}_LINK_FLAGS ">")
endif ()
set_property(TARGET MPI::MPI_${LANG} PROPERTY INTERFACE_LINK_OPTIONS "${_MPI_${LANG}_LINK_FLAGS}")
@@ -1823,7 +1824,6 @@
find_package_handle_standard_args(MPI
REQUIRED_VARS ${_MPI_REQ_VARS}
VERSION_VAR ${_MPI_MIN_VERSION}
- REASON_FAILURE_MESSAGE "${_MPI_FAIL_REASON}"
HANDLE_COMPONENTS)

#=============================================================================
File renamed without changes.
3 changes: 3 additions & 0 deletions tplMirror/VTK-49361a2058784db4be05980476457c06d86890e7.tar.gz
Git LFS file not shown
10 changes: 0 additions & 10 deletions tplMirror/VTK-9.1.0-duplicate-points-fix.patch

This file was deleted.

3 changes: 0 additions & 3 deletions tplMirror/VTK-9.1.0.tar.gz

This file was deleted.

3 changes: 3 additions & 0 deletions tplMirror/VTK-9.2.5.tar.gz
Git LFS file not shown

0 comments on commit a716a79

Please sign in to comment.