ITK/WrapITKInstallLinux: Difference between revisions
(Update for Ubuntu) |
m (Python include dir) |
||
Line 30: | Line 30: | ||
* BUILD_SHARED_LIBS = ON # Is ON by default since ITK 4.6 when you use wrapping | * BUILD_SHARED_LIBS = ON # Is ON by default since ITK 4.6 when you use wrapping | ||
* PYTHON_EXECUTABLE = /usr/bin/python | * PYTHON_EXECUTABLE = /usr/bin/python | ||
* USE_SYSTEM_SWIG=OFF # Will use ITK's swig (recommended) | * USE_SYSTEM_SWIG=OFF # Will use ITK's swig (recommended) | ||
'''On Fedora 19 or 20:''' | '''On Fedora 19 or 20:''' | ||
* PYTHON_INCLUDE_DIR = /usr/include/python2.7 | |||
* PYTHON_LIBRARY = /usr/lib64/libpython2.7.so.1.0 | * PYTHON_LIBRARY = /usr/lib64/libpython2.7.so.1.0 | ||
* PY_SITE_PACKAGES_PATH = /usr/lib64/python2.7/site-packages | * PY_SITE_PACKAGES_PATH = /usr/lib64/python2.7/site-packages | ||
'''On Ubuntu 14:''' | '''On Ubuntu 14:''' | ||
* PYTHON_INCLUDE_DIR | * PYTHON_INCLUDE_DIR = /usr/include/x86_64-linux-gnu/python2.7 | ||
* PYTHON_LIBRARY = /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 | * PYTHON_LIBRARY = /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0 | ||
* PY_SITE_PACKAGES_PATH = /usr/lib/python2.7/dist-packages | * PY_SITE_PACKAGES_PATH = /usr/lib/python2.7/dist-packages |
Revision as of 13:45, 30 September 2014
Installation Linux
This section describes how to install ITK with python wrappings on Fedora 19 or 20, or Ubuntu 14. This can of course be extended to other Linuxes.
Step 1: Make sure the python headers are installed
Python will need to be installed along with the Python development headers (Python.h).
- Install the python-devel package.
Step 2: Setup the build
Clone the git repository in /home/yourname/ITK:
- cd
- git clone git://itk.org/ITK.git
- git checkout tags/v4.5.2 # Optional, if you want to use a stable version
Create a build directory, it is recommended to build outside of the source directory:
- mkdir build
- cd build
Use cmake to configure your build
- ccmake ../ITK
Set different variables, you may have to configure [C] the build 2 or 3 times. Use the advanced mode [T] to see all the possibilities.
- ITK_WRAP_PYTHON = ON
- BUILD_SHARED_LIBS = ON # Is ON by default since ITK 4.6 when you use wrapping
- PYTHON_EXECUTABLE = /usr/bin/python
- USE_SYSTEM_SWIG=OFF # Will use ITK's swig (recommended)
On Fedora 19 or 20:
- PYTHON_INCLUDE_DIR = /usr/include/python2.7
- PYTHON_LIBRARY = /usr/lib64/libpython2.7.so.1.0
- PY_SITE_PACKAGES_PATH = /usr/lib64/python2.7/site-packages
On Ubuntu 14:
- PYTHON_INCLUDE_DIR = /usr/include/x86_64-linux-gnu/python2.7
- PYTHON_LIBRARY = /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
- PY_SITE_PACKAGES_PATH = /usr/lib/python2.7/dist-packages
Once configuration is finished, you may now generate the needed files by pressing [g].
Step 3: Run the build
- make
Step 4: Install
You need to have root access to install ITK (if you left the default installation path):
On Fedora:
- su # Type your root password
- make install
On Ubuntu: Here, the super-user account is disabled by default, run the install step like this:
- sudo make install # Type your root password
ITK will install by default in /usr/local/lib. Now, you have to tell the system that the files have been installed here.
- cd /etc/ld.so.conf.d/
- add a file called itk-46.conf, which should contain only one line: /usr/local/lib
- ldconfig # tells the system to read the files in ld.so.conf.d
Step 5: Test your installation
- python
- import itk
- itk.Image
This should run without producing an error.