HowToBuild
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.
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
- Build Qt from source. Download it from here: Windows Qt source code. Linux/Mac Qt source code.
- Extract the zip file to 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 -MP16 to the end of QMAKE_CFLAGS
For Visual Studio 2008/2010:
- Go to Start->All Programs->Microsoft Visual Studio 2008->Visual Studio Tools->Visual Studio 2008 x64 Win64 Command Prompt
- cd to the directory where you unzipped the QT source (Shortcut key: tab)
- Run "configure" (see figure below) (This should take about 5 minutes or more. Reading material as you wait.)
- 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
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.)
Unzip it to a directory of your choosing.
You do not need to compile it.
Install Subversion
SVN is a version control system used to manage the source code.
TortoiseSVN x64Is a popular choice for Windows that integrates into the OS.
Use SilkSVN for the SuperBuild.
Additional source libraries require GIT
Download FARSIGHT source code
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/
For all new users, it is recommended that you checkout branches/ITKv4Merge as we are on the verge of merging ITKv4Merge into trunk and want all new development to happen in that branch in the meantime.
The old Repository is locked to changes as of 2/17/2011 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.
https://farsight-svn.ee.uh.edu/repos/farsight/ /trunk
After all libraries and source codes have been downloaded, continue with the instructions below:
SuperBuild Instructions
Superbuild has been deprecated.
Manual Source Libraries Configuration
Build VXL
- Download the latest stable release of VXL from Vision-something-Libraries.
- Unzip the file.
- Run CMake.
- Specify the source folder and binary folder.
- Configure
- Specify the generator for this project: Visual Studio 9 2008 Win64
- (optional) For speed optimization in Visual Studio, append /MP16 to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as shown in the figure to the right.
- Turn the following options OFF:
- BUILD_BRL
- BUILD_CONVERSIONS
- BUILD_EXAMPLES
- BUILD_GEL
- BUILD_OUL
- BUILD_OXL
- BUILD_PRIP
- BUILD_TBL
- BUILD_TESTING
- Turn the following options ON:
- BUILD_RPL_RGTL
- Click configure and then turn the following option ON:
- BUILD_RPL_RTVL (will show up in pink)
- Configure again and then Generate
- 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
- Build
- As you wait, play some Starcraft 2.
Build ITKv4
Windows 7:
If you want ITK to be saved in C:\Lab\
In Git Bash shell (Start -> Git Bash in search box)
Replace "/c/Lab" with your desired directory.
cd /c/Lab
To checkout v4.0a7:
git clone git://itk.org/ITK.git cd ITK git checkout v4.0a09 git submodule update
- Configure
- Specify the generator for this project: Visual Studio 9 2008 Win64
- An error will show up in the CMake log complaining about BUILD_TESTING being on.
- (optional) For speed optimization in Visual Studio, append /MP16 to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as shown in the figure to the right.
- Turn OFF the following:
- BUILD_TESTING
- BUILD_EXAMPLES
- Configure again.
- 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
- Configure again and then Generate
- Go to the ITK binary folder and open the solution file (ITK.sln).
- Go to the file toolbar: Build->Batch Build
- Turn ON the following options under ALL_BUILD:
- Debug|x64
- Release|x64
- Build
- 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
- 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.)
- Create a VTK folder and extract the VTK zip file into it.
- Run CMake.
- Configure
- Specify the generator for this project: Visual Studio 9 2008 Win64
- (optional) For speed optimization in Visual Studio, append /MP16 to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS as shown in the figure to the right.
- Turn OFF the following options:
- BUILD_DOCUMENTATION
- BUILD_EXAMPLES
- BUILD_SHARED_LIBS
- BUILD_TESTING
- Turn ON the following options:
- VTK_USE_BOOST
- VTK_USE_GUISUPPORT
- VTK_USE_QT
- VTK_USE_QTCHARTS (only if you are building VTK nightly via GIT)
- 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)
- Generate
- Go to the VTK binary folder and open the solution file (VTK.sln).
- Go to the file toolbar: Build->Batch Build
- Turn ON the following options under ALL_BUILD:
- Debug|x64
- Release|x64
- Build
- As you wait, take a nice long shower. Then brush your teeth.
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)
If FTKImage fails to build, go to:
- properties
- configuration properties
- C/C++ and under 'Additional options:' add "/bigobj:
- configuration properties
- 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.
- It requires some type of platform specific program for creating install packages.
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 .