[ITK-users] compile itk (VTKGlue ON) with vtk from paraview
Dr. Roman Grothausmann
grothausmann.roman at mh-hannover.de
Thu Jan 22 05:21:34 EST 2015
Dear mailing list members,
What configuration is needed to compile itk (4.6.1) with VTKGlue enabled with
vtk from paraview (4.3.1) in order to compile Paraview plugins making use of ITK
and VTK?
If I configure ITK to with:
BUILD_SHARED_LIBS ON
Module_ITKVtkGlue ON
VTK_DIR /opt/paraview-4.3.1_git/lib/cmake/paraview-4.3
cmake complains about a missing VTKTargets.cmake even though
PARAVIEW_INSTALL_DEVELOPMENT_FILES was set to ON. After a
cp VTK/VTKTargets.cmake /opt/paraview-4.3.1_git/lib/cmake/paraview-4.3/
cmake is happy but I get linker errors at the end of the compilation of ITK when
the VTKGlue is due:
Linking CXX shared library ../../../../lib/libITKVtkGlue-4.6.so
/usr/bin/ld: cannot find -lvtkSciberQuest
/usr/bin/ld: cannot find -lvtkEyeDomeLighting
/usr/bin/ld: cannot find -lvtkQvis
/usr/bin/ld: cannot find -lvtkPointSpriteRendering
/usr/bin/ld: cannot find -lvtkPVPythonCatalyst
/usr/bin/ld: cannot find -lvtkPointSpriteGraphics
/usr/bin/ld: cannot find -lvtkUtilitiesPythonInitializer
Switching off all PV plugin builds only leaves:
Linking CXX shared library ../../../../lib/libITKVtkGlue-4.6.so
/usr/bin/ld: cannot find -lvtkPVPythonCatalyst
/usr/bin/ld: cannot find -lvtkUtilitiesPythonInitializer
However, the files are there:
find /opt/paraview-4.3.1_git/ -name '*vtkPVPythonCatalyst*so*'
/opt/paraview-4.3.1_git/lib/paraview-4.3/site-packages/vtk/vtkPVPythonCatalystPython.so
/opt/paraview-4.3.1_git/lib/paraview-4.3/libvtkPVPythonCatalyst-pv4.3.so.1
/opt/paraview-4.3.1_git/lib/paraview-4.3/libvtkPVPythonCatalystPython27D-pv4.3.so.1
/opt/paraview-4.3.1_git/lib/paraview-4.3/libvtkPVPythonCatalyst-pv4.3.so
/opt/paraview-4.3.1_git/lib/paraview-4.3/libvtkPVPythonCatalystPython27D-pv4.3.so
find /opt/paraview-4.3.1_git/ -name '*vtkUtilitiesPythonInitializer*so*'
/opt/paraview-4.3.1_git/lib/paraview-4.3/libvtkUtilitiesPythonInitializer-pv4.3.so.1
/opt/paraview-4.3.1_git/lib/paraview-4.3/libvtkUtilitiesPythonInitializer-pv4.3.so
Adding the abs. file locations to the build command does not help nor does
-L/opt/paraview-4.3.1_git/lib/paraview-4.3/
Using the build dir of VTK in PV-tree instead for ITK does not help either:
VTK_DIR /opt/compilation/ParaView-v4.3.1/build/VTK
If I configure ITK to with:
BUILD_SHARED_LIBS OFF
I get linker errors in the last stage when compiling a PV plugin that makes use
of VTK and ITK:
/usr/bin/ld:
/opt/compilation/InsightToolkit-4.6.1/build/lib/libitkvnl_algo-4.6.a(vnl_real_eigensystem.cxx.o):
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a
shared object; recompile with -fPIC
/opt/compilation/InsightToolkit-4.6.1/build/lib/libitkvnl_algo-4.6.a: could not
read symbols: Bad value
After I've added
CMAKE_CXX_FLAGS -fPIC
to Paraview and ITK and recompiled both I get:
/usr/bin/ld:
/opt/compilation/InsightToolkit-4.6.1/build/lib/libitkv3p_netlib-4.6.a(dlamch.c.o):
relocation R_X86_64_32 against `.bss' can not be used when making a shared
object; recompile with -fPIC
/opt/compilation/InsightToolkit-4.6.1/build/lib/libitkv3p_netlib-4.6.a: could
not read symbols: Bad value
What am I missing in my configuration of PV and ITK?
When and where should I specify:
CMAKE_CXX_FLAGS -fPIC
BUILD_SHARED_LIBS ON/OFF
Is this the right VTK_DIR specification for ITK:
/opt/compilation/ParaView-v4.3.1/build/VTK
or
/opt/paraview-4.3.1_git/lib/cmake/paraview-4.3
Many thanks for any help or hints.
Roman
--
Dr. Roman Grothausmann
Tomographie und Digitale Bildverarbeitung
Tomography and Digital Image Analysis
Institut für Funktionelle und Angewandte Anatomie, OE 4120
Medizinische Hochschule Hannover
Carl-Neuberg-Str. 1
D-30625 Hannover
Tel. +49 511 532-9574
More information about the Insight-users
mailing list