Ikaros for Windows

Docs > Ikaros for Windows

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

Instructions on 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 project included in the Ikaros distribution is made with a nightly build version of Code::Blocks and with the MinGW compiler. To install this on your system, you need to download a number of packages and unzip them where both Code::Blocks and Windows can reach them. This documentation provides one solution to how to get all the packages at the same place and then set an environmental path in windows to that directory. The software packages used to perform the actions described in this document are listed at the end of the document. Ikaros will most likely work with later versions than those listed here.

Compiling Ikaros with the included Code::Blocks project file

  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 MinGW compiler. Download the all the binary MinGW related package and unzip them in C:\minGW ('C:\minGW' will be auto detected by Code::Blocks).
  3. Ikaros uses a small number of external libraries. Download the setup program for GSL, JPEG, PNG and Z and install them directly in 'C:\minGW\'. Make sure that the installation program doesn't create any additional sub directories.
  4. Download and run the self extracting Pthreads package and move all DLL files in the 'pre-build\lib' directory to 'C:\minGW\bin and then move all the files in the 'pre-build' directory to 'C:\minGW'.
  5. Ikaros needs to be able to access the newly downloaded DLL files. To solve this it is necessary to add the 'C:\minGW\bin' path to windows system path or move the DLL's to a accessible location in the file system (ex. in the same directory as the Ikaros binary or 'C:\Windows\system32').
  6. Start Code::Blocks.
  7. Open the Code::Blocks project ('<ikaros dir>\Windows\Code Blocks\ikaros\ikaros.cbp').
  8. Complie.

Creating a new Ikaros project in Code::Blocks

As an alternative to the procedure above, you may create a new Code::Blocks project instead:

  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 MinGW compiler. Download the all the binary MinGW related package and unzip them in C:\minGW ('C:\minGW' will be auto detected by Code::Blocks).
  3. Ikaros uses a small number of external libraries. Download the setup program for GSL, JPEG, PNG and Z and install them directly in 'C:\minGW\'. Make sure that the installation program don't create any additional sub directories.
  4. Download and run the self extracting Pthreads package and move all DLL files in the 'pre-build\lib' directory to 'C:\minGW\bin and then move all the files in the 'pre-build' directory to 'C:\minGW'.
  5. Ikaros needs to be able to access the newly downloaded DLL files. To solve this it is necessary to add the 'C:\minGW\bin' path to windows system path or move the DLL's to a accessible location in the file system (ex. in the same directory as the Ikaros binary or 'C:\Windows\system32').
  6. Start Code::Blocks.
  7. Create a new "Console application" project.
  8. Follow the guide to create the project.
  9. After completing the guide a Ikaros project has been created. Remove the main.cpp that the project guide created, both in project and on the hard drive.
  10. Choose Project->Add files recursively and add all *.h and *.cc in the Ikaros Source directory. Add the files to both the Debug and the Release target.
  11. Choose Project-> Project build options and add the following properties for both of the targets.

    Compiler setting
    Add "WINDOWS" in #defines

    Linker settings
    Add the following libraries to Link libraries:
    ws2_32
    libwinmn
    libjpeg
    libpthreadGCE2
    libgslcblas

    Search directories
    add "../../../Source" to Compiler search directory.

  12. 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 than '<ikaros 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

  13. Compile.

Compiling for WIN32

Although WIN32 is not supported, it may be possible to compile Ikaros for this platfrom by defining 'WINDOWS32' as well as 'WINDOWS' during compilation, for example by adding it to the beginning of the IKAROS_System.h file. This is necessary for compilation with Microsoft Visual Studio.

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.

Command line options can also be specified.

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.

Software used when creating this document

OS

Microsoft Windows
http://www.microsoft.com/
Windows XP SP2

IDE

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

Ikaros

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

Compiler and windows libaries

MinGW Compiler http://www.mingw.org/

gcc-core-3.4.2
gcc-g++-3.4.2
mingw-runtime-3.9
mingw-utils-0.3
w32api-3.6
binutils-2.15.91
mingw32-make-3.80.0-3
gdb-5.3.1-1

External libaries

Independent JPEG Group
http://www.ijg.org/
Download: http://gnuwin32.sourceforge.net/packages/jpeg.htm

GSL - GNU Scientific Library
http://www.gnu.org/software/gsl
Download: http://gnuwin32.sourceforge.net/packages/gsl.htm
Only GSL's BLAS functions are used.

Pthreads for windows
Download: http://sourceware.org/pthreads-win32

PNG Libary
http://www.libpng.org/
Download: http://gnuwin32.sourceforge.net/packages/libpng.htm

Z Libary
http://www.zlib.net/
Download: http://gnuwin32.sourceforge.net/packages/zlib.htm