ITK/Getting Started/Build/Linux: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
Once you have download ITK source code with this terminal command for example :
To get the latest ITK source code, you must use git. If you do not have git installed, please install it from your package manager:
 
sudo apt-get install git
 
Once done, you need to download ITK source code with this terminal command:


  git clone https://itk.org/ITK.git
  git clone https://itk.org/ITK.git
Line 5: Line 9:
you will need to create a bin directory in the ITK directory:
you will need to create a bin directory in the ITK directory:


  $ sudo mkdir bin
  $ mkdir bin


Change directory to the binary directory, and run the CMake configuration tool
Change directory to the binary directory, and run the CMake configuration tool


  $ cd bin
  $ cd bin
  $ sudo ccmake -DITK_USE_REVIEW=ON ..
  $ ccmake ..
 
Initially, you get the CMake interface with an "EMPTY CACHE" message. Press "c" to configure with default settings and then "g" to generate the Makefiles. (If the "g" command is not available, you may need to press "c" to configure again). This will also exit CMake if successful.
 
<hr>
If it's still not work, just quit with "q" and retry a


Initially, you get the CMake interface with an "EMPTY CACHE" message. Press "c" to configure.
''$ ccmake -DITK_USE_REVIEW=OFF ..''
 
and configure it like this :


Configure now with these settings :
  BUILD_DOXYGEN                  *OFF
  BUILD_DOXYGEN                  *OFF
  BUILD_EXAMPLES                  *ON
  BUILD_EXAMPLES                  *ON
Line 23: Line 33:
  CMAKE_INSTALL_PREFIX            */usr/local
  CMAKE_INSTALL_PREFIX            */usr/local
  ITK_USE_KWSTYLE                *OFF
  ITK_USE_KWSTYLE                *OFF
Press "c" to configure. Because of the command line option <tt>-DITK_USE_REVIEW=ON</tt> that we used above to build the "Review" files too, a warning message is displayed.
Press "e" to exit the help screen, and then "g" to generate the Makefiles. (If the "g" command is not available, you may need to press "c" to configure again). This will also exit CMake if successful. If it's still not work, just quit with "q" and retry to configure with :
''$ sudo ccmake -DITK_USE_REVIEW=OFF ..''


and press "g" if it appears, if not, "c" and then "g".
and press "g" if it appears, if not, "c" and then "g".
<hr>




Then, run <tt>make</tt> to compile ITK
Then, run <tt>make</tt> to compile ITK


  $ sudo make -j4
  $ make -j4


The <tt>-j4</tt> option will use parallel compilation if you have more than 1 processor. Compilation will take for a long time, even on a fast desktop (I have 4 processors, 16G of RAM and a 64 bit architecture). Once it finishes successfully you can install the files. Note that with the options above, the files will be installed to the same places where the Ubuntu package would put them.
The <tt>-j4</tt> option will use parallel compilation if you have more than 1 processor. Compilation will take for a long time, even on a fast desktop (I have 4 processors, 16G of RAM and a 64 bit architecture). Once it finishes successfully you can install the files. Note that with the options above, the files will be installed to the same places where the Ubuntu package would put them.


  $ sudo make install
  $ sudo make install
=Software Guide=
If you need more supports, feel free to consult the ITK Software Guide here : https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch2.html#x27-170002

Revision as of 19:19, 7 July 2016

To get the latest ITK source code, you must use git. If you do not have git installed, please install it from your package manager:

sudo apt-get install git 

Once done, you need to download ITK source code with this terminal command:

git clone https://itk.org/ITK.git

you will need to create a bin directory in the ITK directory:

$ mkdir bin

Change directory to the binary directory, and run the CMake configuration tool

$ cd bin
$ ccmake ..

Initially, you get the CMake interface with an "EMPTY CACHE" message. Press "c" to configure with default settings and then "g" to generate the Makefiles. (If the "g" command is not available, you may need to press "c" to configure again). This will also exit CMake if successful.


If it's still not work, just quit with "q" and retry a

$ ccmake -DITK_USE_REVIEW=OFF ..

and configure it like this :

BUILD_DOXYGEN                   *OFF
BUILD_EXAMPLES                  *ON
BUILD_SHARED_LIBS               *ON
BUILD_TESTING                   *ON
CMAKE_BACKWARDS_COMPATIBILITY   *2.4
CMAKE_BUILD_TYPE                *Release
CMAKE_INSTALL_PREFIX            */usr/local
ITK_USE_KWSTYLE                 *OFF

and press "g" if it appears, if not, "c" and then "g".



Then, run make to compile ITK

$ make -j4

The -j4 option will use parallel compilation if you have more than 1 processor. Compilation will take for a long time, even on a fast desktop (I have 4 processors, 16G of RAM and a 64 bit architecture). Once it finishes successfully you can install the files. Note that with the options above, the files will be installed to the same places where the Ubuntu package would put them.

$ sudo make install


Software Guide

If you need more supports, feel free to consult the ITK Software Guide here : https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch2.html#x27-170002