Ikaros for Linux

Docs > Ikaros for Linux

These are the Linux specific instructions on how to compile Ikaros using only command-line tools and how to add a new module to the project.

The software used is listed in the end of the document. Ikaros will most likely work with later package versions than those listed here.

Install Ikaros

  1. First, install the compiler and external libraries. The easiest way to install the packages in Ubuntu is to use the apt-get command. Simply run this command on the terminal:
    > sudo apt-get install libpng-dev g++ libgsl0-dev libjpeg62-dev
  2. Unpack the Ikaros tar file:
    > tar -xzf IKAROS.1.0.0.tar.gz
  3. Go to the "Linux" subdirectory, and run the "install.sh" script:
    > cd IKAROS.1.0.0/Linux
    > ./install.sh
    This script adds all the makefile bits we need, and also creates a "bin" subdirectory in your home catalog if you do not have one.
  4. To build Ikaros, go to the "Source" subdirectory and run make:
    > cd ../Source
    > make
    The ikaros binary will be placed in the "Source" directory. If you want to install it in your "~/bin" directory, run:
    > make install
    You can clean out the source tree from object files and other intermediate files by running:
    > make clean
    You can build Ikaros in debug-mode. To do so, first clean the source tree (to make sure everything gets rebuilt). Then build with make debug:
    > make clean
    > make debug
    Once you want to build Ikaros normally again, don't forgot to again run make clean before make.

Running Ikaros

At the shell prompt run ikaros this way:

> ikaros experimentfile.ikc

Here, "experimentfile.ikc" is the path to the experiment you want to run. The make-based build system automatically sets the needed paths, so your binary can be placed anywhere you like. It is convenient to place it in your ~/bin so you can use ikaros like any other command on the command-line. Example ikc-files are available in the Examples directory.

If you want to use ikaros with the Web-based user interface, start ikaros like this:

> ikaros -w8000 experimentfile.ikc

Ikaros will now wait for you to connect to 127.0.0.1:8000 with your web browser. Enter this URL into FireFox. You will find a start-up page where you can select the different views the experimentfile makes available.

Settings for Ikaros

There are several things you can set in the main Makefile. You can add flags for building (globally needed only; as we'll see later you set module-specific settings elsewhere). You can add definitions that will be visible in the source code, and you can set where to place the binary.

Please note that the definitions in IKAROS_System.h do not directly affect the build system. Specifically, setting "LINUX" or "MINIMAL" will not have the intended effect there. Instead, set it in the main Makefile:

DEFS := -DMINIMAL
or
DEFS := -DLINUX

For information, all libraries that are specific for a module (like libJPEG and libPNG) are included in the module-specific makefile fragment in its module directory, so for instance, you'd find it included in InputJPEG/Rules.mk. CBLAS (libgslcblas) and thread libraries (libpthread) are included in the Kernel/Rules.mk makefile fragment.

Adding a module to the Ikaros project

While quite easy to add another module to the simulator it does involve a few steps. The idea is to create a new folder to hold the module, add the folder to the project, add a bit of documentation (you will thank yourself for doing this), and tell the system to add the module to the Ikaros.

  1. Create a new folder in UserModules. The easiest way to do this is to go to UserModules and copy the 'MyModule' folder; do not forget to rename the folder as well.
  2. Add your code as appropriate. For information on how to do this, just look in the documentation. In the 'Modules/Examples' directory, there are some simple example modules to look at as well.
  3. Edit the Rules.mk file in your module directory so it builds your module. Normally, all you need to do is to change MODNAME from "MyModule" to the name of your module instead Add any external libraries you need here as well.
  4. Edit the ikc-file to add documentation.
  5. Add the module to 'UserModules.h', i. e. add the .h file and a line with the AddClass call. Copy and rename one of the lines.
  6. Edit the Rules.mk file in the "UserModules" directory so it will build your module as well. Copy the two lines
    dir     := $(d)/MyModule
    include    $(dir)/Rules.mk
    
    and change the name from "MyModule" to your module.

An example on how to write an Ikaros module can be found here.

The software used when creating this document:

OS

Ubuntu Linux
http://www.ubuntu.com/
Ubuntu 7.04 (Feisty Fawn)

Ikaros

Ikaros http://www.ikaros-project.org/
Ikaros 1.0

External libraries

Independent JPEG Group
http://www.ijg.org/
libjpeg62-dev

GSL - GNU Scientific Library
http://www.gnu.org/software/gsl/
libgsl0-dev
Only GSL's BLAS functions are used.

POSIX Threads
libpthread-dev

PNG Libary
http://www.libpng.org/
libpng12-dev

LZW compression Libary
http://www.zlib.net/
zlib1g-dev