ManualBuild

From FarsightWiki
(Difference between revisions)
Jump to: navigation, search
(Build or install Qt)
Line 1: Line 1:
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.
+
For conformity purposes, save the FARSIGHT source code, QT, VXL, ITK, and VTK to C:\Lab\src (if possible).  The following instructions will assume that the source codes will be saved in C:\Lab\src.
  
 
=== Build or install Qt ===
 
=== Build or install Qt ===
  
 
# Build Qt from source.  Download it from here: [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip Windows Qt source code]. [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz Linux/Mac Qt source code].
 
# Build Qt from source.  Download it from here: [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.zip Windows Qt source code]. [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz Linux/Mac Qt source code].
# Extract the zip file to C:\Lab (or the directory of your choosing).
+
# Extract the zip file to C:\Lab\src (or the directory of your choosing).
  
 
For Visual Studio 2008/2010:
 
For Visual Studio 2008/2010:
Line 18: Line 18:
 
# Download the Boost C++ libraries from [http://sourceforge.net/projects/boost/files/boost/1.47.0/ the Boost download page].   
 
# 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]]]
 
#*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).   
+
# Unzip it to C:\Lab\src (or a directory of your choosing).   
  
 
You '''do not''' need to compile it.
 
You '''do not''' need to compile it.
Line 35: Line 35:
  
 
# 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]]]
 
# 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.
+
# Unzip the file to C:\Lab\src.
 
# Run CMake.
 
# Run CMake.
 
# Specify the source folder and binary folder.
 
# Specify the source folder and binary folder.
Line 69: Line 69:
 
Download ITKv4 by going to: (Start -> Git Bash in search box). Then type the following lines:
 
Download ITKv4 by going to: (Start -> Git Bash in search box). Then type the following lines:
  
  ''cd /c/Lab''
+
  ''cd /c/Lab/src''
 
   
 
   
 
  ''git clone git://itk.org/ITK.git''
 
  ''git clone git://itk.org/ITK.git''
Line 112: Line 112:
 
#*(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]]].  
 
#*<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.
+
# Create a VTK folder in C:\Lab\src and extract the VTK zip file into it.
 
# Run CMake.
 
# Run CMake.
 
# Specify the source folder and the binary folder.
 
# Specify the source folder and the binary folder.

Revision as of 16:33, 24 October 2011

For conformity purposes, save the FARSIGHT source code, QT, VXL, ITK, and VTK to C:\Lab\src (if possible). The following instructions will assume that the source codes will be saved in C:\Lab\src.

Contents

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\src (or the directory of your choosing).

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 -mp" (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\src (or a directory of your choosing).

You do not need to compile it.

Download Git

  1. Download [Git].
  2. When it ask for "Adjusting your PATH environment: How would you like to use Git from the command line", select: Run Git from the Windows Command Prompt.
  3. When it ask for "Configuring the line ending conversions: How should Git treat line endings in text files", select: Checkout Windows-style, commit Unix-style line endings.
Make sure the 2nd option is selected.Make sure the 1st option is selected.

Source Libraries Configuration

Build VXL

  1. Download the latest stable release of VXL from Vision-something-Libraries.
  2. Unzip the file to C:\Lab\src.
  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
    • VXL_FORCE_V3P_PNG (Mac ONLY)
  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/src

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\src 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. The git version may have a CMAKE_CXX_MP_FLAG, in which case just check that and add your number of processors to CMAKE_CXX_MP_NUM_PROCESSORS.
    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.
Personal tools