FARSIGHT HowToBuild

From FarsightWiki
(Difference between revisions)
Jump to: navigation, search
(→Download FARSIGHT source code)
Line 1: Line 1:
== Starting a Fresh Developer's Build==
+
== Starting a Fresh Developer's Build ==
When building FARSIGHT for the first time you will need to set up a development environment. FARSIGHT utilizes several large source libraries so ensure that you have at least 15gb of HDD space. The toolkit has a SuperBuild option that automatically fetches, configures and installs the several source packages.
+
When building FARSIGHT for the first time you will need to set up a development environment. FARSIGHT utilizes several large source libraries so ensure that you have at least 25 GiB of HDD space. For conformity purposes, save the FARSIGHT source code, QT, VXL, ITK, and VTK to C:\Lab (if possible).  The following instructions will assume that the source codes will be saved in C:\Lab.
  
If you are new to the project please see the [[Developers_Tools| Developers Tools]] page for general information.
 
  
For help on running Farsight see the [[FARSIGHT_Tutorials | Tutorial Page]]
+
=== Choose a Compiler For Your OS ===
 +
Popular choices are gcc/g++ on Linux, Microsoft Visual Studio 2008/2010 on Windows, and XCode* on Mac OS X. 
  
=== Choose a Compiler For Your OS===
+
<span style="font-size:75%">*To install XCode/gcc on Mac OS X you may need to install the XCode development environment.  This software should be available on your OS reinstall/recovery disk. At this time only XCode 3.2 is supported as CMake still does not generate appropriate project files for XCode 4</span>
 
+
Popular choices are gcc/g++ on Linux & Mac, and Microsoft Visual C++ on Windows.  To install gcc on Mac OS X you may need to install the XCode development environment.  This software should be available on your OS reinstall/recovery disk.
+
  
 
=== Install CMake ===
 
=== Install CMake ===
  
CMake is used to configure FARSIGHT to be built Cross Platform with most major compilers.
+
CMake is a tool which generates the makefiles under Linux, the Visual Studio Solution files (.sln) under Windows, or the XCode project files (.xcodeproj) under Mac OS X. It aims to allow developers to build their projects across different platforms with a minimum of reconfiguration.
+
 
See [[FARSIGHT_Tutorials/Building_Software/Installing_CMake|Installing CMake]]
+
<span style="font-size:125%; color:red">Note: If you want to take advantage of multicore building in Visual Studio, you can append /MP'''n''', where '''n''' is the number of processors you have. (ie. /MP16 for the Dell T5500 Workstations in the lab) to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS at each CMake configuration screen.</span>
  
If you want to take advantage of multicore building in Visual Studio, you can append /MP<number of processors you have> (ie. /MP16 for the Dell T5500 Workstations in the lab) to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS
+
To check the number of processors your computer has, call up the command prompt, type <tt>"echo NUMBER_OF_PROCESSORS"</tt>, and the next line will result in a number.  Using a number greater than the number of processors you have will seriously slow down the computer.
  
 
=== Build or install Qt ===
 
=== Build or install Qt ===
  
