Compilation on Windows

From Simspark
Jump to: navigation, search
Running Simspark in Windows 7

Contents


Creating Windows distribution of Simspark from source

Text in RED is required for compilation under Visual C++ 2010.

0. Requirements:

- Windows XP or higher, x86 or x64
- Visual C++ 2008 SP1 or higher. (Can be downloaded from Visual Studio Express Edition Download Page).
- SVN client (e.g. TortoiseSVN which integrates to windows explorer or Slik SVN which integrates to the console).
- CMake 2.8 or higher (CMake download page)
- Create directory for libraries (e.g. C:\library).
reason: CMake looks for libraries in C:\, C:\library\ or C:\Program Files\
- NSIS Installer (NSIS, recommended) - create simspark (chapter 9.1) and rcssserver3d (chapter 11.1) installer

1. Ruby library

1.1 Ruby library 1.8.x
- Download from Ruby for windows download page and unzip to C:\library\ruby. Make sure it contains include/ folder!
- Comment lines 1, 2 and 3 in file C:\library\ruby\lib\ruby\1.8\i386-mswin32\config.h:
 //#if _MSC_VER != 1200
 //#error MSC version unmatch: _MSC_VER: 1200 is expected.
 //#endif</code>
reason: Ruby windows support was made ages ago using VC++ 6.0 (_MSC_VER was 1200)

2. Boost library

- Download Boost library 1.50.0 or higher.
- Unzip Boost to directory C:\library\boost.
- Run console and set to the C:\library\boost. Run bootstrap.bat to create b2 tool.
problem: if Boost cannot find Visual Studio 2008 or 2010 compiler, add path manually, e.g.:
 path=%path%;C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\
 [or]
 path=%path%;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\
- In running console set to the C:\library\boost directory and write:
 b2 install --prefix=C:\library\boost --with-regex --with-thread --with-date_time --with-filesystem --with-chrono
note: It created libraries in C:\library\boost\lib\

3. ODE library

- Download ODE library 0.11.1 and unzip to the C:\library\ode.
- Run console, set to the c:\library\ode\build and write:
 premake4 vs2008
note: It create a visual studio project in C:\library\ode\build\vs2008.
- Open project C:\library\ode\build\vs2008\ode.sln. Agreed with all conversation to the VS2010.
- Set up Build->Configuration Manager->Active solution configuration->ReleaseSingleDLL (You can also select ReleaseDoubleDLL if you want to compile ODE with double precision)
- Compile. After build, ignore compilation error c10100b1.
note: It created library in C:\library\ode\lib\ReleaseSingleDLL\

4. DevIL library

- Download DevIL SDK library (actual 1.7.8) for Windows and unzip to the C:\library\devil .

5. Freetype2 library

- Download Freetype2 (complete package, actual 2.3.5.1) and install to the C:\library.

6. SDL library

- Download SDL 1.2.x library (Development Libraries -> Win32 -> SDL-devel-1.2.14-VC8.zip) and unzip to the C:\Library\SDL.

7. Check out the source from the source forge SVN repository

7.1 Slik SVN (console)
- run console and set to the directory, when you want to download source files of simspark (e.g. C:\) and type:
 svn co http://simspark.svn.sourceforge.net/svnroot/simspark
7.2 TortoiseSVN (windows explorer)
- Open directory, when you want to download source files of simspark (e.g. C:\simspark)
- Right click in directory and select SVN Checkout...
- Set URL of repository: http://simspark.svn.sourceforge.net/svnroot/simspark
note: project saved in C:\simspark

8. CMake (Simspark)

8.1 Using console
- Run console and add path to the CMake bin directory, e.g.:
 path=%path%;C:\cmake-2.8.0-win32-x86\bin\
- Set to the C:\simspark\trunk\spark directory and write:
 mkdir build
 cd build
 cmake -DCMAKE_BUILD_TYPE="Release" ..
 [or]
 cmake -DCMAKE_BUILD_TYPE="Release" ..
