Difference between revisions of "Documentation/Nightly/Developers/Build Instructions/Compile"

From Slicer Wiki
Jump to: navigation, search
Tag: 2017 source edit
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
<noinclude>{{documentation/versioncheck}}</noinclude>
 
<noinclude>{{documentation/versioncheck}}</noinclude>
== BUILD Slicer ==
+
==BUILD Slicer==
<ol style="list-style-type:none; border-left:thick solid red; padding-left:1em;">
 
  <li>While it is not enforced, we strongly recommend you to '''AVOID''' the use of '''SPACES''' for both the <code>source directory</code> and the <code>build directory</code>. We mean it.
 
  </li>
 
</ol>
 
  
 
After configuration, start the build process in the  <code>Slicer-SuperBuild</code> directory
 
After configuration, start the build process in the  <code>Slicer-SuperBuild</code> directory
  
{|width = "100%"
+
{| width="100%"
! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Linux or MacOSX (Makefile)
+
! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;" |Linux or MacOSX (Makefile)
! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;"| Windows (Visual Studio)
+
! width="50%" style="border-bottom: 1px solid darkgrey;font-size: 75%;" |Windows (Visual Studio)
 
|-
 
|-
 
| valign="top" |
 
| valign="top" |
Line 18: Line 14:
  
 
$ make -j<NUMBEROFCORES>}}
 
$ make -j<NUMBEROFCORES>}}
 +
 +
In case of file download hash mismatch error, you need to acquire the latest wget, and build cmake with OpenSSL turned on. For more information, see [http://slicer-devel.65872.n3.nabble.com/How-to-solve-wget-error-certificate-common-name-c-ssl-fastly-net-doesn-t-match-requested-host-name-p-td4031491.html here] and [http://slicer-devel.65872.n3.nabble.com/Re-Hash-Error-td4031386.html here]
 +
 +
When using the -j option, the build will continue past the source of the first error.  If the build fails and you don't see what failed, rebuild without the -j option.  Or, to speed up this process build first with the -j and -k options and then run plain make.  The -k option will make the build keep going so that any code that can be compiled independent of the error will be completed and the second make will reach the error condition more efficiently.
 +
 
| valign="top" |
 
| valign="top" |
 
Start Windows Explorer. [http://www.wikihow.com/Open-Windows-Explorer Need help?]
 
Start Windows Explorer. [http://www.wikihow.com/Open-Windows-Explorer Need help?]
 
<ol start="1" style="list-style-type: decimal;">
 
<ol start="1" style="list-style-type: decimal;">
 
<li>Open <code>Slicer-SuperBuild\Slicer.sln</code> in Visual Studio</li>
 
<li>Open <code>Slicer-SuperBuild\Slicer.sln</code> in Visual Studio</li>
<li>Select build configuration. Usually '''Release''' of '''Debug'''</li>
+
<li>Select build configuration. Usually '''Release''' or '''Debug'''</li>
 
<li>Select menu <code>Project -> Build Solution</code></li>
 
<li>Select menu <code>Project -> Build Solution</code></li>
 
</ol>
 
</ol>

Latest revision as of 21:31, 18 November 2019

Home < Documentation < Nightly < Developers < Build Instructions < Compile


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


BUILD Slicer

After configuration, start the build process in the Slicer-SuperBuild directory

Linux or MacOSX (Makefile) Windows (Visual Studio)

Start a terminal.

$ cd ~/Projects/Slicer-SuperBuild

$ make -j<NUMBEROFCORES>

In case of file download hash mismatch error, you need to acquire the latest wget, and build cmake with OpenSSL turned on. For more information, see here and here

When using the -j option, the build will continue past the source of the first error. If the build fails and you don't see what failed, rebuild without the -j option. Or, to speed up this process build first with the -j and -k options and then run plain make. The -k option will make the build keep going so that any code that can be compiled independent of the error will be completed and the second make will reach the error condition more efficiently.

Start Windows Explorer. Need help?

  1. Open Slicer-SuperBuild\Slicer.sln in Visual Studio
  2. Select build configuration. Usually Release or Debug
  3. Select menu Project -> Build Solution

If you make local changes to Slicer, open the solution file located in the directory Slicer-SuperBuild/Slicer-build instead. You should then be able to either build all projects or just a specific one.