vfonov / itksnap3

Fork of ITKSNAP3 with MINC support
GNU General Public License v3.0
2 stars 1 forks source link

Advice for self-contained build? #1

Open gdevenyi opened 8 years ago

gdevenyi commented 8 years ago

Seems ITKSNAP has a ton of crazy dependencies (ITK/VTK/Qt) which aren't packaged on Ubuntu, do you have any recommended ways to easily build this?

Thanks!

vfonov commented 8 years ago

I used ITK from minc-toolkit-v2 ( compile with shared libraries) , vtk-6.0 from Ubuntu repository and binary install of QT 5.4 - that's for Ubuntu 14.04 build. For debian builds I compiled vtk-6.0 manually and again used binary version of QT 5.4

gdevenyi commented 8 years ago

Hi,

I'm trying to build against http://packages.bic.mni.mcgill.ca/minc-toolkit/Debian/minc-toolkit-1.9.11-20160202-Ubuntu_15.04-x86_64.deb and at link time I get a ton of undefined references, are the debs built with shared libraries?

vfonov commented 8 years ago

yes, it's built with shared libraries

gdevenyi commented 8 years ago

Okay thanks, I'll continue to fight with it.

Details if you happen to have run into anything Ubuntu 16.04 vtk6-dev 6.2.0 qt4-dev 4.8.7

vfonov commented 8 years ago

I just built it on Ubuntu 16.04: http://www.bic.mni.mcgill.ca/~vfonov/temp/itksnap-3.4.0-20151130-Linux-x86_64-qt4.tar.gz

vfonov commented 8 years ago

cmake -L BUILD_OUTSIDE_INSIGHT_APPLICATIONS:BOOL=TRUE BUILD_TESTING:BOOL=ON CMAKE_BUILD_TYPE:STRING=Release CMAKE_INSTALL_PREFIX:PATH=/opt/minc/1.9.12 ITK_DIR:PATH=/opt/minc/1.9.12/lib/cmake/ITK-4.9 QT_QMAKE_EXECUTABLE:FILEPATH=/usr/bin/qmake-qt4 SNAP_USE_GPU:BOOL=OFF SNAP_USE_QT4:BOOL=ON VTK_DIR:PATH=/usr/lib/cmake/vtk-6.2

gdevenyi commented 8 years ago

Thanks I'll give that a try

gdevenyi commented 8 years ago
> cmake -L
BUILD_OUTSIDE_INSIGHT_APPLICATIONS:BOOL=TRUE
BUILD_TESTING:BOOL=ON
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_INSTALL_PREFIX:PATH=/usr/local
ITK_DIR:PATH=/opt/minc-itk4/lib/cmake/ITK-4.9
QT_QMAKE_EXECUTABLE:FILEPATH=/usr/bin/qmake
SNAP_USE_GPU:BOOL=OFF
SNAP_USE_QT4:BOOL=ON
VTK_DIR:PATH=/usr/lib/cmake/vtk-6.2

Linking errors:

[ 97%] Linking CXX executable Test_OrientationWidget
CMakeFiles/Test_OrientationWidget.dir/GUI/Renderer/OrientationWidget/Test_OrientationWidget/OrientationWidgetGUI.cxx.o: In function `vtkRenderingFreeType_AutoInit::~vtkRenderingFreeType_AutoInit()':
OrientationWidgetGUI.cxx:(.text._ZN29vtkRenderingFreeType_AutoInitD2Ev[_ZN29vtkRenderingFreeType_AutoInitD5Ev]+0x5): undefined reference to `vtkRenderingFreeTypeFontConfig_AutoInit_Destruct()'
OrientationWidgetGUI.cxx:(.text._ZN29vtkRenderingFreeType_AutoInitD2Ev[_ZN29vtkRenderingFreeType_AutoInitD5Ev]+0xe): undefined reference to `vtkRenderingMatplotlib_AutoInit_Destruct()'
CMakeFiles/Test_OrientationWidget.dir/GUI/Renderer/OrientationWidget/Test_OrientationWidget/OrientationWidgetGUI.cxx.o: In function `_GLOBAL__sub_I__ZN20OrientationWidgetGUIC2Ev':
OrientationWidgetGUI.cxx:(.text.startup+0x69): undefined reference to `vtkRenderingFreeTypeFontConfig_AutoInit_Construct()'
OrientationWidgetGUI.cxx:(.text.startup+0x6e): undefined reference to `vtkRenderingMatplotlib_AutoInit_Construct()'
CMakeFiles/Test_OrientationWidget.dir/GUI/Renderer/OrientationWidget/Test_OrientationWidget/main.cxx.o: In function `_GLOBAL__sub_I_flag_snap_debug_events':
main.cxx:(.text.startup+0x69): undefined reference to `vtkRenderingFreeTypeFontConfig_AutoInit_Construct()'
main.cxx:(.text.startup+0x6e): undefined reference to `vtkRenderingMatplotlib_AutoInit_Construct()'
CMakeFiles/Test_OrientationWidget.dir/GUI/Renderer/OrientationWidget/Test_OrientationWidget/moc_OrientationWidgetGUI.cxx.o: In function `_GLOBAL__sub_I__ZN20OrientationWidgetGUI18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv':
moc_OrientationWidgetGUI.cxx:(.text.startup+0x69): undefined reference to `vtkRenderingFreeTypeFontConfig_AutoInit_Construct()'
moc_OrientationWidgetGUI.cxx:(.text.startup+0x6e): undefined reference to `vtkRenderingMatplotlib_AutoInit_Construct()'
libitksnapui_qt.a(QtAbstractOpenGLBox.cxx.o): In function `vtkIOImage_AutoInit::~vtkIOImage_AutoInit()':
QtAbstractOpenGLBox.cxx:(.text._ZN19vtkIOImage_AutoInitD2Ev[_ZN19vtkIOImage_AutoInitD5Ev]+0x1): undefined reference to `vtkIOMPIImage_AutoInit_Destruct()'
libitksnapui_qt.a(QtAbstractOpenGLBox.cxx.o): In function `_GLOBAL__sub_I__ZN19QtAbstractOpenGLBoxC2EP7QWidget':
QtAbstractOpenGLBox.cxx:(.text.startup+0x41): undefined reference to `vtkIOMPIImage_AutoInit_Construct()'
libitksnapui_model.a(GLToPNG.cxx.o): In function `_GLOBAL__sub_I__Z16GLToVTKImageDatajiiii':
GLToPNG.cxx:(.text.startup+0x41): undefined reference to `vtkIOMPIImage_AutoInit_Construct()'
libitksnapui_model.a(OrientationGraphicRenderer.cxx.o): In function `_GLOBAL__sub_I__ZN26OrientationGraphicRendererC2Ev':
OrientationGraphicRenderer.cxx:(.text.startup+0x69): undefined reference to `vtkRenderingFreeTypeFontConfig_AutoInit_Construct()'
OrientationGraphicRenderer.cxx:(.text.startup+0x6e): undefined reference to `vtkRenderingMatplotlib_AutoInit_Construct()'
libitksnapui_model.a(ScanningROI.cxx.o): In function `_GLOBAL__sub_I__ZN16Pairs_Plane_PipeC2Ev':
ScanningROI.cxx:(.text.startup+0x69): undefined reference to `vtkRenderingFreeTypeFontConfig_AutoInit_Construct()'
ScanningROI.cxx:(.text.startup+0x6e): undefined reference to `vtkRenderingMatplotlib_AutoInit_Construct()'
libitksnapui_model.a(ReorientProps.cxx.o): In function `_GLOBAL__sub_I__ZN13ReorientProps13isMatrixValidE15vtkSmartPointerI12vtkMatrix4x4E':
ReorientProps.cxx:(.text.startup+0x69): undefined reference to `vtkIOMPIImage_AutoInit_Construct()'
ReorientProps.cxx:(.text.startup+0x82): undefined reference to `vtkRenderingFreeTypeFontConfig_AutoInit_Construct()'
ReorientProps.cxx:(.text.startup+0x87): undefined reference to `vtkRenderingMatplotlib_AutoInit_Construct()'
libitksnapui_model.a(AxesWidget.cxx.o): In function `_GLOBAL__sub_I__ZN10AxesWidget13m_arrdbColRedE':
AxesWidget.cxx:(.text.startup+0x69): undefined reference to `vtkRenderingFreeTypeFontConfig_AutoInit_Construct()'
AxesWidget.cxx:(.text.startup+0x6e): undefined reference to `vtkRenderingMatplotlib_AutoInit_Construct()'
collect2: error: ld returned 1 exit status
CMakeFiles/Test_OrientationWidget.dir/build.make:304: recipe for target 'Test_OrientationWidget' failed
make[2]: *** [Test_OrientationWidget] Error 1
CMakeFiles/Makefile2:389: recipe for target 'CMakeFiles/Test_OrientationWidget.dir/all' failed
make[1]: *** [CMakeFiles/Test_OrientationWidget.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
gdevenyi commented 8 years ago

Your binary build seems to run fine in my VM, so for now I'll just unpack it.

I'll try again when I spin up the dev version of the VM.