note: Default install directory is C:\Program Files\simspark. You can change it with cmake parameter: -DCMAKE_INSTALL_PREFIX=C:\whatever
8.2 Using GUI
- Run cmake-gui.exe
- Set up source directory (C:\simspark\trunk\spark) and build directory (C:\simspark\trunk\spark\build)
- Press Configure and select Visual Studio 9 2008 or Visual Studio 10 2010.
note: Default install directory is C:\Program Files\simspark (parameter CMAKE_INSTALL_PREFIX).
- If configuring is done, press Configure again to update new values and press Generate to create Visual Studio project.

9. VC++ 2008 or 2010 (Simspark)

- Open project: C:\simspark\trunk\spark\build\simspark.sln
- Set up Build->Configuration Manager->Active solution configuration->Release
- Compilation (Build->Rebuild Solution)
9.1 Creating simspark installer (recommended)
- In Solution Explorer build PACKAGE project (right click on PACKAGE project and select Build). It will create simspark installer file (simspark-0.x.y-win32.exe) inside the build directory: C:\simspark\trunk\simspark\build\
- Run the installer to install simspark.
9.2 Installing simspark directly from VC++
- In Solution Explorer build INSTALL project (right click on project INSTALL and select Build)
note: This copy files into install directory (default C:\Program Files\simspark)


10. CMake (Rcssserver3D)

10.1 Using console
- Run console and add path to the CMake bin directory, e.g.:
 path=%path%;C:\cmake-2.8.0-win32-x86\bin\
- Set to the C:\simspark\trunk\rcssserver3d directory and write:
 mkdir build
 cd build
 cmake -DCMAKE_BUILD_TYPE="Release" ..
 or
 cmake -DCMAKE_BUILD_TYPE="Release" ..
note: Default install directory is C:\Program Files\rcssserver3d. You can change it with cmake parameter: -DCMAKE_INSTALL_PREFIX=C:\whatever
10.2 Using GUI
- Run cmake-gui.exe
- Set up source directory (C:\simspark\trunk\rcssserver3d) and build directory (C:\simspark\trunk\rcssserver3d\build)
- Press Configure and select Visual Studio 9 2008 or Visual Studio 10 2010..
note: Default install directory is C:\Program Files\rcssserver3d (parameter CMAKE_INSTALL_PREFIX).
- If configuring is done, press Configure again to update new values and press Generate to create Visual Studio project.

11. VC++ 2008 or 2010 (Rcssserver3d)

- Open project: C:\simspark\trunk\rcssserver3d\build\rcssserver3d.sln
- Set up Build->Configuration Manager->Active solution configuration->Release
- Compilation (Build->Rebuild Solution)
11.1 Creating rcssserver3d installer (recommended)
- In Solution Explorer build PACKAGE project (right click on PACKAGE project and select Build). It will create rcssserver3d installer file (rcssserver3d-0.x.y-win32.exe) inside the build directory: C:\simspark\trunk\rcssserver3d\build\
- Run the installer to install rcssserver3d. Notice that simspark should be installed before.
- Restart Windows (you can Log off and Log in again instead).
11.2 Installing rcssserver3d directly from VC++
- In Solution Explorer build INSTALL project (right click on INSTALL project and select Build)
note: This copy files into install directory (default C:\Program Files\rcssserver3d)

12. Run applications

12.1 If rcssserver3d is installed using the installer
- Make sure that you logout and login at least once after installation
- Go to the installation directory (e.g. C:\Program Files\rcssserver3d 0.6.3)
- Run simspark.cmd to run the simulation
- You can run the test agent using rcssagent3d.cmd and the external monitor/logplayer using rcssmonitor3d.cmd
12.2 If rcssserver3d is installed from VC++ using INSTALL project
- Run simulation with C:\Program Files\rcssserver3d\bin\simspark.exe.
- Run test agent with C:\Program Files\rcssserver3d\bin\rcssagent3d.exe.
note: If you see errors, see Chapter 6.#Problems.

