Difference between revisions of "Documentation/4.1/Developers/Build Instructions/Configure"

From Slicer Wiki
Jump to: navigation, search
(Created page with '== CONFIGURE and generate Slicer solution files == You can configure and generate Slicer solution files using either <code>ccmake</code> or <code>cmake-gui</code>. === Per-platf…')
 
(Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
<noinclude>{{documentation/versioncheck}}</noinclude>
 
== CONFIGURE and generate Slicer solution files ==
 
== CONFIGURE and generate Slicer solution files ==
 
You can configure and generate Slicer solution files using either <code>ccmake</code> or <code>cmake-gui</code>.
 
You can configure and generate Slicer solution files using either <code>ccmake</code> or <code>cmake-gui</code>.
Line 6: Line 7:
 
*'''Recommended''': <code>cmake-gui</code>
 
*'''Recommended''': <code>cmake-gui</code>
 
** Configure using default options.
 
** Configure using default options.
 +
** Set the build directory. For example: <code>C:\Slicer4-SuperBuild-Debug</code> or <code>C:\Slicer4-SuperBuild-Release</code>
 
* '''Remarks''':
 
* '''Remarks''':
 
#If you downloaded the Qt binary then <code>qmake</code> will be detected and all paths will be set automatically.   
 
#If you downloaded the Qt binary then <code>qmake</code> will be detected and all paths will be set automatically.   
#If you built your own Qt (e.g. in Debug mode for use with the designer) set the <code>QT_QMAKE_EXECUTABLE</code> in <code>cmake-gui</code>.<code>QT_QMAKE_EXECUTABLE</code> should be set to the path of the qmake.exe file, which is inside the bin directory (for example, <code>/path/to/qt-everywhere-opensource-build-4.7.4/bin/qmake.exe</code>).  
+
#If you built your own Qt (e.g. in Debug mode for use with the designer) set the <code>QT_QMAKE_EXECUTABLE</code> in <code>cmake-gui</code>.<code>QT_QMAKE_EXECUTABLE</code> should be set to the path of the qmake.exe file, which is inside the bin directory (for example, <code>\path\to\qt-everywhere-opensource-build-4.7.4\bin\qmake.exe</code>).  
 
#Windows doesn't support path longer than 260 characters, please make sure that the total path name of your <code>Slicer-build</code> directory is no longer than 50 characters ( for example <code>c:\work\Slicer\Slicer-Superbuild</code> (32 characters) is fine)
 
#Windows doesn't support path longer than 260 characters, please make sure that the total path name of your <code>Slicer-build</code> directory is no longer than 50 characters ( for example <code>c:\work\Slicer\Slicer-Superbuild</code> (32 characters) is fine)
  
Line 19: Line 21:
 
ccmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/path/to/QtSDK-1.2/Desktop/Qt/474/gcc/bin/qmake ../Slicer
 
ccmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/path/to/QtSDK-1.2/Desktop/Qt/474/gcc/bin/qmake ../Slicer
 
</pre>
 
</pre>
 +
where you replace ''/path/to'' with the real path on your machine where QtSDK-1.2 is located
 
* '''Remarks''':
 
* '''Remarks''':
 
# Using top-level directory name like <code>Slicer-Superbuild-Release</code> or <code>Slicer-Superbuild-Debug</code> is recommended.
 
# Using top-level directory name like <code>Slicer-Superbuild-Release</code> or <code>Slicer-Superbuild-Debug</code> is recommended.
Line 32: Line 35:
 
# The first project in <code>Slicer4-Superbuild</code> manages all the external dependencies of Slicer (VTK, ITK, Python, ...). To build Slicer for the first time, run make (or build the solution file in Visual Studio) in <code>Slicer4-Superbuild</code>, which will update and build the external libraries and if successful will then build the subproject Slicer-build.<br>
 
# The first project in <code>Slicer4-Superbuild</code> manages all the external dependencies of Slicer (VTK, ITK, Python, ...). To build Slicer for the first time, run make (or build the solution file in Visual Studio) in <code>Slicer4-Superbuild</code>, which will update and build the external libraries and if successful will then build the subproject Slicer-build.<br>
 
# The second project in <code>Slicer4-Superbuild/Slicer-build</code> is the "traditional" build directory of Slicer.  After local changes in Slicer (or after an svn update on the source directory of Slicer), only running make (or building the solution file in Visual Studio) in <code>Slicer4-Superbuild/Slicer-build</code> is necessary (the external libraries are considered built and up to date). <br>
 
# The second project in <code>Slicer4-Superbuild/Slicer-build</code> is the "traditional" build directory of Slicer.  After local changes in Slicer (or after an svn update on the source directory of Slicer), only running make (or building the solution file in Visual Studio) in <code>Slicer4-Superbuild/Slicer-build</code> is necessary (the external libraries are considered built and up to date). <br>
#'''Warning''': An important amount of disk space is required to compile Slicer in Debug (>10GB on Windows)
+
#'''Warning''': An significant amount of disk space is required to compile Slicer in Debug (>10GB on Windows)
  
 
=== Workaround firewall blocking git protocol ===
 
=== Workaround firewall blocking git protocol ===

Latest revision as of 07:30, 14 June 2013

Home < Documentation < 4.1 < Developers < Build Instructions < Configure


For the latest Slicer documentation, visit the read-the-docs.


CONFIGURE and generate Slicer solution files

You can configure and generate Slicer solution files using either ccmake or cmake-gui.

Per-platform instructions

Windows

  • Recommended: cmake-gui
    • Configure using default options.
    • Set the build directory. For example: C:\Slicer4-SuperBuild-Debug or C:\Slicer4-SuperBuild-Release
  • Remarks:
  1. If you downloaded the Qt binary then qmake will be detected and all paths will be set automatically.
  2. If you built your own Qt (e.g. in Debug mode for use with the designer) set the QT_QMAKE_EXECUTABLE in cmake-gui.QT_QMAKE_EXECUTABLE should be set to the path of the qmake.exe file, which is inside the bin directory (for example, \path\to\qt-everywhere-opensource-build-4.7.4\bin\qmake.exe).
  3. Windows doesn't support path longer than 260 characters, please make sure that the total path name of your Slicer-build directory is no longer than 50 characters ( for example c:\work\Slicer\Slicer-Superbuild (32 characters) is fine)

Unix-like

  • Recommended: ccmake
    • Configure using the following commands. By default CMAKE_BUILD_TYPE is set to Debug.
mkdir Slicer4-SuperBuild-Debug
cd Slicer4-SuperBuild-Debug
ccmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/path/to/QtSDK-1.2/Desktop/Qt/474/gcc/bin/qmake ../Slicer

where you replace /path/to with the real path on your machine where QtSDK-1.2 is located

  • Remarks:
  1. Using top-level directory name like Slicer-Superbuild-Release or Slicer-Superbuild-Debug is recommended.

General information

Two projects are generated by either cmake, ccmake or cmake-gui.

One of them is in the top-level bin directory Slicer4-Superbuild and the other one is in the subdirectory Slicer-build:

Slicer4-Superbuild/Slicer-build
  1. The first project in Slicer4-Superbuild manages all the external dependencies of Slicer (VTK, ITK, Python, ...). To build Slicer for the first time, run make (or build the solution file in Visual Studio) in Slicer4-Superbuild, which will update and build the external libraries and if successful will then build the subproject Slicer-build.
  2. The second project in Slicer4-Superbuild/Slicer-build is the "traditional" build directory of Slicer. After local changes in Slicer (or after an svn update on the source directory of Slicer), only running make (or building the solution file in Visual Studio) in Slicer4-Superbuild/Slicer-build is necessary (the external libraries are considered built and up to date).
  3. Warning: An significant amount of disk space is required to compile Slicer in Debug (>10GB on Windows)

Workaround firewall blocking git protocol

  • Some firewall will be blocking the git protocol, a possible workaround is to configure Slicer disabling the option Slicer_USE_GIT_PROTOCOL. Then http protocol will be used instead. Consider also reading https://github.com/commontk/CTK/issues/33

Notes for advanced users

  • By default, if CMake finds Java on your machine, it automatically builds Java CLIs. If you don't want any Java in your Slicer (or if you don't want to install Java on your Mac Os X), you can pass -DCMAKE_DISABLE_FIND_PACKAGE_Java:BOOL=TRUE when configuring Slicer.
  • Same applies for OpenSSL: CMAKE_DISABLE_FIND_PACKAGE_OpenSSL:BOOL=TRUE can be passed when building Slicer for packaging.