FARSIGHT HowToBuild
(→Build VXL) |
(→Download FARSIGHT source code) |
||
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. | |
The old Repository is locked to changes as of 2/17/2011 | The old Repository is locked to changes as of 2/17/2011 |
Revision as of 16:19, 25 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 15gb of HDD space. The toolkit has a SuperBuild option that automatically fetches, configures and installs the several source packages.
If you are new to the project please see the Developers Tools page for general information.
For help on running Farsight see the Tutorial Page
Choose a Compiler For Your OS
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
CMake is used to configure FARSIGHT to be built Cross Platform with most major compilers.
See Installing CMake
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
Build or install Qt
Download a version of Qt for your platform from the Qt download page.
If you are using Visual Studio on Windows you'll have to build Qt from source. Download it from here: Qt source code.
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
In order to compile it with VC++:
- Check which version of Visual Studio you are using.
- Open a Visual Studio command prompt(32 bits or 64 bits).
In the command prompt enter in the following commands:
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 the Boost C++ libraries from the Boost download page. Unpack it to a directory of your choosing. You don't need to compile it.
Install Subversion
SVN is a version control system used to manage the source code.
TortoiseSVNIs 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/
The Trunk has already merged to ITK V4 and you will need to configure the build accordingly.
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.
With the code downloaded the build can continue with one of the following options:
SuperBuild Instructions
The Superbuild automates the downloading, configuring and linking of the source libraries. For new users this is recommended.
- Configure CMake
- 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.
- Configure and Generate the SuperBuild project.
- 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
The Use of the SuperBuild CMakesList will complete all of the following for you.
Build VXL
Download the latest stable release of VXL from Vision-something-Libraries
Run CMake and 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
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
#if defined(VCL_WIN32) && VXL_USE_WIN_WCHAR_T //line 120
to
#if defined(VCL_WIN32) #if defined (VXL_USE_WIN_WCHAR_T)
Remember to include the
#endif //line 211
Build ITK
We have migrated to ITKv4. Check the migration guide for details.
For ITKv3 follow the instructions below:
Download the source code from the Insight Segmentation & Registration Toolkit
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 this bug report.
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.
Run CMake, select Grouped and Advanced to set the following options:
BUILD_DOCUMENTATION | OFF |
BUILD_EXAMPLES | OFF |
BUILD_SHARED_LIBS | OFF |
BUILD_TESTING | OFF |
VTK_USE_GUISUPPORT | ON |
VTK_USE_QT | ON |
VTK_USE_QTCHARTS (only if you are building VTK nightly via GIT) | ON |
VTK_USE_BOOST | ON |
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: opengl.org.
Put glext.h in ../GL/ (where gl.h is).
You will need to get GLUT from here: 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:
- 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