How to Install UoMApM in Unix/Linux
0) Initial Requirements
- You need to have a copy of cmake. On Ubuntu, try "sudo apt-get install cmake"
- It helps to have development versions of libpng. On Ubuntu, try: "sudo apt-get install libpng-dev"
1) Get VXL
Ensure that you have an up to date version of
VXL,
preferably obtaining the source code from git. See here.
This can be anywhere, but you might put it in:
fred/code/vxl
Basically, from within that directory:
git clone http://git.code.sf.net/p/vxl/git vxl
mkdir obj
cd obj
cmake ../vxl
Then edit the CMakeCache.txt file as appropriate.
For uomapm you need to have "BUILD_MUL ON".
For developing set CMAKE_BUILD_TYPE RelWithDebug
Then run "make" again to build everything.
I usually end up with a structure like this:
fred/code/vxl/vxl - The source code
fred/code/vxl/obj - The compiled code
2a) [Optional] Install UoMqVXL
This is required if you wish to compile the GUI tools.
Full the instructions are here: UoMqVXL.
If you wish to install into the VXL source tree, then simply:
cd fred/code/vxl/vxl
git clone git://git.code.sf.net/p/uomqvxl/code uomqvxl
2b) [Optional] Install UoMASM
This is required if you wish to use Active Shape Models.
Full instructions are here: UoMASM
If you wish to install into the VXL source tree, then simply:
cd fred/code/vxl/vxl
git clone git://git.code.sf.net/p/uomasm/code uomasm
3a) Simple Approach: Install into the VXL source tree
The simplest thing is to install uomapm into the root of the vxl directory.
So in the above directory tree:
cd fred/code/vxl/vxl
git clone git://git.code.sf.net/p/uomapm/code uomapm
If there is not already a file called CMakeListsLocal.txt within vxl, create one.
Edit it, adding the line
SUBDIRS(uomapm)
Then just go into the obj directory and run make.
This should automatically set up and compile all of uomapm (into the directory obj/uomapm).
If you wish to compile the GUI tool, you must set the flag: BUILD_UoMApM_QApM to ON (by default it is OFF). This can be done either by editing the CMakeCache.txt file (in the obj directory), or through the CMake GUI. Having changed the flag, re-run make.
Note that you must have installed the
UoMqVXL package for this to work. Your CMakeLists.txt file should include the lines:
SUBDIRS(uomqvxl)
SUBDIRS(uomapm)
3b) Alternative approach: Modules in a separate directory tree
i) Create directories
Create a new directory to contain your new modules, eg
fred/code/vxl_modules
Within this create a src and obj directory for the source code and the compiled code:
fred/code/vxl_modules/src
fred/code/vxl_modules/obj
ii) Download uomapm
Download the uomapm package into the directory fred/code/vxl_modules/src:
cd fred/code/vxl_modules/src
git clone git://git.code.sf.net/p/uomapm/code uomapm
iii) Create a new CMakeLists.txt
Add a CMakeLists.txt file to vxl_modules/src.
A minimal example would be something like this:
cmake_minimum_required(VERSION 2.6)
PROJECT( MyVXLProjects )
FIND_PACKAGE(VXL)
OPTION(BUILD_SHARED_LIBS "Build with shared libraries." ON)
IF(VXL_FOUND)
INCLUDE(${VXL_CMAKE_DIR}/UseVXL.cmake)
SET(MODULE_PATH ${VXL_CMAKE_DIR})
SUBDIRS(uomapm)
ENDIF(VXL_FOUND)
Note, if you have already installed UoMqVXL, then just add uomapm to the CMakeLists.txt:
...
SUBDIRS(uomqvxl)
SUBDIRS(uomapm)
iv) Compile it
This requires several steps.
First go into vxl_modules/obj and run cmake ../src.
This will set up an initial CMakeCache.txt, but will stop saying it doesn't know
about VXL.
Edit the CMakeCache.txt to set the VXL_DIR to the object directory for VXL.
For instance:
//The directory containing a CMake configuration file for VXL.
VXL_DIR:PATH=/home/fred/code/vxl/obj
Then re-run make - and all should be created.
If you wish to compile the GUI tools, you must set the flag: BUILD_UoMApM_QApM to ON (by default it is OFF). This can be done either by editing the CMakeCache.txt file (in the obj directory), or through the CMake GUI. Having changed the flag, re-run make.