Compiling NeuroLib

From wiki
Revision as of 18:22, 12 June 2024 by Jblocher (talk | contribs) (Created page with "=== General Information === * Major help is located in the [http://www.ia.unc.edu/dev/tutorials/index.php tutorial section] * Casey's install-and-compile-everything script: SetupScript === Directory structure === * Download NeuroLib sources and save them in some place in your local machine. Let's call this directory NEUROLIB_SOURCE * Create a directory somewhere else, where the output build files will be located. This directory will be...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

General Information

Directory structure

  • Download NeuroLib sources and save them in some place in your local machine. Let's call this directory NEUROLIB_SOURCE
  • Create a directory somewhere else, where the output build files will be located. This directory will be called NEUROLIB_BUILD
  • From NEUROLIB_BUILD, use ccmake
- /opt/local/cmake-2.6.2-Linux-i386/bin/ccmake ../NEUROLIB_SOURCE
  • Configure Cmake, generate makefiles using the guidelines below.

Libraries path

  • Build libraries:
- ITK: 
 - ITK 3.16: /opt/local/ITK_3.X/Insight_3.16.0
 - ITK 3.20: /opt/local/ITK_3.X/Insight_3.20.0
- FLTK: /opt/local/FLTK
- VTK: 
 - VTK_5.2: /opt/local/VTK/VTK_5.2
 - VTK_5.6: /opt/local/VTK/VTK_5.6
- KWWidgets: /opt/local/KWWIDGETS
- SOViewer: /opt/local/SOViewer
- InsightApplications: /opt/local/ITK_3.X/Insight_3.20.0
- GenerateCLP: /opt/local/GenerateCLP
- Qt
 - Qt4.4: /opt/local/Qt4.4
 - Qt4.6.2: /opt/local/Qt4.6.2
- vtkITK
 - vtkITK: /biomed-resimg/crews_rodent/devel/linux/vtkITK/vtkITK_linux64
 - vtkITK_SOURCE_DIR: /biomed-resimg/crews_rodent/devel/linux/Slicer_3.6/Slicer3/Libs/vtkITK
  • Installed libraries (latest release):
- ITK: /tools/ITK/ITK_3.20.0/
- VTK: /tools/VTK/VTK_5.6/
- Qt:
  - Qt3.3: /usr/lib/Qt3-3
  - Qt4.x: /tools/Qt
  • Compilation information
    • VTK_5.2
      • VTK_5.2 build library

VTK_5.2 has been compiled with:

- VTK_WRAP_TCL=ON
- VTK_USE_GUISUPPORT=ON
- VTK_USE_QVTK=ON (Qt4.4)
      • VTK_5.2 installed library

VTK_5.2 has been compiled with:

- VTK_WRAP_TCL=ON
- VTK_USE_GUISUPPORT=OFF
- VTK_USE_QVTK=OFF
    • SOViewer

SOViewer has been compiled with:

- USE_FLTK=ON
- USE_VTK=ON
- USE_QT=OFF

SOViewer_linux64_Qt3 has been compiled with:

- USE_FLTK=ON
- USE_VTK=ON
- USE_QT=ON (Qt3.3)

Example 1: Libraries used to compile NeuroLib on 64bits

- ITK_DIR: /tools/ITK/ITK_3.20.0/ITK_3.20.0_linux64_dyn/lib/InsightToolkit
- FLTK_DIR: /opt/local/FLTK/fltk-1.1.9_linux64
  - FLTK_FLUID_EXECUTABLE: /opt/local/FLTK/fltk-1.1.9_linux64/bin/fluid
- VTK_DIR: /tools/VTK/VTK_5.6/VTK_5.6_linux64_dyn/lib/vtk-5.6
- KWWidgets_DIR: /opt/local/KWWIDGETS/KWWidgets_linux64_5_6
- SOV_DIR: /opt/local/SOViewer/SOViewer_linux64_Qt3_5_6
- Insight_APPLICATIONS_BINARY_PATH: /opt/local/ITK_3.X/Insight_3.20.0/InsightApp_linux64
- GenerateCLP_DIR: /opt/local/GenerateCLP/GenerateCLP_linux64_3_20
- ModuleDescriptionParse_DIR: /opt/local/GenerateCLP/ModuleDescriptionParser_linux64_3_20
- TCLAP_DIR: /opt/local/GenerateCLP/tclap_linux64
- Qt3-3:
  - QT_INCLUDE_DIR: /usr/lib64/qt-3.3/include
  - QT_MOC_EXECUTABLE: /usr/lib64/qt-3.3/bin/moc
  - QT_QT_LIBRARY: /usr/lib64/qt-3.3/lib/libqt-mt.so
  - QT_UIC_EXECUTABLE: /usr/lib64/qt-3.3/bin/uic
- Qt4.6.2:
  - QT_QMAKE_EXECUTABLE: /tools/Qt/Qt4.6.2/qt-4.6.2-linux64/bin/qmake
  - QT_MOC_EXECUTABLE: /tools/Qt/Qt4.6.2/qt-4.6.2-linux64/bin/moc
  - QT_UIC_EXECUTABLE: /tools/Qt/Qt4.6.2/qt-4.6.2-linux64/bin/uic
  - QT_LIBRARY_DIR: /tools/Qt/Qt4.6.2/qt-4.6.2-linux64/lib
- LAPACK_LIBRARY_DIR: /usr/lib64
- BOOST_INCLUDE_DIR: /opt/local/Boost/boost_1_39_0
- BOOST_LIBRARY_DIR: /opt/local/Boost/boost_1_39_0_linux64/lib
- vtkITK_DIR: /opt/local/vtkITK/vtkITK_linux64

Example 2: Libraries used to compile NeuroLib on 32bits

- ITK_DIR: /tools/ITK/ITK_3.16.0/ITK_3.16.0_linux_dyn/lib/InsightToolkit
- FLTK_DIR: /opt/local/FLTK/fltk-1.1.9_linux
  - FLTK_FLUID_EXECUTABLE: /opt/local/FLTK/fltk-1.1.9_linux/bin/fluid
- VTK_DIR: /tools/VTK/VTK_5.2/VTK_5.2_linux_dyn/lib/vtk-5.2
- KWWidgets_DIR: /opt/local/KWWIDGETS/KWWidgets_linux
- SOV_DIR: /opt/local/SOViewer/SOViewer_linux
- Insight_APPLICATIONS_BINARY_PATH: /opt/local/ITK_3.X/Insight_3.16.0/InsightApp_linux
- GenerateCLP_DIR: /opt/local/GenerateCLP/GenerateCLP_linux_3_16
- Qt3-3:
  - QT_INCLUDE_DIR=/usr/lib/qt-3.3/include
  - QT_MOC_EXECUTABLE=/usr/lib/qt-3.3/bin/moc
  - QT_QT_LIBRARY=/usr/lib/qt-3.3/lib/libqt-mt.so
  - QT_UIC_EXECUTABLE=/usr/lib/qt-3.3/bin/uic
- Qt4.6.2:
  - QT_QMAKE_EXECUTABLE: /tools/Qt/Qt4.6.2/qt-4.6.2_linux/bin/qmake
  - QT_MOC_EXECUTABLE: /tools/Qt/Qt4.6.2/qt-4.6.2_linux/bin/moc
  - QT_UIC_EXECUTABLE: /tools/Qt/Qt4.6.2/qt-4.6.2_linux/bin/uic
  - QT_LIBRARY_DIR: /tools/Qt/Qt4.6.2/qt-4.6.2_linux/lib
- LAPACK_LIBRARY_DIR: /usr/lib
- BOOST_INCLUDE_DIR: /opt/local/Boost/boost_1_39_0
- BOOST_LIBRARY_DIR: /opt/local/Boost/boost_1_39_0_linux/lib
- vtkITK_DIR: /opt/local/vtkITK/vtkITK_linux

WARNING: As Qt4.4 has been installed in our system, we need to correct the variables QT_MOC_EXECUTABLE and QT_UIC_EXECUTABLE to use the ones from Qt3.3

In order to compile FiberTracking, we need to use SOViewer that has been compiled with Qt enabled (SOViewer_linux64_Qt3)

In order to generate static binaries, erase from your PATH and LD_LIBRARY_PATH the references to VTK and ITK libraries added by default by the Slicer installation.

Important note, to run 32bits compilations in 64b machines, CMAKE_CXX_FLAGS, CMAKE_C_FLAGS, CMAKE_EXE_LINKER_FLAGS, CMAKE_MODULE_LINKER_FLAGS, CMAKE_SHARED_LINKER_FLAGS must be set to -m32.


Compilation with libraries from Slicer (local compilation of Slicer)

- Slicer3_DIR: /opt/local/Slicer_3.6/Slicer3-build
- ITK_DIR: /opt/local/Slicer_3.6/Slicer3-lib/Insight-build/
- VTK_DIR: /opt/local/Slicer_3.6/Slicer3-lib/VTK-build/
- KWWidgets_DIR: /opt/local/Slicer_3.6/Slicer3-lib/KWWidgets-build/
- GenerateCLP_DIR: /opt/local/Slicer_3.6/Slicer3-build/Libs/SlicerExecutionModel/GenerateCLP/
- ModuleDescriptionParser_DIR: /opt/local/Slicer_3.6/Slicer3-build/Libs/SlicerExecutionModel/ModuleDescriptionParser/
- TCLAP_DIR: /opt/local/Slicer_3.6/Slicer3-build/Libs/SlicerExecutionModel/tclap/