How to Install UoMASM 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"
- If you wish to use the GUI tools, then you need Qt4 ("sudo apt-get install libqt4-dev")
1) Get VXL
Ensure that you have an up to date version of
VXL,
preferably obtaining the source code from git.
This can be anywhere, but you might put it in:
fred/code/vxl
Basically, from within that directory:
git clone https://github.com/vxl/vxl.git vxl
For developers: Move to the vxl directory and run:
./scripts/setup-for-development.bash
Then set up the directory for the compiled code:
mkdir obj
cd obj
cmake ../vxl
Then edit the CMakeCache.txt file, setting the following flags
BUILD_CONTRIB:BOOL=ON
BUILD_SHARED_LIBS:BOOL=ON
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
Now run "make". This will re-run cmake, but will eventually stop (possibly with an error). Don't worry.
Edit the CMakeCache.txt file again, this time setting
BUILD_MUL:BOOL=ON
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
2) [Optional] Install UoMqVXL
This is required if you wish to compile the ASM GUI tool, qasm_markup_tool.
Follow the instructions here: UoMqVXL
3a) Simple Approach: Install into the VXL source tree
The simplest thing is to install uomasm 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/uomasm/code uomasm
If there is not already a file called CMakeListsLocal.txt within vxl, create one.
Edit it, adding the line
SUBDIRS(uomasm)
Then just go into the obj directory and run make.
This should automatically set up and compile all of uomasm (into the directory obj/uomasm).
If you wish to compile the ASM GUI tool, you must set the flag: BUILD_UoMASM_QASM 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(uomasm)
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 uomasm
Download the uomasm package into the directory fred/code/vxl_modules/src:
cd fred/code/vxl_modules/src
git clone git://git.code.sf.net/p/uomasm/code uomasm
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(uomasm)
ENDIF(VXL_FOUND)
Note, if you have already installed UoMqVXL, then just add uomasm to the CMakeLists.txt:
...
SUBDIRS(uomqvxl)
SUBDIRS(uomasm)
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 ASM GUI tool, you must set the flag: BUILD_UoMASM_QASM 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.