Ikaros for Linux

Docs > Ikaros for Linux

These are the Linux specific instructions on how to compile Ikaros using the included Code::Blocks project and how to make a new Ikaros project.

Instructions of how to run Ikaros, both from the IDE and from the terminal, and how to add a new module to the project are also included.

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

Compile Ikaros with the included Code::Blocks project file

  1. Download and install Code::Blocks. The project file included with Ikaros distribution is created with Nightly build SVN version 3960.
  2. The next step is to install the compiler and external libraries. The easiest way to install the packaged in Ubuntu is to use the apt-get command.
    Simply copy this command to Linux terminal:
    sudo apt-get install libpng-dev g++ libgsl0-dev libjpeg62-dev
  3. Start Code::Blocks.
  4. Open the Code::Blocks project ('<ikaros dir>/Linux/Code Blocks/ikaros/ikaros.cbp').
  5. Compile.

Creating a new Ikaros project in Code::Blocks

This document explain how to compile Ikaros using the open source cross platform IDE Code::Blocks.

  1. Download and install Code::Blocks. The project file included with the Ikaros distribution is created with nightly build SVN version 3960.
  2. The next step is to install the compiler and external libraries. The easiest way to install the packaged in Ubuntu is to use the apt-get command.
    Simply copy this command to Linux terminal:
    sudo apt-get install libpng-dev g++ libgsl0-dev libjpeg62-dev
  3. Start Code::Blocks.
  4. Create a new "Console application" project.
  5. Follow the guide to create the project.
  6. After completing the guide a Ikaros project have been created. Remove, both in project and on the hard drive, the main.cpp that the project guide created.
  7. Choose Project->Add files recursively and add all *.h and *.cc in the Ikaros Source directory. Add the files to both Debug and Release target.
  8. Choose Project-> Project build options and add the following properties for both of the targets.
    	
    Compiler settings
    Add "LINUX" in #defines.
    Linker settings
    Add the following libraries to Link libraries:
    gslcblas
    jpeg
    pthread
    png
    z
    There is a bug in libpthread that results in segmentation fault when using dynamic linked libpthread together with signal. To avoid this the libraries are linked static.
    Add "-static" in the other link options.
    Search directories
    add "../../../Source" to Compiler search directory.
    
  9. The next step is to change the working directory and the binary output for both targets. Chose Project->Properties and change to "Build target" settings.
    If you prefer to have the Ikaros binary file somewhere else then '<ikaors dir>/Bin/', you have to change the path from the binary file to the Ikaros root path. This can be done by defining the IKAROSPATH in IKAROS_system.h.
    Output filename
    ../../../Bin/ikaros
    Execution working
    ../../../Bin
    
  10. Compile

Running Ikaros

To run Ikaros you can either run it directly from Code::Blocks or use the terminal.

In Code::Blocks, press the "Run" button to start Ikaros. Ikaros is initially set up to run the WebUI Demo and will start up with that file and wait for a web browser to connect to port 127.0.0.1:8000. Enter this URL into FireFox. This will show a start-up page in the browser from which the different views can be selected.

The Ikaros control file can be changed by specifying the "set programs' argument" in the "Project" file menu. It is best to use a relative path to the ikc file here, for example: '../Examples/web_ui_objects.ikc', since this allows the project to be moved around.

At the shell prompt write the following:

> ./ikaros experimentfile.ikc

Here, "experimentfile.ikc" is the path to the experiment you want to run. Example ikc-files are available in the Examples directory. Note that the Ikaros binary must be placed at the correct location relative to the Source directory. If you move the binary from the Ikaros/Bin directory or set up your path so that Ikaros/Bin in in your search path, you need to change IKAROSPATH in IKAROS_System.h to point to the absolute location of the Ikaros directory.

Command line options can also be specified here.

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 ikc-file to add documentation.
  4. 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.

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)

IDE

Code::Blocks
http://www.codeblocks.org/
Code::Blocks SVN (3960)

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

L Libary
http://www.zlib.net/
zlib1g-dev