Contents
Goal
This is for people who want to:
- Compile the windows sdk for msvc themselves (either to package or play with flags).
- Prefer building directly in a rosbuild2 framework rather than the visual studio ide.
If you just want to build your program in the usual visual studio way, you should use the sdk directly.
Disclaimer
This is a 32 bit build only!
Yes...we're working on a 64 bit build method.
PreRequisites
Build Tools
cmake : get 2.8.4+, 2.8.3 has some problems. Select option to add to your PATH.
ms express c++ 2010 : earlier editions are missing alot of standard c++
wget : get the latest windows installer, install and then manually add the GnuWin32\bin folder to your PATH.
Ros Deps
python : use version 2.7 and add C:\Python27 to your PATH
python-win32 : latest build usually works [216+], select compatible version for python 2.7.
python-yaml : download for python 2.7
win-rosinstall : a modified rosinstall for windows, also follow setup instructions.
boostpro : 1.44 is ok (1.43 is missing graph). Multithreaded dll, debug dll. If you install to the default location, cmake's find boost modules will automatically discover it.
Optional
Console2 : a slightly nicer shell for windows.
log4cxx-x86-vs10.tar.gz : only need this if doing it yourself manually (i.e. no schebang script).
Configuration
You should have done this when installing python and rosinstall, but just to check:
Add C:\Python27 to your PATH environment variable.
Add C:\Python27\Scripts to your PATH environment variable.
Setup the environment variable PYTHONHOME=C:\Python27.
Also, if you've installed other than boost_1_44 or installed to a custom directory, be prepared to accomodate changes as marked below.
Quick Build
If you have all the dependencies above, there is a script that can be used to build the debug/release versions of the sdk in place.
> wget --no-check-certificate https://raw.github.com/stonier/win_ros/electric/win_sdk/scripts/schebang.bat
As usual, before executing some stranger's script, HAVE A LOOK INSIDE! The script downloads a known working set around ros, ros_comm, rosbuild2 and win_ros for electric and uses rosbuild2 to compile/install to the ros-sdk directory. Once you're satisfied, execute it in place. If nothing went wrong, you'll find a few important directories:
ros-sdk : the location of the final debug/release binaries. build : the temporary rosbuild2 parallel build directory. src : the sources. src/setup.bat : convenient environment script.
Verifying
For starters, the roscpp_tutorials binaries are good to test your system on.
On a networked linux machine, configure ROS_IP and ROS_MASTER_URI appropriately.
- Start roscore on the linux machine.
On the windows machine, make sure your setup.bat has configured ROS_IP and ROS_MASTER_URI appropriately.
- Ensure boost lib directories are on your %PATH% (see 'Troubleshooting' section)
> cd src > setup.bat # set ROS_MASTER_URI, ROS_IP in here before running > cd ..\build\debug > env.bat # sets up rosbuild2 search paths > cd bin > talker
Your Own Development
Build Rules
Use the schebang script to customise your own scripts - adding source trees, compile options. It's an awful lot easier than doing everything by hand.
New Packages
If you use your own source trees and want to create new packages, they will have to be compatible with the new rosbuild2 format. Some notes on making rosbuild2 compatible packages.
Trouble Shooting
After RosInstall
Boost Location
You may need to edit the boost location in src/setup.bat to point to a custom install location.
Compiler Location
Same situation with the compiler (last line of setup.bat). Other options might be for visual studio, also the windows 7.1 sdk, though both of those are still experimental, especially 64 bit versions.
Compiling
Boost
Again, you'll probably need to set -DBOOST_ROOT to point to the correct location to help cmake find it (do this in 'schebang.bat' with a -DBOOST_ROOT in the call to cmake (both debug and release)).