Skip to content

Commit b972a18

Browse files
committed
This builds and appears to run with vtk 9.
At least, it doesn't crash when a graphics window is opened and a simple skeleton can be drawn and rotated. This version doesn't work with vtk8. Some conditional code is needed to check the vtk version in common/DIR.py.
1 parent 2d281ef commit b972a18

File tree

2 files changed

+63
-31
lines changed

2 files changed

+63
-31
lines changed

SRC/common/DIR.py

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -79,29 +79,48 @@ def set_clib_flags(clib):
7979
if HAVE_MPI:
8080
clib.externalLibs.append('pmpich++')
8181
clib.externalLibs.append('mpich')
82-
addVTKlibs(clib, ['vtkCommonCore',
83-
'vtkCommonDataModel',
84-
'vtkCommonExecutionModel',
85-
'vtkCommonMisc',
86-
'vtkCommonTransforms',
87-
'vtkFiltersCore',
88-
'vtkFiltersExtraction',
89-
'vtkFiltersGeneral',
90-
'vtkFiltersModeling',
91-
'vtkFiltersSources',
92-
'vtkIOExport',
93-
'vtkIOExportPDF',
94-
# 'vtkIOExportOpenGL2', # Not available in VTK 9
95-
'vtkIOImage',
96-
'vtkIOXML',
97-
'vtkImagingCore',
98-
'vtkImagingColor',
99-
'vtkImagingGeneral',
100-
'vtkRenderingAnnotation',
101-
'vtkRenderingContextOpenGL2',
102-
'vtkRenderingCore',
103-
'vtkRenderingFreeType',
104-
'vtkRenderingOpenGL2',
105-
'vtkRenderingGL2PSOpenGL2',
106-
'vtkRenderingVolumeOpenGL2'])
82+
addVTKlibs(clib, [
83+
## TODO: This needs to work for both vtk8 and vtk9
84+
## libs for vtk9
85+
## libs from the #defines created by FindNeededModules
86+
'vtkIOExportPDF',
87+
'vtkIOExportGL2PS',
88+
#'vtkRenderingContextOpenGL2', # doesn't exist
89+
'vtkInteractionStyle',
90+
'vtkRenderingFreeType',
91+
'vtkRenderingOpenGL2',
92+
'vtkRenderingUI',
93+
'vtkRenderingGL2PSOpenGL2',
94+
'vtkRenderingVolumeOpenGL2',
95+
## Added due to 'undefined symbol' messages at run time
96+
'vtkFiltersExtraction',
97+
'vtkRenderingAnnotation',
98+
99+
## Libs included w/ vtk8
100+
# 'vtkCommonCore',
101+
# 'vtkCommonDataModel',
102+
# 'vtkCommonExecutionModel',
103+
# 'vtkCommonMisc',
104+
# 'vtkCommonTransforms',
105+
# 'vtkFiltersCore',
106+
# 'vtkFiltersExtraction',
107+
# 'vtkFiltersGeneral',
108+
# 'vtkFiltersModeling',
109+
# 'vtkFiltersSources',
110+
# 'vtkIOExport',
111+
# 'vtkIOExportPDF',
112+
# 'vtkIOExportOpenGL2',
113+
# 'vtkIOImage',
114+
# 'vtkIOXML',
115+
# 'vtkImagingCore',
116+
# 'vtkImagingColor',
117+
# 'vtkImagingGeneral',
118+
# 'vtkRenderingAnnotation',
119+
# 'vtkRenderingContextOpenGL2',
120+
# 'vtkRenderingCore',
121+
# 'vtkRenderingFreeType',
122+
# 'vtkRenderingOpenGL2',
123+
# 'vtkRenderingGL2PSOpenGL2',
124+
# 'vtkRenderingVolumeOpenGL2'
125+
])
107126

SRC/common/IO/vtkutils.C

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656

5757
// (3) Create dummy.cxx in the same directory as CMakeLists.txt. I
5858
// just wrote hello world. I don't know if it has to actually use
59-
// vtk.
59+
// vtk. Adding a few lines of trivial vtk calls didn't change the
60+
// results.
6061

6162
// (4) Create a build directory in the directory. cd to it and run
6263
// "cmake ..".
@@ -66,19 +67,31 @@
6667
// bunch of #defines. Include the #defines in this file, followed by
6768
// #include <vtkAutoInit.h>.
6869

70+
// (6) For each of the #defines from FindNeededModules, add the
71+
// corresponding library to the list in set_clib_flags in
72+
// SRC/common/DIR.py. Some of the #define don't have a corresponding
73+
// library.
6974

70-
// Found by grepping all "#include <vtk*>" lines from all OOF3D files,
71-
// putting hthem in vtkincludes.h, and running FindNeededModules on
72-
// that.
75+
// (7) Run the program. If there are "undefined symbol" messages, use
76+
// nm to find the symbols in the vtk libraries and add the libraries
77+
// to the list in DIR.py.
78+
79+
// (8) Hope that that all worked.
80+
81+
82+
// #defines found by grepping all "#include <vtk*>" lines from all
83+
// OOF3D files, putting them in vtkincludes.h, and running
84+
// FindNeededModules on that.
7385
#define vtkIOExport_AUTOINIT 1(vtkIOExportPDF)
7486
#define vtkIOExportGL2PS_AUTOINIT 1(vtkIOExportGL2PS)
7587
#define vtkRenderingContext2D_AUTOINIT 1(vtkRenderingContextOpenGL2)
7688
#define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL2,vtkRenderingUI)
7789
#define vtkRenderingOpenGL2_AUTOINIT 1(vtkRenderingGL2PSOpenGL2)
7890
#define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL2)
7991

80-
// Found by copying all OOF3D .C and .h files to FLAT, renaming .C to
81-
// .cxx, and running FindNeededModules.py on FLAT.
92+
// #defines found by copying all OOF3D .C and .h files to FLAT,
93+
// renaming FLAT/*.C to FLAT/*.cxx, and running FindNeededModules.py
94+
// on FLAT.
8295

8396
// #define vtkIOExportGL2PS_AUTOINIT 1(vtkIOExportGL2PS)
8497
// #define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL2,vtkRenderingUI)

0 commit comments

Comments
 (0)