diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f6881a4..d49ce4db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1085,6 +1085,7 @@ if( ENABLE_VTK ) set( VTK_DIR "${CMAKE_INSTALL_PREFIX}/vtk" ) set( VTK_URL "${TPL_MIRROR_DIR}/VTK-59d89108f4.tar.gz" ) + message( STATUS "Building VTK found at ${VTK_URL}" ) # Depending on the platfor, the install directory could be 'lib' or 'lib64'. @@ -1093,6 +1094,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} ) @@ -1111,7 +1118,6 @@ endif( ENABLE_MPI ) PREFIX ${PROJECT_BINARY_DIR}/vtk URL ${VTK_URL} INSTALL_DIR ${VTK_DIR} - PATCH_COMMAND patch -p0 < ${TPL_MIRROR_DIR}/vtkXMLReader-fpe.patch BUILD_COMMAND ${TPL_BUILD_COMMAND} INSTALL_COMMAND "${TPL_INSTALL_COMMAND}" PATCH_COMMAND patch -p1 < ${TPL_MIRROR_DIR}/VTK-ABI.patch @@ -1140,7 +1146,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 ) diff --git a/tplMirror/VTK-59d89108f4.tar.gz b/tplMirror/VTK-59d89108f4.tar.gz new file mode 100644 index 00000000..a8295dfe --- /dev/null +++ b/tplMirror/VTK-59d89108f4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f922d7e9f917ec9da5ce0a4dda60d8eb89f91c157658269e0f8be532bf958c2a +size 42559503 diff --git a/tplMirror/VTK-ABI.patch b/tplMirror/VTK-ABI.patch new file mode 100644 index 00000000..f8f1fd8a --- /dev/null +++ b/tplMirror/VTK-ABI.patch @@ -0,0 +1,65 @@ +diff --git a/Common/Core/vtkValueFromString.cxx b/Common/Core/vtkValueFromString.cxx +index 9e619a87a5..93ca79486d 100644 +--- a/Common/Core/vtkValueFromString.cxx ++++ b/Common/Core/vtkValueFromString.cxx +@@ -203,6 +203,8 @@ const char* ParseInt(const char* it, const char* end, bool minus_sign, int base, + } + } + ++VTK_ABI_NAMESPACE_BEGIN ++ + // Overload for integers + template ::value && !std::is_same::value, bool>::type = +diff --git a/Filters/Core/vtkFieldDataToDataSetAttribute.cxx b/Filters/Core/vtkFieldDataToDataSetAttribute.cxx +index 9a8b23c67b..d8a451eca8 100644 +--- a/Filters/Core/vtkFieldDataToDataSetAttribute.cxx ++++ b/Filters/Core/vtkFieldDataToDataSetAttribute.cxx +@@ -28,6 +28,7 @@ + + #include + ++VTK_ABI_NAMESPACE_BEGIN + vtkStandardNewMacro(vtkFieldDataToDataSetAttribute); + + //------------------------------------------------------------------------------ +diff --git a/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx b/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx +index 6b00e7ff0f..b8d879ac9b 100644 +--- a/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx ++++ b/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx +@@ -54,6 +54,8 @@ + + #include "vtkSurfaceLICInterface.h" + ++VTK_ABI_NAMESPACE_BEGIN ++ + vtkStandardNewMacro(vtkCompositeSurfaceLICMapper); + //------------------------------------------------------------------------------ + vtkCompositeSurfaceLICMapper::vtkCompositeSurfaceLICMapper() = default; +diff --git a/Rendering/OpenGL2/vtkOpenGLBatchedPolyDataMapper.cxx b/Rendering/OpenGL2/vtkOpenGLBatchedPolyDataMapper.cxx +index d46b537d33..1ea50351bf 100644 +--- a/Rendering/OpenGL2/vtkOpenGLBatchedPolyDataMapper.cxx ++++ b/Rendering/OpenGL2/vtkOpenGLBatchedPolyDataMapper.cxx +@@ -42,7 +42,6 @@ + #include "vtkUnsignedIntArray.h" + #include + +-VTK_ABI_NAMESPACE_BEGIN + namespace + { + template +@@ -64,6 +63,8 @@ private: + + } // end anonymous namespace + ++VTK_ABI_NAMESPACE_BEGIN ++ + //------------------------------------------------------------------------------ + vtkStandardNewMacro(vtkOpenGLBatchedPolyDataMapper); + +@@ -1643,3 +1644,5 @@ int vtkOpenGLBatchedPolyDataMapper::CanUseTextureMapForColoring(vtkDataObject*) + + return 1; + } ++ ++VTK_ABI_NAMESPACE_END