Skip to content

Commit 022ba52

Browse files
authored
Merge pull request #3 from psavery/prebuilt-vtk
Allow prebuilt VTK to be used for building Tomviz
2 parents 4fac214 + d4ccabe commit 022ba52

8 files changed

Lines changed: 30 additions & 9 deletions

File tree

.github/workflows/build_requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ libzip
1212
libcurl
1313
icu
1414
libharu
15+
libxml2-devel=2.14*
16+
vtk==9.5.2
1517
# This is needed for building the tests
1618
gtest
1719
# Next three are Linux only

.github/workflows/scripts/build_paraview.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ mkdir -p paraview-build && cd paraview-build
44
cmake -G"Ninja" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
55
-DCMAKE_INSTALL_LIBDIR:STRING=lib \
66
-DCMAKE_FIND_FRAMEWORK:STRING=LAST \
7-
-DBUILD_TESTING:BOOL=OFF \
87
-DPython3_FIND_STRATEGY:STRING=LOCATION \
98
-DPARAVIEW_ENABLE_CATALYST:BOOL=OFF \
109
-DPARAVIEW_USE_PYTHON:BOOL=ON \
10+
-DPARAVIEW_BUILD_WITH_EXTERNAL:BOOL=ON \
11+
-DPARAVIEW_USE_EXTERNAL_VTK:BOOL=ON \
1112
-DPARAVIEW_ENABLE_WEB:BOOL=OFF \
12-
-DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION:BOOL=OFF\
13+
-DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION:BOOL=OFF \
1314
-DPARAVIEW_USE_QTHELP:BOOL=OFF \
1415
-DPARAVIEW_PLUGINS_DEFAULT:BOOL=OFF \
1516
-DPARAVIEW_USE_VISKORES:BOOL=OFF \
16-
-DVTK_SMP_IMPLEMENTATION_TYPE:STRING=TBB \
17-
-DVTK_PYTHON_VERSION:STRING=3 \
18-
-DVTK_PYTHON_FULL_THREADSAFE:BOOL=ON \
19-
-DVTK_NO_PYTHON_THREADS:BOOL=OFF \
2017
../paraview
2118
ninja

.github/workflows/scripts/build_tomviz.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mkdir -p tomviz-build && cd tomviz-build
44
cmake -G"Ninja" -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
55
-DCMAKE_INSTALL_LIBDIR:STRING=lib \
66
-DParaView_DIR:PATH=../paraview-build \
7+
-DTOMVIZ_USE_EXTERNAL_VTK:BOOL=ON \
78
-DENABLE_TESTING:BOOL=ON \
89
-DPython3_FIND_STRATEGY:STRING=LOCATION \
910
../tomviz

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,18 @@ endif()
104104
set(tomviz_version
105105
"${tomviz_version_major}.${tomviz_version_minor}.${tomviz_version_patch}")
106106

107+
option(TOMVIZ_USE_EXTERNAL_VTK "Use an external VTK." OFF)
108+
mark_as_advanced(TOMVIZ_USE_EXTERNAL_VTK)
109+
107110
# These dependencies are inherited from ParaView.
108111
find_package(Qt6 REQUIRED COMPONENTS Concurrent Network Widgets Core Core5Compat)
109112
find_package(ParaView REQUIRED)
110113

114+
if(TOMVIZ_USE_EXTERNAL_VTK)
115+
find_package(VTK REQUIRED)
116+
add_definitions(-DTOMVIZ_USE_EXTERNAL_VTK)
117+
endif()
118+
111119
# Use automoc, autouic, and autorcc for our Qt code.
112120
set(CMAKE_AUTOMOC ON)
113121
set(CMAKE_AUTOUIC ON)

tomviz/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ target_link_libraries(tomvizlib
755755
if(WIN32)
756756
target_link_libraries(tomvizlib PUBLIC Qt6::WinMain)
757757
endif()
758+
758759
if(APPLE)
759760
set_target_properties(tomviz
760761
PROPERTIES

tomviz/pybind11/ctvlib/ctvlib.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33

44
#include "ctvlib.h"
55

6+
#if TOMVIZ_USE_EXTERNAL_VTK
7+
#include <Eigen/Core>
8+
#include <Eigen/SparseCore>
9+
#else
610
#include <vtk_eigen.h>
7-
811
#include VTK_EIGEN(Core)
912
#include VTK_EIGEN(SparseCore)
13+
#endif
1014

1115
#include <tbb/parallel_for.h>
1216
#include <tbb/parallel_reduce.h>

tomviz/pybind11/ctvlib/ctvlib.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
#ifndef ctvlib_h
55
#define ctvlib_h
66

7+
#if TOMVIZ_USE_EXTERNAL_VTK
8+
#include <Eigen/Core>
9+
#include <Eigen/SparseCore>
10+
#else
711
#include <vtk_eigen.h>
8-
912
#include VTK_EIGEN(Core)
1013
#include VTK_EIGEN(SparseCore)
14+
#endif
1115

1216
class ctvlib
1317
{

tomviz/pybind11/ctvlib/eigenConversion.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@
3535
disable : 4996) // warning C4996: std::unary_negate is deprecated in C++17
3636
#endif
3737

38+
#if TOMVIZ_USE_EXTERNAL_VTK
39+
#include <Eigen/Core>
40+
#include <Eigen/SparseCore>
41+
#else
3842
#include <vtk_eigen.h>
39-
4043
#include VTK_EIGEN(Core)
4144
#include VTK_EIGEN(SparseCore)
45+
#endif
4246

4347
// Eigen prior to 3.2.7 doesn't have proper move constructors--but worse, some
4448
// classes get implicit move constructors that break things. We could detect

0 commit comments

Comments
 (0)