Build in Windows

(Difference between revisions)
Jump to: navigation, search
Line 131: Line 131:
  
  
Now you can go to root of BioImageXD source and launch BioImageXD by 'python BioImageXD.py'. Depending where you installed libraries, you might need to set PYTHONPATH and/or PATH environment variables. Add following to your environment variables (Windows 7: Control Panel->System->Advanced system settings->Environment variables):
+
Now you can go to root of BioImageXD sources and launch BioImageXD by 'python BioImageXD.py'. Depending where you installed libraries, you might need to set PYTHONPATH and/or PATH environment variables. Add following to your environment variables (Windows 7: Control Panel->System->Advanced system settings->Environment variables):
 
<code>
 
<code>
 
PYTHONPATH=${VTK_BINARY_PATH}\Wrapping\Python:${VTK_BINARY_PATH}\bin\Release:${VTKBXD_BINARY_PATH}\Wrapping\Python:${VTKBXD_BINARY_PATH}\bin\Release:${WRAPITK_BINARY_PATH}\lib:${WRAPITK_BINARY_PATH}\Languages\Python\Release:${ITKVTKGLUE_BINARY_PATH}\lib:${ITKBXD_BINARY_PATH}\lib<br/>
 
PYTHONPATH=${VTK_BINARY_PATH}\Wrapping\Python:${VTK_BINARY_PATH}\bin\Release:${VTKBXD_BINARY_PATH}\Wrapping\Python:${VTKBXD_BINARY_PATH}\bin\Release:${WRAPITK_BINARY_PATH}\lib:${WRAPITK_BINARY_PATH}\Languages\Python\Release:${ITKVTKGLUE_BINARY_PATH}\lib:${ITKBXD_BINARY_PATH}\lib<br/>

Revision as of 07:20, 5 July 2012

These instructions give details how we build all necessary libraries and setup BioImageXD in Windows. Same instructions work for Windows XP, Vista and 7, and for both 32- and 64-bit systems. We use Visual Studio 2008 to build necessary libraries, but other tools should work as well. If you have any problems, contact info@bioimagexd.net. Whole process takes full day (about 8h), but gladly computer will do most of the job.

Prerequisites:


Contents

Building VTK

  1. Download VTK 5.6.1 (or newer, might work, but no guarantees), http://www.vtk.org/files/release/5.6/vtk-5.6.1.zip
  2. Extract package
  3. Open CMake GUI
  4. Browse path of VTK sources to "Where is the source code"
  5. Create new directory for binaries and set it to "Where to build the binaries"
  6. Change Simple view to Advanced view
  7. Set following settings:
    BUILD_SHARED_LIBS: ON
    BUILD_TESTING: OFF
    CMAKE_BUILD_TYPE: Release
    VTK_USE_PARALLEL: ON
    VTK_WRAP_PYTHON: ON
  8. Click 'Configure' and set
    VTK_USE_TK: OFF
  9. Click 'Configure' to configure and 'Generate' to generate and exit
  10. Go to directory you selected for binaries and open file 'VTK.sln' to Visual Studio.
  11. Select Build->Build Solution, get a cup of coffee and wait about 30-60 minutes for VTK to get build