Problems

1. Missing simspark libraries

Problem: Missing simspark libraries spark.dll, zeitgeist.dll, etc.
Solution: Go to Start->Control Panel->System->Advanced->Enviroment Variable
- Add path to the simspark\lib\simspark in variable PATH:
 C:\Program Files\simspark\lib\simspark\

2. Missing rcssserver3d libraries

Problem: After running simspark.exe show error:
 (Core) ERROR: Could not open 'soccer'
 ...
Missing rcssserver3d library soccer.dll.
Solution: Go to Start->Control Panel->System->Advanced->Enviroment Variable
- Add path to the rcssserver3d\lib\rcssserver3d in variable PATH (e.g.):
 C:\Program Files\rcssserver3d\lib\rcssserver3d\

3. Missing ruby 1.9.0

Problem: Missing ruby library msvcrt-ruby190.dll
Solution: Download ruby library from here
- Go to Start->Control Panel->System->Advanced->Enviroment Variable
- Add path to the ruby\bin in variable PATH:
 Like C:\Program Files (x86)\ruby\bin

4. Missing external libraries

Problem: Missing libraries like msvcrt-ruby18.dll, boost_thread-vc90-mt-1_39.dll, freetype6.dll, etc.
Solution: Copy following DLL's to the C:\Program Files\rcssserver3d\bin\ directory
 C:\library\boost\stage\lib\boost_date_time-vc90-mt-1_39.dll
 C:\library\boost\stage\lib\boost_regex-vc90-mt-1_39.dll
 C:\library\boost\stage\lib\boost_thread-vc90-mt-1_39.dll
 C:\library\devil\lib\DevIL.dll
 C:\library\GnuWin32\bin\freetype6.dll
 C:\library\GnuWin32\bin\zlib1.dll
 C:\library\ode\lib\ReleaseSingleDLL\ode_single.dll
 [OR]
 C:\library\ode\lib\ReleaseDoubleDLL\ode_double.dll
 C:\library\ruby\bin\msvcrt-ruby18.dll
 [If you are using Ruby 1.9.x,]
 C:\library\ruby\bin\msvcrt-ruby191.dll
 C:\library\SDL\lib\SDL.dll

