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

From Slicer Wiki
Jump to: navigation, search
m
Tag: 2017 source edit
 
(35 intermediate revisions by 8 users not shown)
Line 1: Line 1:
 +
<noinclude>{{documentation/versioncheck}}</noinclude>
 
== CHECKOUT slicer source files ==
 
== CHECKOUT slicer source files ==
  
<br>
+
<!--
1. 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.
+
2. Even if you use <code>svn</code> to check out Slicer source code, you will need to have <code>git</code> installed to checkout and build other libraries. '''YES''', you need to install the things listed in the [[Documentation/{{documentation/version}}/Developers/Build Instructions/Prerequisites|prerequisites]] !.
 +
-->
 +
<!--
 +
3. Reading the following page: [[Slicer:git-svn|Slicer guide to <code>git-svn</code>]]
 +
-->
  
2. Even if you use <code>svn</code> to check out Slicer source code, you will need to have <code>git</code> installed to checkout and build other libraries. '''YES''', you need to install the things listed in the [[Documentation/{{documentation/version}}/Developers/Build Instructions/Prerequisites|prerequisites]] !.
+
<!--
 +
=== Git ===
 +
-->
 +
<span id="Git"></span>
  
 
<!--
 
<!--
3. Reading the following page: [[Slicer:git-svn|Slicer guide to <code>git-svn</code>]]
+
Checking the code using Git and configuring the <code>git svn</code> bridge is the way to go. If you plan on contributing code, have a look at [[Documentation/{{documentation/version}}/Developers/Tutorials/ContributePatch|How to contribute a patch ?]]
 
-->
 
-->
  
<br>
+
Check out the code using <code>git</code><!--and configure the <code>git svn</code> bridge-->:
  
=== Git [Recommended] ===
+
<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>
  
Checking the code using Git and configuring the <code>git-svn</code> bridge is the way to go. If you plan on contributing code, have a look at [[Documentation/{{documentation/version}}/Developers/Tutorials/ContributePatch|How to contribute a patch ?]]
+
<ol style="list-style-type:none; border-left:thick solid red; padding-left:1em;">
 +
  <li>Due to maximum path length limitations during build the build process, source and build folders must be located in a folder with very short total path length. This is expecially critical on Windows and MacOS. For example, C:\D\S4 for source and C:\D\S4R for release-mode build folder works on Windows; and /sq5 has been confirmed to work on MacOS.
 +
  </li>
 +
</ol>
  
* Clone the github repository
+
<ol start="1" style="list-style-type: decimal;">
  
   git clone git://github.com/Slicer/Slicer.git
+
   <li>
 +
    <p>Clone the github repository</p>
 +
    <pre>cd MyProjects
 +
git clone git://github.com/Slicer/Slicer.git</pre>
 +
The <code>Slicer</code> directory is automatically created after cloning Slicer.
 +
  </li>
  