Building ITK

  1. Download ITK 3.20.1 (ITK 4.x.x will not work, we'll updated this guide when we move to ITK 4), http://sourceforge.net/projects/itk/files/itk/3.20/InsightToolkit-3.20.1.zip/download
  2. Extract package
  3. Open CMake GUI
  4. Browse path of ITK sources to "Where is the source code"
  5. Create new directory for binaries and set it to "Where to build the binaries"
  6. Change Simple view to Advanced view
  7. Set following settings:
    BUILD_EXAMPLES: OFF
    BUILD_SHARED_LIBS: ON
    BUILD_TESTING: OFF
    CMAKE_BUILD_TYPE: Release
    ITK_USE_OPTIMIZED_REGISTRATION: ON
    ITK_USE_REVIEW: ON
    ITK_USE_REVIEW_STATISTICS: ON
  8. Click 'Configure' to configure (don't care about attentions) and 'Generate' to generate and exit
  9. Go to directory you selected for binaries and open file 'ITK.sln' to Visual Studio.
  10. Select Build->Build Solution, get another cup of coffee and wait about 10 minutes for ITK to get build


Building CableSwig (needed for wrapITK)

  1. Download CableSwig-ITK 3.20.0, http://voxel.dl.sourceforge.net/sourceforge/itk/CableSwig-ITK-3.20.0.zip
  2. Extract package
  3. Open CMake GUI
  4. Browse path of CableSwig sources to "Where is the source code"
  5. Create new directory for binaries and set it to "Where to build the binaries"
  6. Change Simple view to Advanced view
  7. Set following settings:
    CMAKE_BUILD_TYPE: Release
  8. Click 'Configure' to configure and 'Generate' to generate and exit
  9. Go to directory you selected for binaries and open file 'CableSwig.sln' to Visual Studio.
  10. Select Build->Build Solution, and wait about 5 minutes for CableSwig to get build


Building wrapITK (the long-lasting part)

  1. Create directory for wrapITK source
  2. Go to directory and fetch sources using command 'svn checkout http://wrapitk.googlecode.com/svn/branches/maint .'
  3. Open CMake GUI
  4. Browse path of wrapITK sources to "Where is the source code"
  5. Create new directory for binaries and set it to "Where to build the binaries"
  6. Change Simple view to Advanced view
  7. Set following settings:
    BUILD_TESTING: OFF
    CMAKE_BUILD_TYPE: Release
    ITK_DIR: Set to root directory of your ITK sources
    WRAP_double: ON
    WRAP_unsigned_char: ON
    WRAP_unsigned_long: ON
  8. Click 'Configure' to configure (don't care about possible errors) and set
    CableSwig_DIR: Set to root directory of your CableSwig sources
    WRAP_ITK_PYTHON: ON
    INSTALL_WRAP_ITK_COMPATIBILITY: OFF
  9. Click 'Configure' to configure, nothing to set so click 'Configure' to configure again, and 'Generate' to generate and exit
  10. Go to directory you selected for binaries and open file 'wrapITK.sln' to Visual Studio.
  11. Select Build->Build Solution. Since you have drinked too many cups of coffee you might not feel like having a lunch right now. Go for nice 30-60 minutes walk outside. After that you can have lunch or dinner. Then wait a while for building of wrapITK to finish. It will take about 3-5 hours.
  12. Open CMake GUI
  13. Browse path ${wrapITK_source}\ExternalProjects\ItkVtkGlue to "Where is the source code" and "Where to build the binaries"
  14. Change Simple view to Advanced view
  15. Set following settings:
    BUILD_WRAPPERS: ON
    CMAKE_BUILD_TYPE: Release
    ITK_DIR: Set to root directory of ITK sources
  16. Click 'Configure' to configure (don't care about possible errors) and set
    VTK_DIR: Set to root directory of VTK sources
  17. Click 'Configure' to configure and set
    WrapITK_DIR: Set to root directory of wrapITK sources
  18. Click 'Configure' to configure, and 'Generate' to generate and exit
  19. Go to directory ${wrapITK_source}\ExternalProjects\ItkVtkGlue and open file 'ItkVtkGlue.sln' to Visual Studio
  20. Select Build->Build Solution, and wait for ItkVtkGlue to get build


Get BioImageXD sources and build vtkBXD and itkBXD

  1. Create directory for BioImageXD sources and fetch sources using command 'svn co https://bioimagexd.svn.sourceforge.net/svnroot/bioimagexd/bioimagexd/trunk .'
  2. Open CMake GUI
  3. Browse path ${BXD_source}\vtkBXD to "Where is the source code" and "Where to build the binaries"
  4. Change Simple view to Advanced view
  5. Set following settings:
    CMAKE_BUILD_TYPE: Release
    VTK_DIR: Set to root directory of VTK sources
  6. Click 'Configure' to configure, 'Configure' to configure, and 'Generate' to generate and exit
  7. Go to directory ${BXD_source}\vtkBXD and open file 'VTKBXD.sln' to Visual Studio
  8. Select Build->Build Solution, and wait for VTKBXD to get build
  9. Open CMake GUI
  10. Browse path ${BXD_source}\itkBXD to "Where is the source code" and "Where to build the binaries"
  11. Change Simple view to Advanced view
  12. Set following settings:
    CMAKE_BUILD_TYPE: Release
    ITK_DIR: Set to root directory of ITK sources
    WrapITK_DIR: Set to root directory of wrapITK sources
  13. Click 'Configure' to configure, 'Configure' to configure and 'Generate' to generate and exit
  14. Go to directory ${BXD_source}\itkBXD and open file 'ITKBXD.sln' to Visual Studio
  15. Select Build->Build Solution, and wait for ITKBXD to get build


Final setup

Now you can go to root of BioImageXD sources and launch BioImageXD by 'python BioImageXD.py'. Depending where you installed libraries, you might need to set PYTHONPATH and/or PATH environment variables. Add following to your environment variables (Windows 7: Control Panel->System->Advanced system settings->Environment variables): PYTHONPATH=${VTK_BINARY_PATH}\Wrapping\Python:${VTK_BINARY_PATH}\bin\Release:${VTKBXD_BINARY_PATH}\Wrapping\Python:${VTKBXD_BINARY_PATH}\bin\Release:${WRAPITK_BINARY_PATH}\lib:${WRAPITK_BINARY_PATH}\Languages\Python\Release:${ITKVTKGLUE_BINARY_PATH}\lib:${ITKBXD_BINARY_PATH}\lib
PATH=${WRAPITK_BINARY_PATH}\lib\Release:${ITK_BINARY_PATH}\lib\Release:${ITKVTKGLUE_BINARY_PATH}\lib\Release:${ITKBXD_BINARY_PATH}\lib\Release
Where ${...} should be replaced with path to that location.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox