Ikaros for Windows with
Visual Studio C++

Downloads

Download the following files:

  1. Visual Studio C++ 2010 from www.microsoft.com
  2. Ikaros from www.ikaros-project.org
  3. Pthreads Libary from sourceware.org or individual files from ftp.gwdg.de
  4. JPEG Libary from source www.ijg.org or here

Instructions

Start by building the JPEG library:

  1. Download the JPEG source from the Independent JPEG Group http://www.ijg.org/files/jpegsr8b.zip or http://www.ijg.org/files/
  2. Extract and open a command prompt. Navigate to the bin-directory of your vs2010 installation (e.g. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin) and run the .bat-file used to set environment paths (usually named vcvars.bat or vcvars32.bat). Note that the changes made by this bat-file are temporary and only affect this command prompt.
  3. Navigate to the jpeg source directory and run the following to create the vs2010 project files:
    > nmake /f makefile.vc setup-v10
  4. Close the command prompt, open the jpeg.vcxproj project file and build both a static library (.lib) and a Dynamic Library (.dll). The library type is set in the project settings by expanding "Configuration Properties" selecting "General" and editing the "Configuration Type".
  5. Create a directory called "Lib" in the Ikaros directory and copy the following files there:
      jconfig.h
      jerror.h
      jmorecfg.h
      jpeglib.h
      jpeg.lib
    
    Then copy the jpeg.dll to the Ikaros/Bin directory (jpeg.dll and jpeg.lib reside in the Release directory).

Then create the vs2010 project for Ikaros:

  1. Open vs2010 and click "File->New->Project From Existing Code".
  2. Select project type "Visual C++".
  3. Choose name and location. Add the folder Source in the Ikaros directory.
  4. Choose project type "Console application project", and click finish.
  5. Extract the Pthreads libraries and copy the following files to the Ikaros/Lib directory:
      pthread.h
      sched.h
      semaphore.h
      pthreadVC2.lib
    
    Copy pthreadVC2.dll to your Ikaros\Bin directory.
  6. Open the project properties and select "Configuration Properties". Under "General" set "Output Directory" to the Ikaros\bin path, and set "Target Name" to ikaros. Under "VC++ Directories" select "Include Directories" and add the path to Ikaros\Source, Ikaros\Source\Kernel and Ikaros\Lib. Then select "Library Directories" and add the path to Ikaros\Lib.
  7. Expand "C/C++" and under "General" select "Additional Include Directories" and add the path to Ikaros. Under "Preprocessor" edit the Preprocessor Definitions to also include WINDOWS and WINDOWS32. Close the project properties.
  8. Click "Project->Add Existing Item" and add the following lib-files to your project:
       libjpeg.lib
       pthreadVC2.lib
       WinMM.lib     (e.g. C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib)
       WS2_32.lib
    
  9. Open IKAROS_System.h, find the Windows Defines and remove the lines "#define USE_LIBPNG" and "#define USE_BLAS" if it is not already done.
  10. Expand the "Source Files"-tab and remove the following files:
       IKAROS_Serial_BSD.cc
       IKAROS_Socket_BSD.cc
       IKAROS_Threads_none.cc
       IKAROS_Timer_none.h
       IKAROS_Timer_POSIX.cc
    
  11. Build the project.

Running Ikaros

To run Ikaros you can either run it directly from Visual Studio C++ or use the command prompt.

To run from vs2010, open the Project Property pages and expand "Configuration Properties" and select "Debugging". Under "Command Arguments" enter the ikc-file you want to run, including the full path.

To run from the command prompt start by adding the directory where ikaros.exe resides to the system environment variable "Path".

To set the Path variable on Windows 7, open the control panel and enter "environment variable" in the search bar, and select "Edit environment variables for your account". Then click the "Environment variables..." button and look for the "Path" variable under the "System Variables" section on the bottom. If it does not exist, just make a new one. Add the desired path ending with a semicolon, e.g. "C:\Ikaros\Bin;" (without the quotes).

Open a command prompt and navigate to the directory where your ikc-file is stored and run it by entering the following:

> ikaros NameOfYourFile.ikc

If you want to use the WebUI, add the command line option -w8000 (where 8000 is the desired port). Other command line options can also be specified.

Connect to Ikaros with your browser by entering 127.0.0.1:8000 in the address bar. Note that Internet Explorer 8 does not support all features necessary to run the Ikaros WebUI, so we recommend using the Chrome browser.

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.

  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 7 64-bit

IDE

Visual Studio
www.microsoft.com
Visual Studio C++ 2010 Express

Ikaros

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

External libraries

Independent JPEG Group
http://www.ijg.org/
Download: www.ijg.org

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