Build in Windows
Line 117: | Line 117: | ||
# Select Build->Build Solution, and wait for VTKBXD to get build | # Select Build->Build Solution, and wait for VTKBXD to get build | ||
# Open CMake GUI | # Open CMake GUI | ||
− | # Browse path ${ | + | # Browse path ${BXD_SOURCE}\itkBXD to "Where is the source code" and "Where to build the binaries" |
# Change Simple view to Advanced view | # Change Simple view to Advanced view | ||
# Set following settings: | # Set following settings: | ||
Line 124: | Line 124: | ||
#: <code>WrapITK_DIR: Set to root directory of wrapITK sources</code> | #: <code>WrapITK_DIR: Set to root directory of wrapITK sources</code> | ||
# Click 'Configure' to configure, 'Configure' to configure and 'Generate' to generate and exit | # Click 'Configure' to configure, 'Configure' to configure and 'Generate' to generate and exit | ||
− | # Go to directory ${ | + | # Go to directory ${BXD_SOURCE}\itkBXD and open file 'ITKBXD.sln' to Visual Studio |
# Select Build->Build Solution, and wait for ITKBXD to get build | # Select Build->Build Solution, and wait for ITKBXD to get build | ||
Latest revision as of 09:09, 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:
- Python 2.6 (2.7 might also work, but haven't been tested in Windows), http://www.python.org
- wxPython 2.8.x (2.9.x might also work, but haven't been tested in Windows), http://www.wxpython.org/
- CMake 2.6 or newer, http://www.cmake.org
- SWIG 1.3.38 or newer (2.x.x series haven't been tested), http://www.swig.org/
- Subversion client
Contents |
[edit] Building VTK
- 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
- Extract package
- Open CMake GUI
- Browse path of VTK sources to "Where is the source code"
- Create new directory for binaries and set it to "Where to build the binaries"
- Change Simple view to Advanced view
- Set following settings:
-
BUILD_SHARED_LIBS: ON
-
BUILD_TESTING: OFF
-
CMAKE_BUILD_TYPE: Release
-
VTK_USE_PARALLEL: ON
-
VTK_WRAP_PYTHON: ON
-
- Click 'Configure' and set
-
VTK_USE_TK: OFF
-
- Click 'Configure' to configure and 'Generate' to generate and exit
- Go to directory you selected for binaries and open file 'VTK.sln' to Visual Studio.
- Select Build->Build Solution, get a cup of coffee and wait about 30-60 minutes for VTK to get build
[edit] Building ITK
- 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
- Extract package
- Open CMake GUI
- Browse path of ITK sources to "Where is the source code"
- Create new directory for binaries and set it to "Where to build the binaries"
- Change Simple view to Advanced view
- 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
-
- Click 'Configure' to configure (don't care about attentions) and 'Generate' to generate and exit
- Go to directory you selected for binaries and open file 'ITK.sln' to Visual Studio.
- Select Build->Build Solution, get another cup of coffee and wait about 10 minutes for ITK to get build
[edit] Building CableSwig (needed for wrapITK)
- Download CableSwig-ITK 3.20.0, http://voxel.dl.sourceforge.net/sourceforge/itk/CableSwig-ITK-3.20.0.zip
- Extract package
- Open CMake GUI
- Browse path of CableSwig sources to "Where is the source code"
- Create new directory for binaries and set it to "Where to build the binaries"
- Change Simple view to Advanced view
- Set following settings:
-
CMAKE_BUILD_TYPE: Release
-
- Click 'Configure' to configure and 'Generate' to generate and exit
- Go to directory you selected for binaries and open file 'CableSwig.sln' to Visual Studio.
- Select Build->Build Solution, and wait about 5 minutes for CableSwig to get build
[edit] Building wrapITK (the long-lasting part)
- Create directory for wrapITK source
- Go to directory and fetch sources using command 'svn checkout http://wrapitk.googlecode.com/svn/branches/maint .'
- Open CMake GUI
- Browse path of wrapITK sources to "Where is the source code"
- Create new directory for binaries and set it to "Where to build the binaries"
- Change Simple view to Advanced view
- 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
-
- 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
-
- Click 'Configure' to configure, nothing to set so click 'Configure' to configure again, and 'Generate' to generate and exit
- Go to directory you selected for binaries and open file 'wrapITK.sln' to Visual Studio.
- 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.
- Open CMake GUI
- Browse path ${wrapITK_source}\ExternalProjects\ItkVtkGlue to "Where is the source code" and "Where to build the binaries"
- Change Simple view to Advanced view
- Set following settings:
-
BUILD_WRAPPERS: ON
-
CMAKE_BUILD_TYPE: Release
-
ITK_DIR: Set to root directory of ITK sources
-
- Click 'Configure' to configure (don't care about possible errors) and set
-
VTK_DIR: Set to root directory of VTK sources
-
- Click 'Configure' to configure and set
-
WrapITK_DIR: Set to root directory of wrapITK sources
-
- Click 'Configure' to configure, and 'Generate' to generate and exit
- Go to directory ${wrapITK_source}\ExternalProjects\ItkVtkGlue and open file 'ItkVtkGlue.sln' to Visual Studio
- Select Build->Build Solution, and wait for ItkVtkGlue to get build
[edit] Get BioImageXD sources and build vtkBXD and itkBXD
- Create directory for BioImageXD sources and fetch sources using command 'svn co https://bioimagexd.svn.sourceforge.net/svnroot/bioimagexd/bioimagexd/trunk .'
- Open CMake GUI
- Browse path ${BXD_source}\vtkBXD to "Where is the source code" and "Where to build the binaries"
- Change Simple view to Advanced view
- Set following settings:
-
CMAKE_BUILD_TYPE: Release
-
VTK_DIR: Set to root directory of VTK sources
-
- Click 'Configure' to configure, 'Configure' to configure, and 'Generate' to generate and exit
- Go to directory ${BXD_source}\vtkBXD and open file 'VTKBXD.sln' to Visual Studio
- Select Build->Build Solution, and wait for VTKBXD to get build
- Open CMake GUI
- Browse path ${BXD_SOURCE}\itkBXD to "Where is the source code" and "Where to build the binaries"
- Change Simple view to Advanced view
- 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
-
- Click 'Configure' to configure, 'Configure' to configure and 'Generate' to generate and exit
- Go to directory ${BXD_SOURCE}\itkBXD and open file 'ITKBXD.sln' to Visual Studio
- Select Build->Build Solution, and wait for ITKBXD to get build
[edit] Final setup
Now you can go to root of BioImageXD sources and launch BioImageXD by 'python BioImageXD.py'. Depending where you built 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
Where
PATH=${WRAPITK_BINARY_PATH}\lib\Release:${ITK_BINARY_PATH}\lib\Release:${ITKVTKGLUE_BINARY_PATH}\lib\Release:${ITKBXD_BINARY_PATH}\lib\Release
${...}
should be replaced with path to that location.