* Setup the development environment using the [https://github.com/Slicer/Slicer/blob/master/Utilities/SetupForDevelopment.sh <code>SetupForDevelopment.sh</code>] script as described on our [[Documentation/Nightly/Developers/DevelopmentWithGit | Development With Git]] page.
+
  <li>
 +
    <p>Setup the development environment:</p>
 +
    <pre>cd Slicer
 +
./Utilities/SetupForDevelopment.sh</pre>
 +
    <p>For more details see [[Documentation/Nightly/Developers/DevelopmentWithGit | Development With Git]].</p>
 +
    <p>On Windows enter the commands above in to a bash shell, such as Git Bash (part of msysgit) or use a Git client with a graphical user interface.</p>
 +
  </li>
  
* Configure the <code>git svn</code> bridge to ensure the mapping with svn revision.
+
<!--
 +
  <li>
 +
    <p>Configure the <code>git svn</code> bridge to ensure the mapping with svn revision.</p><p><strong>git-svn is only required for core developers with svn access - other people can skip it.</strong></p>
 +
{{pre2|scroll|
 +
cd Slicer
 +
git svn init http://svn.slicer.org/Slicer4/trunk
 +
git update-ref refs/remotes/git-svn refs/remotes/origin/master
 +
git checkout master
 +
git svn rebase
 +
}}
 +
  </li>
 +
 
 +
Note for <b>Mac OSX El Capitan</b>:
 +
<p>
 +
You might need to link SVN from XCode if you find that <code>git svn</code> is broken. To get correct links and bypass El Capitan's SIP use these commands </p>
 +
{{pre2|scroll|
 +
sudo mkdir /Library/Perl/5.18/auto
 +
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/SVN /Library/Perl/5.18/darwin-thread-multi-2level
 +
sudo ln -s /Applications/Xcode.app/Contents/Developer/Library/Perl/5.18/darwin-thread-multi-2level/auto/SVN /Library/Perl/5.18/auto/
 +
}}
 +
 
 +
''If you plan to compile Slicer to develop your own extensions and test these extensions on Slicer releases, it is convenient to download the source code directly from SVN and specify the revision number corresponding to the release you want. To do so, replace <tt><MARKER></tt> and <tt><SVNREVISION></tt> in the command below with the selected revision and marker:''
 +
<pre>
 +
svn co http://svn.slicer.org/Slicer4/<MARKER> Slicer-r<SVNREVISION> -r <SVNREVISION>
 +
</pre>
 +
 
 +
  '''Release'''            '''SVN revision#'''      '''Marker'''
 +
  4.10.0              27501              trunk
 +
  4.8.1              26813              branches/Slicer-4-8
 +
  4.8.0              26489              trunk
 +
  4.6.2              25516              branches/Slicer-4-6
 +
  4.5.0-1            24735              trunk
 +
  4.4                23774              trunk
 +
  4.3.1              22599              branches/Slicer-4-3
 +
  4.3.0              22408              trunk
 +
 
 +
''More corresponding SVN revision numbers can be found [[Release_Details|here]] and [http://slicer.kitware.com/midas3/slicerpackages/view here]''. The <tt><MARKER></tt> can be found at the bottom of this page http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=SVNREVISION by replacing <tt>SVNREVISION</tt> with the selected revision.
 +
 
 +
''For example, to checkout the source code associated with revision <tt>4.8.1</tt>, you would use the following command:''
  
 
<pre>
 
<pre>
  cd Slicer
+
svn co http://svn.slicer.org/Slicer4/branches/Slicer-4-8 Slicer-r26813 -r 26813
  git svn init http://svn.slicer.org/Slicer4/trunk
 
  git update-ref refs/remotes/git-svn refs/remotes/origin/master
 
  git checkout master
 
  git svn rebase
 
 
</pre>
 
</pre>
 +
-->
  
=== Svn [Optional] ===
+
</ol>
 +
<!--
 +
=== Svn ===
  
 
To simply build Slicer, getting the code using <code>svn</code> is a more straight-forward approach.
 
To simply build Slicer, getting the code using <code>svn</code> is a more straight-forward approach.
  
 
   svn co http://svn.slicer.org/Slicer4/trunk Slicer
 
   svn co http://svn.slicer.org/Slicer4/trunk Slicer
 +
-->

Latest revision as of 22:14, 23 March 2020

Home < Documentation < Nightly < Developers < Build Instructions < CheckoutSourceCode


CHECKOUT slicer source files


Check out the code using git:

  1. While it is not enforced, we strongly recommend you to AVOID the use of SPACES for both the source directory and the build directory. We mean it.
  1. Due to maximum path length limitations during build the build process, source and build folders must be located in a folder with very short total path length. This is expecially critical on Windows and MacOS. For example, C:\D\S4 for source and C:\D\S4R for release-mode build folder works on Windows; and /sq5 has been confirmed to work on MacOS.
  1. Clone the github repository

    cd MyProjects
    git clone git://github.com/Slicer/Slicer.git

    The Slicer directory is automatically created after cloning Slicer.

  2. Setup the development environment:

    cd Slicer
    ./Utilities/SetupForDevelopment.sh

    For more details see Development With Git.

    On Windows enter the commands above in to a bash shell, such as Git Bash (part of msysgit) or use a Git client with a graphical user interface.