Using Windows distribution of Rsgedit (prepearing)

  1. Download and install the latest MS Visual C++2008 Redistributable Package (x86).
  2. Download and install the latest simspark and rsgedit (rsgedit is currently not available).
    note: Install simspark first.
  3. Restart Windows (you can Log off and Log in again instead).
  4. Run rsgedit.cmd to run the Rsgedit (available in rsgedit's Start Menu entry and in the installation directory, e.g. C:\Program Files\rsgedit 0.1).
  5. You should see a small splash screen and then the main application window. On the left half are some diagnostic windows. They show the scenegraph in the lower half and properties of current node in the top half. On the right half of the screen is the embedded OpenGL window that shows the simulation.
  6. Open a simulation by choosing File|Open in the menu or use the folder icon. Rsgedit depends on small ruby startup scripts to setup a simulation. Simple demos are boxpheres.rb and jointtest.rb.
  7. Running a simulation. The simulation is in either one of two states paused or running. Immediately after opening a simulation it is paused. You can start the simulation by choosing simulation|start from the menu or clicking on the start icon. You can later pause a simulation by choosing simulation|pause from the menu or clicking the pause icon.
  8. Resetting a simulation. If the simulation is currently paused it is possible to reset it that is put it back to the state it was immediately after opening the simulation.

Creating Windows distribution of Rsgedit from source

0. Requirements:

Same as Simspark.

1. wxWidgets library

- Download wxWidgets installer for Windows and install to the C:\library\.
- Enable OpenGL support. Edit line 994 in file c:\library\wxWidgets-2.8.10\include\wx\msw\setup.h:
from
#define wxUSE_GLCANVAS       0
to
#define wxUSE_GLCANVAS       1
- Open project c:\library\wxWidgets-2.8.10\build\msw\wx.dsw and convert all projects.
- Set up Build->Configuration Manager->Active solution configuration->Release.
- Compile.

2. Follow the steps 1-9 in chapter #Creating Windows distribution of Simspark from source

3. CMake (Rsgedit)

3.1 Using console
- Run console and add path to the CMake bin directory, e.g.:
 path=%path%;C:\cmake-2.6.4-win32-x86\bin\
- Set to the C:\simspark\trunk\rsgedit directory and write:
 mkdir build
 cd build
 cmake -DCMAKE_BUILD_TYPE="Release" -G "Visual Studio 9 2008" "C:\simspark\trunk\rsgedit"
 [or]
 cmake -DCMAKE_BUILD_TYPE="Release" -G "Visual Studio 10" "C:\simspark\trunk\rsgedit.
note: Default install directory is C:\Program Files\rsgedit. You can change it with cmake parameter: -DCMAKE_INSTALL_PREFIX=C:\whatever
3.2 Using GUI
- Run cmake-gui.exe
- Set up source directory (C:\simspark\trunk\rsgedit) and build directory (C:\simspark\trunk\rsgedit\build)
- Press Configure and select Visual Studio 9 2008 or Visual Studio 10 2010..
note: Default install directory is C:\Program Files\rsgedit (parameter CMAKE_INSTALL_PREFIX).
- If configuring is done, press Configure again to update new values and press Generate to create Visual Studio project.

4. VC++ 2008 or 2010 (Rsgedit)

- Open project: C:\simspark\trunk\spark\build\rsgedir.sln
- Set up Build->Configuration Manager->Active solution configuration->Release
- Compilation (Build->Rebuild Solution)
4.1 Creating rsgedit installer (recommended)
- In Solution Explorer build PACKAGE project (right click on PACKAGE project and select Build). It will create rsgedit installer file (rsgedit-0.x-win32.exe) inside the build directory: C:\simspark\trunk\rsgedit\build\
- Run the installer to install rsgedit.
4.2 Installing rsgedit directly from VC++
- In Solution Explorer build INSTALL project (right click on project INSTALL and select Build)
note: This copy files into install directory (default C:\Program Files\rsgedit)

5. Run Rsgedit

- Run rsgedit.cmd to run the Rsgedit (available in rsgedit's Start Menu entry and in the installation directory, e.g. C:\Program Files\rsgedit 0.x)

Starting the soccerbot

  1. Open the agent.rb simulation. You should see the default arena (a simple boxed field).
  2. Start the simulation.
  3. Start the soccer agent. Choose File|Start Agent from the menu or press the agent icon and open sagentspark.exe binary.
  4. The .exe file is immediately started. The output of the agent is shown in a separate window. You should now see the humanoid appearing on the field, waving one arm.
  5. You can stop (kill) the agent process by pressing the stop icon in the agent log window. You can restart the agent with the play icon in the agent window.

rcssserver3d 0.6.3

In version 0.6.3 of rcssserver3d, as downloaded from here, you may need to edit the rcssserver3d.cmd and other .cmd files to include the correct paths. This version assumes that environment variables are set for SPARK_DIR and RCSSSERVER3D_DIR. You can set them as follows.

On 32-bit:

SET SPARK_DIR=C:\Program Files\simspark
SET RCSSSERVER3D_DIR=C:\Program Files\rcssserver3d 0.6.3

On 64-bit:

SET SPARK_DIR=C:\Program Files (x86)\simspark
SET RCSSSERVER3D_DIR=C:\Program Files (x86)\rcssserver3d 0.6.3

You can set these environment variables globally, or edit the .cmd files. Note that if you edit these files on Vista/Win7, you will be required to run your editor as an administrator, since these files reside within the program files folder.

Personal tools