Installing the MATLAB interface to STIR: Difference between revisions
stir>Krthie creation of placeholder |
stir>Mehrhardt85 No edit summary |
||
Line 4: | Line 4: | ||
You will need to use the instructions at [[Installing STIR with CMake]]. Here we | You will need to use the instructions at [[Installing STIR with CMake]]. Here we | ||
will give more specific information. | will give more specific information. | ||
These are instructions on how to install the STIR+MATLAB interface have been tested on a unix system with ubuntu 14.04. It relies on CmakeGui (as usual) and an extension of SWIG that has to be installed first. | |||
= Install SWIG = | |||
First, prepare your system with some packages | |||
<pre> sudo apt-get install libtool automake autoconf autogen bison </pre> | |||
Get the edited version of SWIG | |||
<pre> mkdir swig | |||
cd swig | |||
git clone https://github.com/KrisThielemans/swig.git swig_git </pre> | |||
and checkout the right branch | |||
<pre> cd swig_git | |||
git checkout KTFIX </pre> | |||
SWIG can now be installed | |||
<pre> ./autogen.sh | |||
cd .. | |||
mkdir build | |||
cd build | |||
../swig_git/configure | |||
make | |||
sudo make install </pre> | |||
Note that the install might fail at the end if it can't find yodl2man, but we don't care. | |||
Check with that we now have the right version (should say 3.0.3) | |||
<pre> swig -version </pre> | |||
= Install STIR = | |||
Follow the instructions on this page up to the point where you started cmake-gui. | |||
* press configure | |||
* press ok | |||
* set CMAKE_BUILD_TYPE to Release | |||
* enable BUILD_SWIG_MATLAB | |||
* enable STIR_OPENMP | |||
* press configure | |||
check that CMake found the correct SWIG file (not the system one). If it did, replace the SWIG variable and "configure" again | |||
* generate | |||
* close cmake-gui | |||
Then either install STIR as usual | |||
<pre> make | |||
sudo make install </pre> | |||
or you could build only the STIR+MATLAB first (just to see if it fails or not) | |||
<pre> make stirMATLAB </pre> | |||
Add path in MATLAB. E.g. | |||
<pre> addpath /usr/local/matlab </pre> | |||
= Testing = | |||
There are a few tests in UCL-STIR/src/swig/test/matlab. Just execute these adding the directory where you installed it to your matlab path (e.g. if you choose /usr/local as your CMAKE_INSTALL_PREFIX, in MATLAB do "addpath /usr/local/matlab") |
Revision as of 09:51, 3 February 2016
This page provides instructions on how to install STIR for MATLAB. You will need STIR 3.1 or later for this to work (at present, use the [github version].
Introduction
You will need to use the instructions at Installing STIR with CMake. Here we will give more specific information.
These are instructions on how to install the STIR+MATLAB interface have been tested on a unix system with ubuntu 14.04. It relies on CmakeGui (as usual) and an extension of SWIG that has to be installed first.
Install SWIG
First, prepare your system with some packages
sudo apt-get install libtool automake autoconf autogen bison
Get the edited version of SWIG
mkdir swig cd swig git clone https://github.com/KrisThielemans/swig.git swig_git
and checkout the right branch
cd swig_git git checkout KTFIX
SWIG can now be installed
./autogen.sh cd .. mkdir build cd build ../swig_git/configure make sudo make install
Note that the install might fail at the end if it can't find yodl2man, but we don't care. Check with that we now have the right version (should say 3.0.3)
swig -version
Install STIR
Follow the instructions on this page up to the point where you started cmake-gui.
- press configure
- press ok
- set CMAKE_BUILD_TYPE to Release
- enable BUILD_SWIG_MATLAB
- enable STIR_OPENMP
- press configure
check that CMake found the correct SWIG file (not the system one). If it did, replace the SWIG variable and "configure" again
- generate
- close cmake-gui
Then either install STIR as usual
make sudo make install
or you could build only the STIR+MATLAB first (just to see if it fails or not)
make stirMATLAB
Add path in MATLAB. E.g.
addpath /usr/local/matlab
Testing
There are a few tests in UCL-STIR/src/swig/test/matlab. Just execute these adding the directory where you installed it to your matlab path (e.g. if you choose /usr/local as your CMAKE_INSTALL_PREFIX, in MATLAB do "addpath /usr/local/matlab")