SimpleITK/GettingStarted/Visual guide to building on Linux: Difference between revisions
Danmueller (talk | contribs) m (Added more to step 4) |
Danmueller (talk | contribs) m (Added some images) |
||
Line 34: | Line 34: | ||
== Step 2: Install build tools == | == Step 2: Install build tools == | ||
[[File:SimpleITK_visual_guide_step02_01.png|200px|thumb|Install the build tools by opening the terminal]] | |||
The next step is to install the required build tools. | The next step is to install the required build tools. | ||
[[File:SimpleITK_visual_guide_step02_02.png|200px|thumb|In the terminal, use apt-get to install the build tools]] | |||
Open a terminal window (Menu > Terminal) and run the following command: | Open a terminal window (Menu > Terminal) and run the following command: | ||
sudo apt-get install cmake gcc g++ git giggle python ipython monodevelop | sudo apt-get install cmake gcc g++ git giggle python ipython monodevelop | ||
Line 41: | Line 43: | ||
Confirm that you want to install the packages (press "y"), then wait for the installation to complete. | Confirm that you want to install the packages (press "y"), then wait for the installation to complete. | ||
[[File:SimpleITK_visual_guide_step02_03.png|200px|thumb|Build tools could also be installed using the software manager]] | |||
Alternatively, you could manually select each software package from the Software Manager (Menu > Software Manager). | Alternatively, you could manually select each software package from the Software Manager (Menu > Software Manager). | ||
Line 51: | Line 54: | ||
cd ITK | cd ITK | ||
[[File:SimpleITK_visual_guide_step03_01.png|200px|thumb|Create a directory to place the source code using the Terminal or the file manager]] | |||
Of course you can do this visually via the file manager (Menu > Files). | |||
[[File:SimpleITK_visual_guide_step03_02.png|200px|thumb|Get the SimpleITK source code using <code>git</code>]] | |||
Now download the SimpleITK source code, by entering the following command in the Terminal: | Now download the SimpleITK source code, by entering the following command in the Terminal: | ||
git clone --recursive http://itk.org/SimpleITK.git | git clone --recursive http://itk.org/SimpleITK.git | ||
Line 56: | Line 63: | ||
Now go into the SimpleITK directory: | Now go into the SimpleITK directory: | ||
cd SimpleITK | cd SimpleITK | ||
== Step 4: Build SimpleITK == | == Step 4: Build SimpleITK == |
Revision as of 08:30, 4 February 2012
This guide gives detailed instructions for building SimpleITK on Linux. It is written for beginners getting started with SimpleITK.
Why Linux?
- Linux is freely available
- It has all the required tools
- Did I mention it is free?
Step 1: Get Linux
The first step is to install a Linux distribution. Some popular ones are:
There are many online tutorials explaining how to install your chosen Linux distribution:
- Ubuntu
- Mint
If you are a Windows user, you may consider running Linux on a virtual machine. Some popular virtual machine environments are:
Again, there are heaps of tutorials:
- Installing Ubuntu inside Windows using VirtualBox
- How to Install Ubuntu on VirtualBox
- Install Linux Mint 12 in VirutalBox
- How to Install Linux Mint in Virtualbox (youtube)
This guide uses Linux Mint 12, but the steps are very similar for other Linux distributions.
Step 2: Install build tools
The next step is to install the required build tools.
Open a terminal window (Menu > Terminal) and run the following command:
sudo apt-get install cmake gcc g++ git giggle python ipython monodevelop
Confirm that you want to install the packages (press "y"), then wait for the installation to complete.
Alternatively, you could manually select each software package from the Software Manager (Menu > Software Manager).
Step 3: Get SimpleITK source code
The next step is to get the SimpleITK source code using git.
Decide where you want to put the source code. I'm putting mine in home/ITK
:
cd ~ mkdir ITK cd ITK
Of course you can do this visually via the file manager (Menu > Files).
Now download the SimpleITK source code, by entering the following command in the Terminal:
git clone --recursive http://itk.org/SimpleITK.git
Now go into the SimpleITK directory:
cd SimpleITK
Step 4: Build SimpleITK
The next step is to start building.
The recommended way to build is via the so-called "super build":
mkdir Build cd Build cmake ../SuperBuild
The SuperBuild generates make files which takes care of downloading and building ITK, SWIG, and Lua, as well as SimpleITK. On my system, by default, wrappers were generated for C# and Lua.
To start the (long) build process, type:
make
On my laptop (Acer Aspire 5755G, Intel® Core™ i7-2630QM CPU @ 2.00GHz × 8, 2GB RAM) the build took over 2 hours.