Build in Windows
(Created page with "These instructions give details how we build all necessary libraries and setup BioImageXD in Linux. Same instructions have been used in Ubuntu and Fedora distros, and most lik...") |
|||
(8 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | These instructions give details how we build all necessary libraries and setup BioImageXD in | + | 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:''' | '''Prerequisites:''' | ||
− | * Python 2.6 (2.7 might also work, but haven't been tested in | + | * 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 | + | * 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 | * 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/ | * SWIG 1.3.38 or newer (2.x.x series haven't been tested), http://www.swig.org/ | ||
Line 11: | Line 11: | ||
== Building VTK == | == 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. | + | # 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 | # Extract package | ||
− | # | + | # Open CMake GUI |
− | # Set following settings | + | # 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: | ||
#: <code>BUILD_SHARED_LIBS: ON</code> | #: <code>BUILD_SHARED_LIBS: ON</code> | ||
− | #: <code>BUILD_TESTING: OFF | + | #: <code>BUILD_TESTING: OFF</code> |
#: <code>CMAKE_BUILD_TYPE: Release</code> | #: <code>CMAKE_BUILD_TYPE: Release</code> | ||
− | |||
#: <code>VTK_USE_PARALLEL: ON</code> | #: <code>VTK_USE_PARALLEL: ON</code> | ||
#: <code>VTK_WRAP_PYTHON: ON</code> | #: <code>VTK_WRAP_PYTHON: ON</code> | ||
− | # Click ' | + | # Click 'Configure' and set |
#: <code>VTK_USE_TK: OFF</code> | #: <code>VTK_USE_TK: OFF</code> | ||
− | # Click ' | + | # 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 | |
− | + | ||
== Building ITK == | == 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. | + | # 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 | # Extract package | ||
− | # | + | # Open CMake GUI |
− | # Set following settings | + | # Browse path of ITK sources to "Where is the source code" |
− | #: <code>BUILD_EXAMPLES: OFF | + | # Create new directory for binaries and set it to "Where to build the binaries" |
+ | # Change Simple view to Advanced view | ||
+ | # Set following settings: | ||
+ | #: <code>BUILD_EXAMPLES: OFF</code> | ||
#: <code>BUILD_SHARED_LIBS: ON</code> | #: <code>BUILD_SHARED_LIBS: ON</code> | ||
− | #: <code>BUILD_TESTING: OFF | + | #: <code>BUILD_TESTING: OFF</code> |
#: <code>CMAKE_BUILD_TYPE: Release</code> | #: <code>CMAKE_BUILD_TYPE: Release</code> | ||
− | |||
#: <code>ITK_USE_OPTIMIZED_REGISTRATION: ON</code> | #: <code>ITK_USE_OPTIMIZED_REGISTRATION: ON</code> | ||
#: <code>ITK_USE_REVIEW: ON</code> | #: <code>ITK_USE_REVIEW: ON</code> | ||
#: <code>ITK_USE_REVIEW_STATISTICS: ON</code> | #: <code>ITK_USE_REVIEW_STATISTICS: ON</code> | ||
− | # Click ' | + | # 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 | |
== Building CableSwig (needed for wrapITK) == | == Building CableSwig (needed for wrapITK) == | ||
− | # Download CableSwig-ITK 3.20.0, http://voxel.dl.sourceforge.net/sourceforge/itk/CableSwig-ITK-3.20.0. | + | # Download CableSwig-ITK 3.20.0, http://voxel.dl.sourceforge.net/sourceforge/itk/CableSwig-ITK-3.20.0.zip |
# Extract package | # Extract package | ||
− | # | + | # Open CMake GUI |
− | # Set following settings | + | # 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: | ||
#: <code>CMAKE_BUILD_TYPE: Release</code> | #: <code>CMAKE_BUILD_TYPE: Release</code> | ||
− | + | # Click 'Configure' to configure and 'Generate' to generate and exit | |
− | # Click ' | + | # 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 |
− | + | ||
Line 65: | Line 70: | ||
# Create directory for wrapITK source | # Create directory for wrapITK source | ||
# Go to directory and fetch sources using command 'svn checkout http://wrapitk.googlecode.com/svn/branches/maint .' | # 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" |
− | #: <code>BUILD_TESTING: OFF | + | # Create new directory for binaries and set it to "Where to build the binaries" |
+ | # Change Simple view to Advanced view | ||
+ | # Set following settings: | ||
+ | #: <code>BUILD_TESTING: OFF</code> | ||
#: <code>CMAKE_BUILD_TYPE: Release</code> | #: <code>CMAKE_BUILD_TYPE: Release</code> | ||
− | |||
#: <code>ITK_DIR: Set to root directory of your ITK sources</code> | #: <code>ITK_DIR: Set to root directory of your ITK sources</code> | ||
#: <code>WRAP_double: ON</code> | #: <code>WRAP_double: ON</code> | ||
#: <code>WRAP_unsigned_char: ON</code> | #: <code>WRAP_unsigned_char: ON</code> | ||
#: <code>WRAP_unsigned_long: ON</code> | #: <code>WRAP_unsigned_long: ON</code> | ||
− | # Click ' | + | # Click 'Configure' to configure (don't care about possible errors) and set |
#: <code>CableSwig_DIR: Set to root directory of your CableSwig sources</code> | #: <code>CableSwig_DIR: Set to root directory of your CableSwig sources</code> | ||
#: <code>WRAP_ITK_PYTHON: ON</code> | #: <code>WRAP_ITK_PYTHON: ON</code> | ||
− | #: <code>INSTALL_WRAP_ITK_COMPATIBILITY: OFF | + | #: <code>INSTALL_WRAP_ITK_COMPATIBILITY: OFF</code> |
− | # Click ' | + | # 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" |
− | # Set following settings | + | # Change Simple view to Advanced view |
+ | # Set following settings: | ||
#: <code>BUILD_WRAPPERS: ON</code> | #: <code>BUILD_WRAPPERS: ON</code> | ||
#: <code>CMAKE_BUILD_TYPE: Release</code> | #: <code>CMAKE_BUILD_TYPE: Release</code> | ||
− | |||
#: <code>ITK_DIR: Set to root directory of ITK sources</code> | #: <code>ITK_DIR: Set to root directory of ITK sources</code> | ||
− | + | # Click 'Configure' to configure (don't care about possible errors) and set | |
− | # Click ' | + | |
#: <code>VTK_DIR: Set to root directory of VTK sources</code> | #: <code>VTK_DIR: Set to root directory of VTK sources</code> | ||
− | # Click ' | + | # Click 'Configure' to configure and set |
#: <code>WrapITK_DIR: Set to root directory of wrapITK sources</code> | #: <code>WrapITK_DIR: Set to root directory of wrapITK sources</code> | ||
− | # Click ' | + | # 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 |
Line 101: | Line 107: | ||
# Create directory for BioImageXD sources and fetch sources using command 'svn co https://bioimagexd.svn.sourceforge.net/svnroot/bioimagexd/bioimagexd/trunk .' | # 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" |
− | # Set following settings | + | # Change Simple view to Advanced view |
+ | # Set following settings: | ||
#: <code>CMAKE_BUILD_TYPE: Release</code> | #: <code>CMAKE_BUILD_TYPE: Release</code> | ||
− | |||
#: <code>VTK_DIR: Set to root directory of VTK sources</code> | #: <code>VTK_DIR: Set to root directory of VTK sources</code> | ||
− | # Click ' | + | # 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" |
− | # Set following settings | + | # Change Simple view to Advanced view |
+ | # Set following settings: | ||
#: <code>CMAKE_BUILD_TYPE: Release</code> | #: <code>CMAKE_BUILD_TYPE: Release</code> | ||
− | |||
#: <code>ITK_DIR: Set to root directory of ITK sources</code> | #: <code>ITK_DIR: Set to root directory of ITK sources</code> | ||
#: <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 ' | + | # 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 |
− | # | + | |
Line 126: | Line 131: | ||
− | Now you can go to root of BioImageXD | + | 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=${ | + | <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/> | |
+ | PATH=${WRAPITK_BINARY_PATH}\lib\Release:${ITK_BINARY_PATH}\lib\Release:${ITKVTKGLUE_BINARY_PATH}\lib\Release:${ITKBXD_BINARY_PATH}\lib\Release | ||
</code> | </code> | ||
+ | Where <code>${...}</code> should be replaced with path to that location. |
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.