Download a version of Qt for your platform from the [http://qt.nokia.com/downloads Qt download page].
+
# Build Qt from source.  Download it from here: [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.zip Windows Qt source code]. [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.tar.gz Linux/Mac Qt source code].
 +
# Extract the zip file to C:\Lab (or the directory of your choosing).
 +
# If you want to take advantage of multicore building QT, simply open up <QT root directory>\mkspecs\win32-msvc2008\qmake.conf and add [[#Install_CMake|-MP<number of processors>]] to the end of QMAKE_CFLAGS
  
If you are using Visual Studio on Windows you'll have to build Qt from source.  Download it from here: [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.zip Qt source code].
+
[[Image:QTmulticore.jpg|center|frame|none|alt=alt text|Multicore building QT (-MP16 represents 16 processors)]]
  
If you want to take advantage of multicore building QT, simply open up <QT source folder>\mkspecs\<appropriate compiler(T5500 machines in lab: win32-msvc2008)/qmake.conf and add -MP16 to the end of QMAKE_CFLAGS
+
For Visual Studio 2008/2010:
  
In order to compile it with VC++:
+
# Go to Start->All Programs->Microsoft Visual Studio 2008->Visual Studio Tools->Visual Studio 2008 x64 Win64 Command Prompt
*Check which version of Visual Studio you are using.
+
# cd to the directory where you unzipped the QT source (Auto-complete key: tab) [[Image:changeDrive.jpg|center|frame|alt=alt text|Go to the QT root directory in the Visual Studio 2008 x64 Win64 command prompt.]]
*Open a Visual Studio command prompt(32 bits or 64 bits).
+
# Run <tt>"configure"</tt> (see figure below) <span style="color:blue">(This should take about 5 minutes or more. [http://slashdot.org/ Reading material as you wait.])</span> <center>[[Image:QTacceptlicense.jpg|Configure]] [[Image:QTconfiguredone2.jpg|Configuring done, now nmake]] [[Image: QTnmakefinish.jpg|The command prompt should look like this after nmake completes.]]</center>
                                                                       
+
# Run <tt>"nmake"</tt> <span style="color:blue">[http://en.wikipedia.org/wiki/Coffee Take a coffee break.]</span> This step will take at least 30 minutes.
In the command prompt enter in the following commands:
+
#*If you made a mistake somewhere, you can start from scratch by typing <tt>"nmake confclean"</tt>
''configure ''
+
''nmake      ''
+
If you are using older versions your command may have to set platform and environment:
+
''configure -platform win32-msvc2005''                                                                   
+
Note: You may need to install and build QT first before building VTK which will require 
+
you to set some parameters like VTK_GUI_SUPPORT (Set it to ON or just check it). This will
+
bring another parameter VTK_USE_QVTK which needs to be set to ON again.
+
Then it will ask the desired QT version (Enter only 4 if you are downloading QT4.x.x).
+
If you are getting "Qt was not found" message, set QT_QMAKE_EXECUTABLE to the location of 
+
qmake.exe. For example, I have it under c:\qt-win-opensource-src-4.5.1\bin\qmake.exe
+
Configure it from CMAKE again. It should be able to find QT
+
  
 
=== Download Boost ===
 
=== Download Boost ===
  
Download the Boost C++ libraries from [http://www.boost.org/users/download/ the Boost download page].  Unpack it to a directory of your choosing.  You don't need to compile it.
+
# Download the Boost C++ libraries from [http://sourceforge.net/projects/boost/files/boost/1.47.0/ the Boost download page].   
 +
#*Make sure you download the actual source file and not the documentation (The documentation will have pdf in its name.)  [[Image: boostDownload.jpg|center|frame|[http://sourceforge.net/projects/boost/files/boost/1.47.0/ Boost download page]]]
 +
# Unzip it to C:\Lab (or a directory of your choosing).   
 +
 
 +
You '''do not''' need to compile it.
 +
 
 +
=== Download Git ===
 +
 
 +
http://git-scm.com/
  
 
=== Install Subversion ===
 
=== Install Subversion ===
 
SVN is a version control system used to manage the source code.  
 
SVN is a version control system used to manage the source code.  
  
[http://tortoisesvn.net/ TortoiseSVN]Is a popular choice for Windows that integrates into the OS
+
[http://tortoisesvn.net/ TortoiseSVN x64] is a popular choice for Windows that integrates into the OS.
  
Use [http://www.sliksvn.com/en/download SilkSVN] for the SuperBuild
+
Additional source libraries require [http://git-scm.com/ GIT]
  
Additional source libraries require [http://git-scm.com/ GIT]  
+
[[Image:TortoiseSVN.jpg|center|frame|[http://tortoisesvn.net/ Download the latest TortoiseSVN x64]]]
  
 
=== Download FARSIGHT source code ===
 
=== Download FARSIGHT source code ===
 +
# Go to C:\Lab
 +
# Right-click to view the folder menu.
 +
# Click <tt>SVN Checkout</tt> and a window will pop up.
 
You can check out a copy of FARSIGHT from the following location:
 
You can check out a copy of FARSIGHT from the following location:
  
Line 62: Line 62:
 
  https://farsight-svn.ee.uh.edu/repos/farsight/
 
  https://farsight-svn.ee.uh.edu/repos/farsight/
  
The Trunk has already merged to ITK V4 and you will need to configure the build accordingly.  
+
[[Image:svncheckoutFarsight.jpg|center|frame|SVN Checkout Farsight to the desired folder.]]
  
 
  The old Repository is locked to changes as of 2/17/2011
 
  The old Repository is locked to changes as of 2/17/2011
 
  svn://www.openworld.rpi.edu/repos/farsight  
 
  svn://www.openworld.rpi.edu/repos/farsight  
  
The actual source code is in the "trunk" subdirectory.  If you're not interested in downloading test data or branch versions, you can download only the source code by appending "/trunk" to the above path.
+
The main line of development is in the "trunk" subdirectory.  If you're not interested in downloading test data or branch versions, you can download only the source code by appending "/trunk" to the above path.
  
With the code downloaded the build can continue with one of the following options:
+
https://farsight-svn.ee.uh.edu/repos/farsight/trunk
  
== SuperBuild Instructions ==
+
[[Image:DownloadFarsightfinish.jpg‎|center|TortoiseSVN]]
The Superbuild automates the downloading, configuring and linking of the source libraries. For new users this is recommended.  
+
  
*'''Configure CMake'''
+
After all libraries and source codes have been downloaded, continue with the instructions below:
**For CMake the Source Directory Location should be set to the Superbuild sub-folder.
+
 
**Set a binary folder where ITK, VTK, and Farsight will be built.
+
== SuperBuild Instructions ==
**Configure and Generate the SuperBuild project.  
+
Superbuild has been deprecated. Don't ask for it.
**You may need to point CMake to SVN GIT QT and Boost directories if they were not added to path
+
*'''Compile Farsight'''
+
**Within the Binary folder, the code will be configured for compilation and an MSVC solution file will be generated.
+
**Build Farsight in both Debug and Release as necessary.
+
**It is advisable to use the "Rebuild Solution" option in case of major updates.
+
  
 
== Manual Source Libraries Configuration ==
 
== Manual Source Libraries Configuration ==
'''The Use of the SuperBuild CMakesList will complete all of the following for you.'''
 
 
   
 
   
 
=== Build VXL ===
 
=== Build VXL ===
  
Download the latest stable release of VXL from [http://vxl.sourceforge.net/ Vision-something-Libraries]
+
# Download the latest stable release of VXL from [http://vxl.sourceforge.net/ Vision-something-Libraries]. [[Image:downloadVXL.jpg|center|frame|[http://vxl.sourceforge.net/ VXL download page]]]
 +
# Unzip the file to C:\Lab.
 +
# Run CMake.
 +
# Specify the source folder and binary folder.
 +
# <tt>Configure</tt>
 +
# Specify the generator for this project: <tt>Visual Studio 9 2008 Win64</tt>
 +
# (optional) For speed optimization in Visual Studio, append [[#Install_CMake|-MP<number of processors>]] to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as shown in the figure to the right. [[Image: CmakeVXLmulticore.jpg|right|thumb|Multicore building VXL]]
 +
# Turn the following options <span style="color:red">OFF</span>:
 +
#*<span style="color:red">BUILD_BRL</span>
 +
#*<span style="color:red">BUILD_CONVERSIONS</span>
 +
#*<span style="color:red">BUILD_EXAMPLES</span>
 +
#*<span style="color:red">BUILD_GEL</span>
 +
#*<span style="color:red">BUILD_OUL</span>
 +
#*<span style="color:red">BUILD_OXL</span>
 +
#*<span style="color:red">BUILD_PRIP</span>
 +
#*<span style="color:red">BUILD_TBL</span>
 +
#*<span style="color:red">BUILD_TESTING</span> [[Image: cmakevxl.jpg|right|thumb|CMake VXL]]
 +
# Turn the following options <span style="color:green">ON</span>:
 +
#*<span style="color:green">BUILD_RPL_RGTL</span>
 +
# Click <tt>configure</tt> and then turn the following option <span style="color:green">ON</span>:
 +
#*<span style="color:green">BUILD_RPL_RTVL</span> (will show up in pink)
 +
# <tt>Configure</tt> again and then <tt>Generate</tt>
 +
# Go to the VXL binary folder and open the solution file ('''vxl.sln''').
 +
# Go to the main menu bar: Build->Batch Build
 +
# Turn ON the following options under ALL_BUILD:
 +
#*Debug|x64
 +
#*Release|x64 [[Image: batchbuildvxl.jpg|center|frame|Batch Build VXL]]
 +
#<tt>Build</tt>
 +
# As you wait, [http://webdevrefinery.com/forums/topic/9459-funniest-programming-comics/ play some Starcraft 2.]
  
Run CMake and turn the following options OFF:
+
=== Build ITKv4 ===
  
*BUILD_BRL
+
Download ITKv4 by going to: (Start -> Git Bash in search box). Then type the following lines:
*BUILD_CONVERSIONS
+
*BUILD_EXAMPLES
+
*BUILD_GEL
+
*BUILD_OUL
+
*BUILD_OXL
+
*BUILD_PRIP
+
*BUILD_TBL
+
*BUILD_TESTING
+
  
Turn the following options ON:
+
  ''cd /c/Lab''
*BUILD_RPL_RGTL
+
 
+
Click configure and then turn the following option ON:
+
*BUILD_RPL_RTVL
+
   
+
Please note , the previous build to the current stable build works better(If the latest stable build is 1.14, use 1.13 if you are building on FARSIGHT  )
+
 
   
 
   
The code may need to be modified in the vul_file.h to go from
+
  ''git clone git://itk.org/ITK.git''
#if defined(VCL_WIN32) && VXL_USE_WIN_WCHAR_T //line 120
+
  ''cd ITK''
to
+
  ''git checkout v4.0a09''
  #if defined(VCL_WIN32)
+
  ''git submodule update''
  #if defined (VXL_USE_WIN_WCHAR_T)
+
Remember to include the
+
  #endif //line 211
+
  
=== Build ITK ===
+
[[File:downloadITK.jpg|center|ITK]]
  
'''We have migrated to ITKv4. Check the [[Farsight_ITKv4_Migration_Guide | migration guide]] for details.'''
+
# Run CMake.
 +
# Specify the source folder and binary folder.
 +
# <tt>Configure</tt>
 +
# Specify the generator for this project: <tt>Visual Studio 9 2008 Win64</tt>
 +
# An error will show up in the CMake log complaining about BUILD_TESTING being on.
 +
# (optional) For speed optimization in Visual Studio, append [[#Install_CMake|-MP<number of processors>]] to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as shown in the figure to the right. [[Image:ITKcmake.jpg|right|thumb|alt=alt text|Multicore building ITKv4. <span style="font-size:100%; color:red">Make sure you change the number according to the number of processors you have! (ie. /MP8)</span> ]]
 +
# Turn <span style="color:red">OFF</span> the following:
 +
#*<span style="color:red">BUILD_TESTING</span>
 +
#*<span style="color:red">BUILD_EXAMPLES</span>
 +
# <tt>Configure</tt> again.
 +
# Turn <span style="color:green">ON</span> the following:
 +
#*<span style="color:green">ITKGroup_* or ITK_BUILD_ALL_MODULES</span>
 +
#*<span style="color:green">ITK_USE_64BITS_IDS</span>
 +
#*<span style="color:green">ITK_USE_REVIEW</span>
 +
#**'''Do NOT turn on ITK_USE_SYSTEM_VXL as documented in the old FARSIGHT_HowToBuild guide'''
 +
# <tt>Configure</tt> again and then <tt>Generate</tt>
 +
# Go to the ITK binary folder and open the solution file ('''ITK.sln''').
 +
# Go to the file toolbar: Build->Batch Build [[Image: batchbuildvxl.jpg|right|thumb|alt=alt text|Batch Build ITK]]
 +
# Turn ON the following options under ALL_BUILD:
 +
#*Debug|x64
 +
#*Release|x64
 +
#<tt>Build</tt>
 +
# As you wait, [http://xkcd.com/303/ poke your neighbor.]
  
For ITKv3 follow the instructions below:
 
  
Download the source code from [http://www.itk.org the Insight Segmentation & Registration Toolkit]
+
CMakeList files may need to be edited to use ${ITK_LIBRARIES} instead of ITKCommon, ITKIO, ITKBasicFilter.... etc, otherwise you will get errors like "Cannot open file: ITKCommon.lib"
 
+
Run CMake and turn the following options OFF:
+
 
+
*BUILD_SHARED_LIBS
+
*BUILD_TESTING
+
*BUILD_EXAMPLES
+
*BUILD_DOXYGEN
+
 
+
Set ITK_USE_REVIEW and ITK_USE_SYSTEM_VXL to ON, and set VXL_DIR to your VXL binary directory.
+
 
+
Note: You may need to change the mult() method inside vnl_vector.cpp to public per [http://itk-insight-users.2283740.n2.nabble.com/itk-3-18-compilation-with-external-vxl-installation-td5247164.html#a5247581 this] bug report.
+
  
 
See [[FARSIGHT_Tutorials/Building_Software]] if you'd like to enable Python wrapping for ITK.
 
See [[FARSIGHT_Tutorials/Building_Software]] if you'd like to enable Python wrapping for ITK.
Line 142: Line 156:
 
=== Build VTK ===
 
=== Build VTK ===
  
Download the source code from the [http://vtk.org/VTK/resources/software.html VTK download page]
+
# Download the source code from the [http://vtk.org/VTK/resources/software.html VTK download page]  
 
+
#*(Alternatively, you can access the latest development version of VTK using git.  This will allow you to use some additional Qt views in FARSIGHT, but the git version of VTK is less stable than the latest release.  Instructions on how to access the VTK git repository are on the same VTK download page linked above.)
Alternatively, you can access the latest development version of VTK using git.  This will allow you to use some additional Qt views in FARSIGHT, but the git version of VTK is less stable than the latest release.  Instructions on how to access the VTK git repository are on the same VTK download page linked above.
+
#*<span style="font-size:150%; color:red">If you want to run TraceEditor, you MUST [[HowToBuild_VTK_nightly|build the VTK nightly via GIT]].</span> [[Image: downloadVTK.jpg|center|frame|[http://vtk.org/VTK/resources/software.html VTK download page]]].
 
+
# Create a VTK folder in C:\Lab and extract the VTK zip file into it.
Run CMake, select Grouped and Advanced to set the following options:
+
# Run CMake.
{|
+
# Specify the source folder and the binary folder.
|-
+
# <tt>Configure</tt>
|BUILD_DOCUMENTATION
+
# Specify the generator for this project: <tt>Visual Studio 9 2008 Win64</tt>
|OFF
+
# (optional) For speed optimization in Visual Studio, append [[#Install_CMake|-MP<number of processors>]] to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as shown in the figure to the right. [[Image: CMAKEVTK.jpg|right|thumb|Multicore building VTK]]
|-
+
# Turn <span style="color:red">OFF</span> the following options:  
|BUILD_EXAMPLES
+
#*<span style="color:red">BUILD_DOCUMENTATION</span>
|OFF
+
#*<span style="color:red">BUILD_EXAMPLES</span>
|-
+
#*<span style="color:red">BUILD_SHARED_LIBS</span>
|BUILD_SHARED_LIBS
+
#*<span style="color:red">BUILD_TESTING</span>
|OFF
+
# Turn <span style="color:green">ON</span> the following options:
|-
+
#*<span style="color:green">VTK_USE_BOOST</span>
|BUILD_TESTING
+
#*<span style="color:green">VTK_USE_GUISUPPORT</span>
|OFF
+
#*<span style="color:green">VTK_USE_QT</span>
|-
+
# <tt>Configure</tt>
|VTK_USE_GUISUPPORT
+
# If you are '''building VTK nightly''' via GIT, turn <span style="color:green">ON</span> the following option:
|ON
+
#*<span style="color:green">VTK_USE_QTCHARTS
|-
+
# <tt>Configure</tt>
|VTK_USE_QT
+
#*An error may appear about QT_QMAKE_EXECUTABLE not being found. Simply provide the path to qmake.exe (should be <QT root directory>/bin/qmake.exe)
|ON
+
# <tt>Generate</tt>
|-
+
# Go to the VTK binary folder and open the solution file ('''VTK.sln''').
|VTK_USE_QTCHARTS (only if you are building VTK nightly via GIT)
+
# Go to the file toolbar: Build->Batch Build  [[Image: batchbuildvxl.jpg|right|thumb|alt=alt text|Batch Build VTK]]
|ON
+
# Turn ON the following options under ALL_BUILD:
|-
+
#*Debug|x64
|VTK_USE_BOOST
+
#*Release|x64
|ON
+
#<tt>Build</tt>
|-
+
# As you wait, [http://xkcd.com/323/ take a nice long shower.]
|VTK_USE_SYSTEM_JPEG
+
|OFF  
+
|-
+
|VTK_USE_SYSTEM_TIFF
+
|OFF
+
|-
+
|VTK_USE_SYSTEM_ZLIB
+
|OFF
+
|}
+
 
+
Run configure, and then set the following additional options:
+
 
+
{|
+
|-
+
|Boost_INCLUDE_DIR
+
|/path/where/you/unpacked/boost
+
|-
+
|JPEG_INCLUDE_DIR
+
|/<vxl-src>/v3p/jpeg
+
|-
+
|JPEG_LIBRARY
+
|/<vxl-bin>/lib/libjpeg.*
+
|-
+
|TIFF_INCLUDE_DIR
+
|/<vxl-src>/v3p/tiff
+
|-
+
|TIFF_LIBRARY
+
|/<vxl-bin>/lib/libtiff.*
+
|-
+
|ZLIB_INCLUDE_DIR
+
|/<vxl-src>/v3p/zlib
+
|-
+
|ZLIB_LIBRARY
+
|/<vxl-bin>/lib/libzlib.*
+
|}
+
 
+
If CMake automatically finds libraries & include directories for JPEG, TIFF, or ZLIB, you shouldn't need to change them.
+
 
+
== Additional Libraries For Specific Modules  ==
+
 
+
Several libraries may be require to build individual modules.
+
 
+
=== FFTW ===
+
 
+
FFTW and FFTW3 need to be installed for curvletts
+
 
+
=== Install OpenGL header files ===
+
To compile vessel segmentation you will need openGL, glext.h, and GLUT.
+
Your platform probably comes with OpenGL.  On Windows with MSVC look in a path similar to this:
+
C:\Program Files (x86)\Microsoft Visual Studio 8 VC\PlatformSDK\Include\gl
+
You can download glext.h from here: [http://www.opengl.org/registry/ opengl.org].
+
 
+
Put glext.h in ../GL/ (where gl.h is).
+
 
+
You will need to get GLUT from here: [http://www.opengl.org/resources/libraries/glut/ download GLUT].
+
 
+
== Configure and Build FARSIGHT ==
+
 
+
 
+
Run CMake and set your desired modules to ON.  CMake will then tell you if you are missing any libraries.
+
Some modules need glut. Therefore, set the desired locations properly for:
+
GLUT_INCLUDE_DIR, (ex: C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include/gl)
+
and GLUT_glut_LIBRARY (ex: C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include/gl/glut32.lib)
+
  
FTKImage if it fails to build go to:
+
== Build FARSIGHT ==
*properties
+
**configuration properties
+
***C/C++  and under 'Additional options:' add "/bigobj:
+
  
*THE PACKAGE project does not build automatically, but can be selected and build.
+
# Run CMake.
**It requires some type of platform specific program for creating install packages.
+
# Specify the source folder and the binary folder.
***Build PACKAGE to create an install file of Farsight.
+
# <tt>Configure</tt>
 +
# Set your desired modules to ON.  CMake will then tell you if you are missing any libraries.
 +
#* Some modules need glut. Therefore, set the desired locations properly for:
 +
#**GLUT_INCLUDE_DIR, (ex: C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include/gl)
 +
#**and GLUT_glut_LIBRARY (ex: C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include/gl/glut32.lib)
 +
#* If FTKImage fails to build, go to:
 +
#**properties
 +
#***configuration properties
 +
#****C/C++  and under 'Additional options:' add "/bigobj:
 +
#*THE PACKAGE project does not build automatically, but can be selected and build.
 +
#**It requires some type of platform specific program for creating install packages.
 +
#***Build PACKAGE to create an install file of Farsight.
  
 
  Note: If running the executable results in the following error:  
 
  Note: If running the executable results in the following error:  
Line 251: Line 210:
  
 
==Checking the Quality Dashboard==
 
==Checking the Quality Dashboard==
When you start contributing code you can monitor if code and tests you build are compiling correctly on the dashboard machines here http://cdash.org/CDash/index.php?project=Farsight
+
When you start contributing code you can monitor if code and tests you build are compiling correctly on the dashboard machines here: http://cdash.org/CDash/index.php?project=Farsight
  
You can also submit an [[ Submitting_an_Experimental_Dashboard | experimental build ]] or set up [[ Setting_up_automated_builds | automated builds ]]
+
You can also submit an [[ Submitting_an_Experimental_Dashboard | experimental build ]] or set up [[ Setting_up_automated_builds | automated builds ]].

Revision as of 16:16, 31 August 2011

Contents

Starting a Fresh Developer's Build

When building FARSIGHT for the first time you will need to set up a development environment. FARSIGHT utilizes several large source libraries so ensure that you have at least 25 GiB of HDD space. For conformity purposes, save the FARSIGHT source code, QT, VXL, ITK, and VTK to C:\Lab (if possible). The following instructions will assume that the source codes will be saved in C:\Lab.


Choose a Compiler For Your OS

Popular choices are gcc/g++ on Linux, Microsoft Visual Studio 2008/2010 on Windows, and XCode* on Mac OS X.

*To install XCode/gcc on Mac OS X you may need to install the XCode development environment. This software should be available on your OS reinstall/recovery disk. At this time only XCode 3.2 is supported as CMake still does not generate appropriate project files for XCode 4

Install CMake

CMake is a tool which generates the makefiles under Linux, the Visual Studio Solution files (.sln) under Windows, or the XCode project files (.xcodeproj) under Mac OS X. It aims to allow developers to build their projects across different platforms with a minimum of reconfiguration.

Note: If you want to take advantage of multicore building in Visual Studio, you can append /MPn, where n is the number of processors you have. (ie. /MP16 for the Dell T5500 Workstations in the lab) to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS at each CMake configuration screen.

To check the number of processors your computer has, call up the command prompt, type "echo NUMBER_OF_PROCESSORS", and the next line will result in a number. Using a number greater than the number of processors you have will seriously slow down the computer.

Build or install Qt

  1. Build Qt from source. Download it from here: Windows Qt source code. Linux/Mac Qt source code.
  2. Extract the zip file to C:\Lab (or the directory of your choosing).
  3. If you want to take advantage of multicore building QT, simply open up <QT root directory>\mkspecs\win32-msvc2008\qmake.conf and add -MP<number of processors> to the end of QMAKE_CFLAGS
alt text
Multicore building QT (-MP16 represents 16 processors)

For Visual Studio 2008/2010:

  1. Go to Start->All Programs->Microsoft Visual Studio 2008->Visual Studio Tools->Visual Studio 2008 x64 Win64 Command Prompt
  2. cd to the directory where you unzipped the QT source (Auto-complete key: tab)
    alt text
    Go to the QT root directory in the Visual Studio 2008 x64 Win64 command prompt.
  3. Run "configure" (see figure below) (This should take about 5 minutes or more. Reading material as you wait.)
    Configure Configuring done, now nmake The command prompt should look like this after nmake completes.
  4. Run "nmake" Take a coffee break. This step will take at least 30 minutes.
    • If you made a mistake somewhere, you can start from scratch by typing "nmake confclean"

Download Boost

  1. Download the Boost C++ libraries from the Boost download page.
    • Make sure you download the actual source file and not the documentation (The documentation will have pdf in its name.)
  2. Unzip it to C:\Lab (or a directory of your choosing).

You do not need to compile it.

Download Git

http://git-scm.com/

Install Subversion

SVN is a version control system used to manage the source code.

TortoiseSVN x64 is a popular choice for Windows that integrates into the OS.

Additional source libraries require GIT

Download FARSIGHT source code

  1. Go to C:\Lab
  2. Right-click to view the folder menu.
  3. Click SVN Checkout and a window will pop up.

You can check out a copy of FARSIGHT from the following location:

NEW SVN Repository is located at:
https://farsight-svn.ee.uh.edu/repos/farsight/
SVN Checkout Farsight to the desired folder.
The old Repository is locked to changes as of 2/17/2011
svn://www.openworld.rpi.edu/repos/farsight 

The main line of development is in the "trunk" subdirectory. If you're not interested in downloading test data or branch versions, you can download only the source code by appending "/trunk" to the above path.

https://farsight-svn.ee.uh.edu/repos/farsight/trunk
TortoiseSVN

After all libraries and source codes have been downloaded, continue with the instructions below:

SuperBuild Instructions

Superbuild has been deprecated. Don't ask for it.

Manual Source Libraries Configuration

Build VXL

  1. Download the latest stable release of VXL from Vision-something-Libraries.
  2. Unzip the file to C:\Lab.
  3. Run CMake.
  4. Specify the source folder and binary folder.
  5. Configure
  6. Specify the generator for this project: Visual Studio 9 2008 Win64
  7. (optional) For speed optimization in Visual Studio, append -MP<number of processors> to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as shown in the figure to the right.
    Multicore building VXL
  8. Turn the following options OFF:
    • BUILD_BRL
    • BUILD_CONVERSIONS
    • BUILD_EXAMPLES
    • BUILD_GEL
    • BUILD_OUL
    • BUILD_OXL
    • BUILD_PRIP
    • BUILD_TBL
    • BUILD_TESTING
      CMake VXL
  9. Turn the following options ON:
    • BUILD_RPL_RGTL
  10. Click configure and then turn the following option ON:
    • BUILD_RPL_RTVL (will show up in pink)
  11. Configure again and then Generate
  12. Go to the VXL binary folder and open the solution file (vxl.sln).
  13. Go to the main menu bar: Build->Batch Build
  14. Turn ON the following options under ALL_BUILD:
    • Debug|x64
    • Release|x64
      Batch Build VXL
  15. Build
  16. As you wait, play some Starcraft 2.

Build ITKv4

Download ITKv4 by going to: (Start -> Git Bash in search box). Then type the following lines:

cd /c/Lab

git clone git://itk.org/ITK.git
cd ITK
git checkout v4.0a09
git submodule update
ITK
  1. Run CMake.
  2. Specify the source folder and binary folder.
  3. Configure
  4. Specify the generator for this project: Visual Studio 9 2008 Win64
  5. An error will show up in the CMake log complaining about BUILD_TESTING being on.
  6. (optional) For speed optimization in Visual Studio, append -MP<number of processors> to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as shown in the figure to the right.
    alt text
    Multicore building ITKv4. Make sure you change the number according to the number of processors you have! (ie. /MP8)
  7. Turn OFF the following:
    • BUILD_TESTING
    • BUILD_EXAMPLES
  8. Configure again.
  9. Turn ON the following:
    • ITKGroup_* or ITK_BUILD_ALL_MODULES
    • ITK_USE_64BITS_IDS
    • ITK_USE_REVIEW
      • Do NOT turn on ITK_USE_SYSTEM_VXL as documented in the old FARSIGHT_HowToBuild guide
  10. Configure again and then Generate
  11. Go to the ITK binary folder and open the solution file (ITK.sln).
  12. Go to the file toolbar: Build->Batch Build
    alt text
    Batch Build ITK
  13. Turn ON the following options under ALL_BUILD:
    • Debug|x64
    • Release|x64
  14. Build
  15. As you wait, poke your neighbor.


CMakeList files may need to be edited to use ${ITK_LIBRARIES} instead of ITKCommon, ITKIO, ITKBasicFilter.... etc, otherwise you will get errors like "Cannot open file: ITKCommon.lib"

See FARSIGHT_Tutorials/Building_Software if you'd like to enable Python wrapping for ITK.

Build VTK

  1. Download the source code from the VTK download page
    • (Alternatively, you can access the latest development version of VTK using git. This will allow you to use some additional Qt views in FARSIGHT, but the git version of VTK is less stable than the latest release. Instructions on how to access the VTK git repository are on the same VTK download page linked above.)
    • If you want to run TraceEditor, you MUST build the VTK nightly via GIT. .
  2. Create a VTK folder in C:\Lab and extract the VTK zip file into it.
  3. Run CMake.
  4. Specify the source folder and the binary folder.
  5. Configure
  6. Specify the generator for this project: Visual Studio 9 2008 Win64
  7. (optional) For speed optimization in Visual Studio, append -MP<number of processors> to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as shown in the figure to the right.
    Multicore building VTK
  8. Turn OFF the following options:
    • BUILD_DOCUMENTATION
    • BUILD_EXAMPLES
    • BUILD_SHARED_LIBS
    • BUILD_TESTING
  9. Turn ON the following options:
    • VTK_USE_BOOST
    • VTK_USE_GUISUPPORT
    • VTK_USE_QT
  10. Configure
  11. If you are building VTK nightly via GIT, turn ON the following option:
    • VTK_USE_QTCHARTS
  12. Configure
    • An error may appear about QT_QMAKE_EXECUTABLE not being found. Simply provide the path to qmake.exe (should be <QT root directory>/bin/qmake.exe)
  13. Generate
  14. Go to the VTK binary folder and open the solution file (VTK.sln).
  15. Go to the file toolbar: Build->Batch Build
    alt text
    Batch Build VTK
  16. Turn ON the following options under ALL_BUILD:
    • Debug|x64
    • Release|x64
  17. Build
  18. As you wait, take a nice long shower.

Build FARSIGHT

  1. Run CMake.
  2. Specify the source folder and the binary folder.
  3. Configure
  4. Set your desired modules to ON. CMake will then tell you if you are missing any libraries.
    • Some modules need glut. Therefore, set the desired locations properly for:
      • GLUT_INCLUDE_DIR, (ex: C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include/gl)
      • and GLUT_glut_LIBRARY (ex: C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include/gl/glut32.lib)
    • If FTKImage fails to build, go to:
      • properties
        • configuration properties
          • C/C++ and under 'Additional options:' add "/bigobj:
    • THE PACKAGE project does not build automatically, but can be selected and build.
      • It requires some type of platform specific program for creating install packages.
        • Build PACKAGE to create an install file of Farsight.
Note: If running the executable results in the following error: 
"QtGui4.dll was not found"
you may need to add the QT bin directory to the system path on your OS.

Checking the Quality Dashboard

When you start contributing code you can monitor if code and tests you build are compiling correctly on the dashboard machines here: http://cdash.org/CDash/index.php?project=Farsight

You can also submit an experimental build or set up automated builds .

Personal tools