Skip to content

Commit ff57a33

Browse files
CharlesGueunetJulien Fausty
authored andcommitted
VTK: update to master and add mangling
Mangling VTK uses an inline namespace to change the VTK symbols in the binary so as to allow multiple VTK binaries to coexist
1 parent da5e837 commit ff57a33

File tree

3 files changed

+77
-2
lines changed

3 files changed

+77
-2
lines changed

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@ if( ENABLE_VTK )
10851085
set( VTK_DIR "${CMAKE_INSTALL_PREFIX}/vtk" )
10861086
set( VTK_URL "${TPL_MIRROR_DIR}/VTK-59d89108f4.tar.gz" )
10871087

1088+
10881089
message( STATUS "Building VTK found at ${VTK_URL}" )
10891090

10901091
# Depending on the platfor, the install directory could be 'lib' or 'lib64'.
@@ -1093,6 +1094,12 @@ if( ENABLE_VTK )
10931094
# I'm no cmake expert and I do not know if there was a better way to deal with it.
10941095
set( VTK_CMAKE_INSTALL_LIBDIR "lib" )
10951096

1097+
# This compile option will enclose all of the VTK library within a vtk_geosx namespace.
1098+
# This mangling is needed in order to ensure that the VTK included with geosx does
1099+
# not interfere with another VTK version that may be linked dynamically at runtime
1100+
# (when using ParaView's Catalyst implementation for example).
1101+
set( VTK_ABI_NAMESPACE_NAME "vtk_geosx" )
1102+
10961103
if( ENABLE_MPI )
10971104
set( VTK_C_COMPILER ${MPI_C_COMPILER} )
10981105
set( VTK_CXX_COMPILER ${MPI_CXX_COMPILER} )
@@ -1111,7 +1118,6 @@ endif( ENABLE_MPI )
11111118
PREFIX ${PROJECT_BINARY_DIR}/vtk
11121119
URL ${VTK_URL}
11131120
INSTALL_DIR ${VTK_DIR}
1114-
PATCH_COMMAND patch -p0 < ${TPL_MIRROR_DIR}/vtkXMLReader-fpe.patch
11151121
BUILD_COMMAND ${TPL_BUILD_COMMAND}
11161122
INSTALL_COMMAND "${TPL_INSTALL_COMMAND}"
11171123
PATCH_COMMAND patch -p1 < ${TPL_MIRROR_DIR}/VTK-ABI.patch
@@ -1140,7 +1146,8 @@ endif( ENABLE_MPI )
11401146
-D VTK_MODULE_ENABLE_VTK_IOXML=YES
11411147
-D VTK_MODULE_ENABLE_VTK_IOLegacy=YES
11421148
-D VTK_BUILD_TESTING=OFF
1143-
-D VTK_LEGACY_REMOVE=ON )
1149+
-D VTK_LEGACY_REMOVE=ON
1150+
-D VTK_ABI_NAMESPACE_NAME=${VTK_ABI_NAMESPACE_NAME} )
11441151

11451152
list( APPEND build_list vtk )
11461153
endif( ENABLE_VTK )

tplMirror/VTK-59d89108f4.tar.gz

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:f922d7e9f917ec9da5ce0a4dda60d8eb89f91c157658269e0f8be532bf958c2a
3+
size 42559503

tplMirror/VTK-ABI.patch

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
diff --git a/Common/Core/vtkValueFromString.cxx b/Common/Core/vtkValueFromString.cxx
2+
index 9e619a87a5..93ca79486d 100644
3+
--- a/Common/Core/vtkValueFromString.cxx
4+
+++ b/Common/Core/vtkValueFromString.cxx
5+
@@ -203,6 +203,8 @@ const char* ParseInt(const char* it, const char* end, bool minus_sign, int base,
6+
}
7+
}
8+
9+
+VTK_ABI_NAMESPACE_BEGIN
10+
+
11+
// Overload for integers
12+
template <typename T,
13+
typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value, bool>::type =
14+
diff --git a/Filters/Core/vtkFieldDataToDataSetAttribute.cxx b/Filters/Core/vtkFieldDataToDataSetAttribute.cxx
15+
index 9a8b23c67b..d8a451eca8 100644
16+
--- a/Filters/Core/vtkFieldDataToDataSetAttribute.cxx
17+
+++ b/Filters/Core/vtkFieldDataToDataSetAttribute.cxx
18+
@@ -28,6 +28,7 @@
19+
20+
#include <set>
21+
22+
+VTK_ABI_NAMESPACE_BEGIN
23+
vtkStandardNewMacro(vtkFieldDataToDataSetAttribute);
24+
25+
//------------------------------------------------------------------------------
26+
diff --git a/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx b/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx
27+
index 6b00e7ff0f..b8d879ac9b 100644
28+
--- a/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx
29+
+++ b/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx
30+
@@ -54,6 +54,8 @@
31+
32+
#include "vtkSurfaceLICInterface.h"
33+
34+
+VTK_ABI_NAMESPACE_BEGIN
35+
+
36+
vtkStandardNewMacro(vtkCompositeSurfaceLICMapper);
37+
//------------------------------------------------------------------------------
38+
vtkCompositeSurfaceLICMapper::vtkCompositeSurfaceLICMapper() = default;
39+
diff --git a/Rendering/OpenGL2/vtkOpenGLBatchedPolyDataMapper.cxx b/Rendering/OpenGL2/vtkOpenGLBatchedPolyDataMapper.cxx
40+
index d46b537d33..1ea50351bf 100644
41+
--- a/Rendering/OpenGL2/vtkOpenGLBatchedPolyDataMapper.cxx
42+
+++ b/Rendering/OpenGL2/vtkOpenGLBatchedPolyDataMapper.cxx
43+
@@ -42,7 +42,6 @@
44+
#include "vtkUnsignedIntArray.h"
45+
#include <sstream>
46+
47+
-VTK_ABI_NAMESPACE_BEGIN
48+
namespace
49+
{
50+
template <typename T>
51+
@@ -64,6 +63,8 @@ private:
52+
53+
} // end anonymous namespace
54+
55+
+VTK_ABI_NAMESPACE_BEGIN
56+
+
57+
//------------------------------------------------------------------------------
58+
vtkStandardNewMacro(vtkOpenGLBatchedPolyDataMapper);
59+
60+
@@ -1643,3 +1644,5 @@ int vtkOpenGLBatchedPolyDataMapper::CanUseTextureMapForColoring(vtkDataObject*)
61+
62+
return 1;
63+
}
64+
+
65+
+VTK_ABI_NAMESPACE_END

0 commit comments

Comments
 (0)