This document describes how to build SUMO under MS-Windows using only freely available (this does not mean "open source") tools. Instructions on how to build SUMO on Windows using an Open Source toolchain are included in our building on Linux pages. Please note that You may also download pre-build Windows binaries.
Please read the whole document before you start, there are some detours and shortcuts included.
If you do not need the GUI, you can skip everything concerning Fox. If you do not need precise geodata conversion, you can skip everything concerning GDAL, Proj and FWTools.
- Download Visual C++ 2010 Express Edition (or a newer one). (There is no need to install a separate Platform SDK any longer.) If you are using Windows 8 be sure to download Visual Studio Express for Windows Desktop and not Visual Studio Express for Windows 8. Please install all the available Service Packs for Visual Studio as well.
- Download Python for Windows and install it. It is used to dynamically include the SVN revision into compilation. (The build will work without it, but you may see nasty warnings and even editor windows popping up.) Python 3 won't work, we use Python 2.7.
- Download the Xerces-C prebuilt binaries for your Visual Studio version (for VS 2010 you need the *windows-vc-10.0.zip), the Fox sources (Version 1.6.36 is confirmed to work) and either the binary packages provided at http://www.gisinternals.com/release.php or PROJ and GDAL sources separately. You may also try FWTools (see below).
- Note on installation paths: MSVC seems to have difficulties with include and library paths containing spaces (for instance C:\Program Files). Thus try to avoid installing any of the following libraries in such paths.
Please note that for compiling from svn either Python has to be installed on your system (which is a good idea, because also many SUMO tools are Python scripts) or you have to undefine HAVE_VERSION_H in src/windows_config.h.
There are two ways of telling the SUMO build where to find its libraries. Either via environment variables or by editing a config file. This document only describes the latter (easier) way, for details on the former and also on how to use different versions and additional libraries see Installing/Windows_Libraries.
- If you installed all libraries and defined the environment variables correctly there is no need for further configuration and you can skip to the build section.
- The Visual Studio build is configured using .props files in the build/msvc10 subdirectory. If you change some settings which should apply to all subprojects, be sure to edit those files (either with a text editor or the property manager of Visual Studio) and not the project configuration (.vcxproj).
- If you do not like to define the places of the includes and libraries via environment variables you can enter the location directly into x64.props or Win32.props (or both, depending on your target platforms). You should also disable PROJ and GDAL in those files (if you don't need them) by setting the value for the appropriate "LIB" Usermacro to the empty string.
- Open the project sumo\build\msvc10\prj.sln and build the configurations you need.
- If you plan to extend SUMO yourself, or just want to know whether everything compiled OK, it is strongly recommended to have a look at Developer/Tests. This tool makes it easier to check whether some existing functionality was broken by the extensions.
Linker reports something similar to "LINK : fatal error LNK1104: cannot open file 'C:\Program.obj'"
You probably have installed a library to a path containing white spaces in its name. In such a case, the according environment variable should be embedded in quotes (").
Example: set FOX="D:\my libs\fox-1.6.36".
Failure on pre-build event
If Visual Studio reports a failed pre-build event you can safely ignore this, unless you are building from the subversion repository. In this case you should probably install Python. Even if python is installed the file associations may be broken which causes the generation of src/version.h vial tools/build/version.py to fail. Either repair your file associations or undefine HAVE_VERSION_H in src/windows_config.h
The release build is used for the distribution of sumo. The Fastbuild is suitable for frequent recompilation and the Debug build allows all debugging features. Keep in mind that Texttest usually picks up the release build.
- Release: All optimizations, assertions disabled, no debugging symbols, links against external release libs
- Fastbuild: Fewer optimizations, assertions disabled, debugging symbols included, links against external release libs
- Debug: No optimizations, assertions enabled, debugging symbols included, links against external debug libs
Naming Conventions: executables, built with 64bit build carry the '64' suffix. The Debug build additionally carries the suffix 'D' whereas the Fastbuild uses the 'F' suffix.