ITK/WrapITKInstallFedora
Installation on Fedora 19 or 20
This section describes how to install ITK with python wrappings on Fedora 19 or 20. 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
- 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
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):
- su # Type your root password
- make install
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.