Difference between revisions of "Documentation/Nightly/Developers/FAQ/Building"

From Slicer Wiki
Jump to: navigation, search
m (Created page with '<noinclude>{{documentation/versioncheck}}</noinclude> <noinclude>__TOC__ ={{#titleparts: {{PAGENAME}} | | -1 }}=</noinclude><includeonly> ='''Developer FAQ: {{{1}}}'''= </include…')
 
Tag: 2017 source edit
 
(19 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
='''Developer FAQ: {{{1}}}'''=
 
='''Developer FAQ: {{{1}}}'''=
 
</includeonly>
 
</includeonly>
 +
 +
 +
== How is organized the Slicer build tree ? ==
 +
 +
The Slicer build tree has two levels:
 +
* <code>~/Projects/Slicer-SuperBuild</code>
 +
* <code>~/Projects/Slicer-SuperBuild/Slicer-build</code>
 +
 +
The first level ''manages'' all the external dependencies of Slicer (VTK, ITK, Python, ...). The second level is the "traditional" build directory of Slicer.
 +
 +
See [[Documentation/{{documentation/version}}/Developers/DirectoryStructure|Slicer directory structure]]
 +
 +
== What is a clean build ? ==
 +
 +
Doing a ''clean build'' means that
 +
 +
(1) all directories and files in the top-level build directory <code>~/Projects/Slicer-SuperBuild</code> are removed.
 +
 +
and
 +
 +
(2) you updated your source checkout and have no locally modified files.
  
 
== What to do if QtSDK installer hangs ? ==
 
== What to do if QtSDK installer hangs ? ==
  
 
If QtSDK installer hangs, use <code>-style cleanlooks</code> command line option. For details, see [http://http://qt-project.org/forums/viewthread/17040/#85212 here].
 
If QtSDK installer hangs, use <code>-style cleanlooks</code> command line option. For details, see [http://http://qt-project.org/forums/viewthread/17040/#85212 here].
 +
 +
== Which minimum version of GLIBC is needed to build Slicer ? ==
 +
 +
The minimum version of GLIBC required to build Slicer is defined by the minimum version required by the pre-compiler binaries used when building Slicer. In our case, a small pre-compiled executable called the [http://www.commontk.org/index.php/Tools:_Application_launcher#What_is_CTK_Application_Launcher_.3F CTK AppLauncher] is [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_CTKAPPLAUNCHER.cmake downloaded] and used at configure and build time each time python has to be invoked.
 +
 +
The precompiled CTKAppLauncher imposes the following requirements regarding GLIBC and GLIBCXX libraries installed on your system:
 +
 +
<pre>
 +
$ strings CTKAppLauncher | ack GLIBC
 +
GLIBC_2.2.5
 +
GLIBCXX_3.4.11
 +
GLIBCXX_3.4.9
 +
GLIBCXX_3.4
 +
GLIBC_2.3.3
 +
GLIBC_2.3.2
 +
GLIBC_2.4
 +
GLIBC_2.3
 +
</pre>
 +
 +
 +
To check that your system provides the required GLIBCXX and GLIB versions, you could run the following command and check that the requirement of the launcher can be satisfied:
 +
 +
<pre>
 +
$ strings /usr/lib/libstdc++.so.6 | grep GLIBCXX
 +
GLIBCXX_3.4
 +
GLIBCXX_3.4.1
 +
GLIBCXX_3.4.2
 +
GLIBCXX_3.4.3
 +
GLIBCXX_3.4.4
 +
GLIBCXX_3.4.5
 +
GLIBCXX_3.4.6
 +
GLIBCXX_3.4.7
 +
GLIBCXX_3.4.8
 +
GLIBCXX_3.4.9
 +
GLIBCXX_3.4.10
 +
GLIBCXX_3.4.11
 +
GLIBCXX_3.4.12
 +
GLIBCXX_3.4.13
 +
GLIBCXX_3.4.14
 +
GLIBCXX_3.4.15
 +
GLIBCXX_3.4.16
 +
GLIBCXX_3.4.17
 +
</pre>
 +
 +
<pre>
 +
$ strings /lib/libc.so.6 | grep GLIBC
 +
GLIBC_2.2.5
 +
GLIBC_2.2.6
 +
GLIBC_2.3
 +
GLIBC_2.3.2
 +
GLIBC_2.3.3
 +
GLIBC_2.3.4
 +
GLIBC_2.4
 +
GLIBC_2.5
 +
GLIBC_2.6
 +
GLIBC_2.7
 +
GLIBC_2.8
 +
GLIBC_2.9
 +
GLIBC_2.10
 +
GLIBC_2.11
 +
</pre>
 +
 +
== What to do if Visual Studio compiler crashes ? ==
 +
 +
If the compiler crashes on Windows saying "Microsoft C/C++ Compiler Driver has stopped working", then it's most probably due to long build folder paths. To fix this the Slicer build directory should be moved and/or renamed. A typical build folder path is C:\S4D
 +
 +
== How to build Slicer with SSL support ? ==
 +
 +
To build Slicer with SSL support, you need to build (or download) Qt with SSL support and configure Slicer with <code>-DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=ON</code>
 +
 +
== Why Qt 4 >= 4.8.5 should be used on Ubuntu 12.04 and above ? ==
 +
 +
See Slicer issue [http://www.na-mic.org/Bug/view.php?id=3325 #3325]
 +
 +
== Why distributed CMake can not be used on Ubuntu 12.04 and above ? ==
 +
 +
* http://slicer-devel.65872.n3.nabble.com/PYTHON-INCLUDE-DIR2-when-building-Slicer4-td4028557.html
 +
* Slicer issue [http://na-mic.org/Mantis/view.php?id=3103 #3103]
 +
* Slicer issue  [http://na-mic.org/Mantis/view.php?id=3116#c8649 #3116]
 +
* CMake issue [http://public.kitware.com/Bug/view.php?id=14156 #14156]
 +
 +
== What is the ITKFactoryRegistration library ? ==
 +
 +
The <tt>ITKFactoryRegistration</tt> library ensures that no duplicated ITK IO factories are registered when CLI shared library modules are loaded. See [https://issues.slicer.org/view.php?id=2813 Slicer issue #2813]
 +
 +
Indeed, when ITKv4 is build shared, the library holding the factory registration code are build statically. As a consequence, when CLI modules are loaded as library the factory are registered multiple times. More than 800 factories were registered and this was leading to poor performance when loading images.
 +
 +
The introduction of a shared library named <tt>ITKFactoryRegistration</tt> (see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=21592 r21592]) that should be linked against to ensure loading of the factories is performed once. This approach requires user of ITK libraries to explicitly set the ITK variable <tt>ITK_NO_IO_FACTORY_REGISTER_MANAGER</tt> to <tt>1</tt> before calling <tt>include(${ITK_USE_FILE})</tt>.
 +
 +
Notes:
 +
* Since calling <tt>include(${Slicer_USE_FILE})</tt> already set <tt>ITK_NO_IO_FACTORY_REGISTER_MANAGER</tt> in the current scope, explicitly setting the variable afterward is not required.
 +
 +
== How to configure network proxy ? ==
 +
 +
As explained [http://cmake.3232098.n2.nabble.com/set-proxy-with-cmake-file-download-td4715827.html#a4752250 here], proxy configured by setting <tt>http_proxy</tt> and <tt>https_proxy</tt> environment variables will automatically be used by CMake.

Latest revision as of 06:00, 5 May 2020

Home < Documentation < Nightly < Developers < FAQ < Building


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


Building

How is organized the Slicer build tree ?

The Slicer build tree has two levels:

  • ~/Projects/Slicer-SuperBuild
  • ~/Projects/Slicer-SuperBuild/Slicer-build

The first level manages all the external dependencies of Slicer (VTK, ITK, Python, ...). The second level is the "traditional" build directory of Slicer.

See Slicer directory structure

What is a clean build ?

Doing a clean build means that

(1) all directories and files in the top-level build directory ~/Projects/Slicer-SuperBuild are removed.

and

(2) you updated your source checkout and have no locally modified files.

What to do if QtSDK installer hangs ?

If QtSDK installer hangs, use -style cleanlooks command line option. For details, see here.

Which minimum version of GLIBC is needed to build Slicer ?

The minimum version of GLIBC required to build Slicer is defined by the minimum version required by the pre-compiler binaries used when building Slicer. In our case, a small pre-compiled executable called the CTK AppLauncher is downloaded and used at configure and build time each time python has to be invoked.

The precompiled CTKAppLauncher imposes the following requirements regarding GLIBC and GLIBCXX libraries installed on your system:

$ strings CTKAppLauncher | ack GLIBC
GLIBC_2.2.5
GLIBCXX_3.4.11
GLIBCXX_3.4.9
GLIBCXX_3.4
GLIBC_2.3.3
GLIBC_2.3.2
GLIBC_2.4
GLIBC_2.3


To check that your system provides the required GLIBCXX and GLIB versions, you could run the following command and check that the requirement of the launcher can be satisfied:

$ strings /usr/lib/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
$ strings /lib/libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11

What to do if Visual Studio compiler crashes ?

If the compiler crashes on Windows saying "Microsoft C/C++ Compiler Driver has stopped working", then it's most probably due to long build folder paths. To fix this the Slicer build directory should be moved and/or renamed. A typical build folder path is C:\S4D

How to build Slicer with SSL support ?

To build Slicer with SSL support, you need to build (or download) Qt with SSL support and configure Slicer with -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=ON

Why Qt 4 >= 4.8.5 should be used on Ubuntu 12.04 and above ?

See Slicer issue #3325

Why distributed CMake can not be used on Ubuntu 12.04 and above ?

What is the ITKFactoryRegistration library ?

The ITKFactoryRegistration library ensures that no duplicated ITK IO factories are registered when CLI shared library modules are loaded. See Slicer issue #2813

Indeed, when ITKv4 is build shared, the library holding the factory registration code are build statically. As a consequence, when CLI modules are loaded as library the factory are registered multiple times. More than 800 factories were registered and this was leading to poor performance when loading images.

The introduction of a shared library named ITKFactoryRegistration (see r21592) that should be linked against to ensure loading of the factories is performed once. This approach requires user of ITK libraries to explicitly set the ITK variable ITK_NO_IO_FACTORY_REGISTER_MANAGER to 1 before calling include(${ITK_USE_FILE}).

Notes:

  • Since calling include(${Slicer_USE_FILE}) already set ITK_NO_IO_FACTORY_REGISTER_MANAGER in the current scope, explicitly setting the variable afterward is not required.

How to configure network proxy ?

As explained here, proxy configured by setting http_proxy and https_proxy environment variables will automatically be used by CMake.