Difference between revisions of "Installing/Windows Build"

From Sumo
Jump to navigation Jump to search
(PNG support in Fox)
 
(42 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
This document describes how to build SUMO under MS-Windows using only freely
 
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 [[Installing/Linux Build|building on Linux]] pages. Please note that You may also [[Downloads|download pre-build Windows binaries]].
+
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 [[Installing/Linux Build|building on Linux]] pages. Please note that you may also [[Downloads|download pre-built Windows binaries]].
 +
== Recommended Windows setup ==
 +
*Download [https://www.visualstudio.com/vs/community/ Visual C++ Community Edition]
 +
** Start the installer and select:
 +
*** Python Development (including native tools)
 +
*** C++ for desktop
 +
[[File:VSInstall.png]]
 +
* clone https://github.com/eclipse/sumo
 +
* go to team explorer
 +
** choose Manage Connections, then "Local Git"->Clone https://github.com/DLR-TS/SUMOLibraries
 +
** now CMake should start configuring, if not choose Project->"Generate Cache"
 +
** build all
 +
* set SUMO_HOME
 +
* Install Texttest https://ci.appveyor.com/project/behrisch/texttest/builds/27281341/job/gb7f6opi6npcvbxf/artifacts
  
Please read the whole document before you start, there are some detours and shortcuts included.
+
=== optional but still recommended steps ===
 +
* Install notepad++
 +
* Install TortoiseGit
 +
* Install Git command line tools (this is mandatory if you install TortoiseGit)
 +
* If you decide to use the Python which comes with Visual Studio
 +
** Test start a python script and add association
 +
** Add Python to the path (also the Scripts dir), find it at C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64
 +
** Install pyautogui, matplotlib, rtree, pyproj, lxml following the instructions https://docs.microsoft.com/en-us/visualstudio/python/tutorial-working-with-python-in-visual-studio-step-05-installing-packages?view=vs-2019
 +
* If not use <code>pip install pyautogui, matplotlib, rtree, pyproj, lxml</code>
 +
* (after 30 days) Setup a Microsoft account (if you do not already have one) and register your Visual Studio
  
If you do not need the GUI, you can skip everything concerning Fox.
+
== Short overview ==
If you do not need precise geodata conversion, you can skip everything concerning GDAL, Proj and FWTools.
+
*Download [https://www.visualstudio.com/vs/community/ Visual C++ Community Edition]. SUMO is only compatible with Visual Studio 2013 or higher. If you are using Windows 8 or later be sure to download Visual Studio for Windows ''Desktop''. Please install all the available Service Packs for Visual Studio as well. Note that with Visual Studio Community 2017 SUMO only can be compiled '''in Release Mode'''.  
 
+
*[http://www.python.org/download/ Download Python for Windows] and install it. Our most preferred version is Python 2.7.x for the 32 bit platform, but you may try Python 3 and / or 64bit as well. Please be aware that the test environment needs Python 2.7 32bit
*Download [https://www.microsoft.com/germany/msdn/vstudio/products/express/download.mspx Visual C++ 2010 Express Edition] (or a newer one). (There is no need to install a separate [http://en.wikipedia.org/wiki/Microsoft_Windows_SDK 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.
+
{{Note|If you have Visual Studio 2017 you may skip the following steps and jump to [[Installing/Windows_Build#Doing_everything_inside_Visual_Studio]]}}
*[http://www.python.org/download/ 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 and install [https://cmake.org/download/ CMake]
*Download the [http://xml.apache.org/xerces-c/ Xerces-C] prebuilt [http://xerces.apache.org/xerces-c/download.cgi binaries] for your Visual Studio version (for VS 2010 you need the *windows-vc-10.0.zip), the [http://www.fox-toolkit.org/ Fox] sources ([http://www.fox-toolkit.org/ftp/fox-1.6.36.zip Version 1.6.36] is confirmed to work) and either the binary packages provided at http://www.gisinternals.com/release.php or [http://download.osgeo.org/proj/ PROJ] and [http://trac.osgeo.org/gdal/wiki/DownloadSource GDAL] sources separately. You may also try FWTools (see below).
+
*Download and install [https://git-scm.com/download/win Git]
*Note on installation paths: MSVC seems to have difficulties with include and library paths containing spaces (for instance <tt>C:\Program Files</tt>). Thus try to avoid installing any of the following libraries in such paths.
+
*Clone the sumo repository using <code>git clone https://github.com/eclipse/sumo</code> or download and extract a source package, see [[Downloads]]
 
+
**set SUMO_HOME to the cloned directory
Please note that for compiling from svn either [http://www.python.org/ 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.
+
*Install the [[#Libraries]] using <code>git clone https://github.com/DLR-TS/SUMOLibraries</code> and set the SUMO_LIBRARIES environment variable
 +
*Run the CMake-GUI and set the source path and define a build directory, for more details see [[Installing/Windows_CMake]]
 +
*Press Configure, select the Visual Studio 2017 Win64 Generator, then press Generate and Open Project
 +
*Compile SUMO in the opened Visual Studio
  
 +
== Doing everything inside Visual Studio 2017 (or later) ==
 +
Visual Studio 2017 already brings git and CMake support, so you can
 +
*Team->Manage Connections and then choose Clone under Local Git repositories (see here for an [https://docs.microsoft.com/en-us/azure/devops/repos/git/gitquickstart Introduction to Git usage with Visual Studio] including updating and comitting)
 +
** once for https://github.com/eclipse/sumo
 +
** then for https://github.com/DLR-TS/SUMOLibraries
 +
*Visual Studio will try to generate the solutions using CMake automatically
 +
** will fail at first try if SUMOLibraries is not cloned yet or is in an unusual location (it does not find Xerces)
 +
** Select CMake->Generate to try again (it is Project->"Generate Cache" in VS 2019)
 +
*** If it still fails, edit CMakeCache.txt from the CMake menu and set the path (e.g. SUMO_LIBRARIES:PATH=C:/Users/testus/source/repos/SUMOLibraries) and retry
 +
*Select CMake->"Build All" (Build->"BuildAll" in VS 2019)
  
 
==Libraries==
 
==Libraries==
===Xerces-C===
+
We provide a central location for getting all dependent libraries at https://github.com/DLR-TS/SUMOLibraries. The easiest way is to clone this repository and define an environment variable <code>SUMO_LIBRARIES</code> pointing to the resulting directory. They are built with Visual Studio 2017, but may be used with earlier and later versions as well. You may need to install the Visual C++ 2017 Runtime Distributable for running SUMO then (tested with Visual Studio 2013). For details on building your own and also on how to use different versions and additional libraries see [[Installing/Windows_Libraries]]. Make sure that the subdirectories <code>fox-1.6.54/lib</code>, <code>proj_gdal-1911/bin</code> and <code>xerces-c-3.2.0/bin</code> are in PATH. Note: for 32 bits compilations folders are <code>32bits/fox-1.6.54/lib</code>, <code>32bits/proj_gdal-1911/bin</code> and <code>32bits/xerces-c-3.2.0/bin</code>. You can add both to the path but always add the 64 bit version first.
Up to (and including) SUMO 0.10.3 (precisely up to svn revision 6993) SUMO used Xerces-C 2.8 by default, now it uses Xerces-C 3.1.1. The changes needed to compile with a different Xerces version should be limited to changing [http://apps.sourceforge.net/trac/sumo/browser/trunk/sumo/src/windows_config.h src/windows_config.h], [http://apps.sourceforge.net/trac/sumo/browser/trunk/sumo/build/msvc10/Win32.props build/msvc10/Win32.props] and / or [http://apps.sourceforge.net/trac/sumo/browser/trunk/sumo/build/msvc10/x64.props build/msvc10/x64.props].
 
*You just need to install [http://www.apache.org/dist/xerces/c/3/binaries/xerces-c-3.1.1-x86-windows-vc-10.0.zip the binary Xerces 3.1.1 distribution] or its [http://www.apache.org/dist/xerces/c/3/binaries/xerces-c-3.1.1-x86_64-windows-vc-10.0.zip 64bit version] for the 64bit build.
 
*Create a environment variable XERCES pointing to your xerces-c directory, e.g.
 
set XERCES=D:\libs\xerces-c-3.1.1-x86-windows-vc-10.0.
 
*Copy dll-files <code>%XERCES%\bin\xerces-c_3_1.dll</code> and <code>%XERCES%\bin\xerces-c_3_1D.dll</code> to some directory which is in your PATH (last resort: into Windows' system32 directory).
 
*For the 64bit build the name of the variable is XERCES_64
 
 
 
===Fox===
 
*If you do not need a GUI, you can skip this section.
 
*Up to (and including) SUMO 0.10.3 (precisely up to svn revision 7025) SUMO used Fox 1.4, now it uses Fox 1.6. The building instructions are the same just replace 1.6 by 1.4 (and FOX16 by FOX14) wherever you need it.
 
*Go to the Fox directory and open the VC project e.g. D:\libs\fox-1.6.36\windows\vcpp\win32.dsw.
 
**If you are using the Visual Studio 10.0 ''Express'' version, it cannot convert the project directly, you will need an intermediate Visual Studio 8.0 conversion
 
*Confirm the conversion to VC 10.0 and build the foxdll project as "release and debug" (if you think you might wish to use the Visual Studio debugger) version. If you want to build for the 64bit platform you need to add a new configuration to the foxdll project using the [http://msdn.microsoft.com/en-us/library/t1hy4dhz(VS.80).aspx Configuration Manager].
 
*You might get approximately 240 warnings and one error, which can be ignored.
 
*Errors on not finding windows.h mean the SDK was not installed properly.
 
*Create an environment variable FOX16 pointing to your Fox directory, e.g.
 
set FOX16=D:\libs\fox-1.6.36.
 
*Copy dll-files <code>%FOX16%\libs\fox-1.6.36\lib\FOXDLL-1.6.dll</code> and <code>%FOX16%\lib\FOXDLLD-1.6.dll</code> to some directory which is in your PATH (last resort: into Windows' system32 directory).
 
 
 
====PNG support in Fox====
 
*Warning: This is a little advanced, we were successful with libpng 1.5.2 and 1.6.20 together with zlib 1.2.5 and 1.2.8
 
*download zlib sources and libpng sources from [http://ftp.fox-toolkit.org/pub/] or from [http://www.libpng.org/pub/png/libpng.html] and [http://www.zlib.net/]
 
*unzip all zips
 
*there is no need to build zlib
 
*build pnglib by first adapting the path in <libpng>\projects\vstudio\zlib.props (if necessary) and then use the vstudio.sln from the same dir to build the libpng project
 
*you will get a png lib and a dll in <libpng>\projects\vstudio\Debug\
 
*if you want to be really sure, you can build the pngtest project as well and check the output
 
*you can build / add futher configurations / platforms if needed
 
*Open the Fox project solution and edit properties of foxdll
 
**in the C++/General section add the <libpng> dir to the include path
 
**in the C++/Preprocessor section add the HAVE_PNG_H define
 
**in the Linker/Input section add the .lib file to the input
 
*recompile fox and put the resulting dll together with libpng dll in your path
 
 
 
====JPEG support in Fox====
 
*Warning: This is a little advanced, we were successful with jpeg 8d, and 9b the jpeg 8c which can be found at the fox-toolkit site was broken
 
*download libjpeg sources from [http://www.ijg.org/] and unzip it
 
*download [http://www.bvbcode.com/code/f2kivdrh-395674-down win32.mak] and place it in the jpeg dir
 
*open a visual studio command prompt, cd to the jpeg dir and execute
 
nmake /f makefile.vc setup-v10
 
nmake /f makefile.vc
 
*you will get a libjpeg lib (and no dll!) in the jpeg dir
 
*if you need different configurations / platforms you can also open the solution file jpeg.sln and build jpeg from the GUI
 
 
 
*Open the Fox project solution and edit properties of foxdll
 
**in the C++/General section add the jpeg dir to the include path
 
**in the C++/Preprocessor section add the HAVE_JPEG_H define
 
**in the Linker/Input section add the .lib file to the input
 
*recompile foxdll (see above) and put the resulting dll (which has jpeg support linked statically inside) in your path
 
 
 
===PROJ and GDAL===
 
If you do not need transformation of geocoordinates you can disable PROJ and GDAL in [http://apps.sourceforge.net/trac/sumo/browser/trunk/sumo/build/msvc10/Win32.props build/msvc10/Win32.props] and / or [http://apps.sourceforge.net/trac/sumo/browser/trunk/sumo/build/msvc10/x64.props build/msvc10/x64.props]
 
(remove the UserMacros lines referencing the relevant *.lib files and remove the Preprocessor definitions HAVE_PROJ and/or HAVE_GDAL)
 
and skip this section.
 
Otherwise you have the choice between downloading the binary packages by Tamas Szekeres (preferred choice), the FWTools distribution (a little outdated) or compiling for yourself (for the adventurous). Building from source should only be necessary if you want a 64bit build or if you want to ship a copy of the SUMO executable(s) without the need to ship the FWTools as well.
 
====Tamas Szekeres binary packages at http://www.gisinternals.com/release.php====
 
*Choose the latest stable release and then the [http://download.gisinternals.com/sdk/downloads/release-1600-gdal-1-11-1-mapserver-6-4-1.zip binaries zip] and the [http://download.gisinternals.com/sdk/downloads/release-1600-gdal-1-11-1-mapserver-6-4-1-libs.zip libs zip] (links valid for MSVC10 as of 31/8/2015)
 
*unzip the zips in a directory of your choice (lets say D:\libs\proj_gdal) and set PROJ_GDAL=D:\libs\proj_gdal.
 
*Add <code>%PROJ_GDAL%\bin</code> to your PATH (or copy the contents to some directory in your PATH).
 
====FWTools (very outdated)====
 
*Just execute the binary and select a target directory.
 
*Create a environment variable PROJ_GDAL pointing to that directory, e.g.
 
set PROJ_GDAL=D:\libs\FWTools1.1.3.
 
*Add <code>%PROJ_GDAL%\bin</code> to your PATH (or copy the contents to some directory in your PATH).
 
====Building from source====
 
If you want to build PROJ and GDAL yourself for some reason, please follow the relevant [http://trac.osgeo.org/proj/browser/trunk/proj/README build instructions for PROJ] and [http://trac.osgeo.org/gdal/wiki/BuildingOnWindows for GDAL]. You then should install in a common directory and let the PROJ_GDAL variable point to it as above.
 
You should also copy proj.dll and gdal*.dll to a directory in your PATH.
 
  
If you do or download a 64bit build, the name of the environment variable needs to be PROJ_GDAL_64.
+
==Tests==
 
 
===ffmpeg===
 
This is only needed, if you want to save videos directly from the sumo-gui (it currently works with the internal version only).
 
*You just need to install [http://ffmpeg.zeranoe.com/builds/ the binary ffmpeg distributions] in the Shared and the Dev flavor. Also be sure to download all the platforms (32 and/or 64 bit) you need.
 
*Unzip the Dev version and create a environment variable FFMPEG pointing to the  directory, e.g.
 
set FFMPEG=D:\libs\ffmpeg-2.8.3-win32-dev.
 
*Unzip the Share version and copy the dll-files from the bin directory to some directory which is in your PATH (last resort: into Windows' system32 directory).
 
*For the 64bit build the name of the variable is FFMPEG_64, e.g.
 
set FFMPEG_64=D:\libs\ffmpeg-2.8.3-win64-dev.
 
*Probably due to a bug in Visual Studio 2010 the resulting sumo-gui works only if debugging symbols are generated (which is the default for the Debug and the Fastbuild but not for the Release)! If your executable does not start or complains about missing symbols, double check whether it is enabled in the linker settings (currently it is for the 64 bit internal release).
 
 
 
==SUMO==
 
===Configuration===
 
*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.
 
===Build===
 
*Open the project sumo\build\msvc10\prj.sln and build the [[#Available configurations|configurations]] you need.
 
===Test===
 
 
*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.
 
*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.
  
 
==Troubleshooting==
 
==Troubleshooting==
 +
*Note on installation paths: MSVC seems to have difficulties with include and library paths containing spaces (for instance <tt>C:\Program Files</tt>). Thus try to avoid installing SUMO or any of the libraries in such paths.
 
===Linker reports something similar to "LINK : fatal error LNK1104: cannot open file 'C:\Program.obj'"===
 
===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 (").<br/>Example: set FOX="D:\my libs\fox-1.6.36".
 
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 (").<br/>Example: set FOX="D:\my libs\fox-1.6.36".
  
===Failure on pre-build event===
+
===Failure on pre-build event (missing version.h or *typemap.h)===
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
+
If Visual Studio reports a failed pre-build event you can safely ignore this, unless you are building from the [[FAQ#How_do_I_access_the_code_repository.3F|source code 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 via tools/build/version.py to fail. Either repair your file associations or undefine HAVE_VERSION_H in src/windows_config.h.
 +
 
 +
If you did install Python correctly, double check that it passes [http://stackoverflow.com/questions/2640971/windows-is-not-passing-command-line-arguments-to-python-programs-executed-from-t command line arguments]. For a quick fix, you can also execute the following commands manually:
 +
tools\build\version.py
 +
tools\build\typemap.py
 +
 
 +
===Execution cannot proceed because MSVCR120.dll/MSVCR140.dll was not found===
 +
Install Microsoft [https://www.microsoft.com/en-US/download/details.aspx?id=30679 Visual C++ Redistributable Packages for Visual Studio 2012] (for MSVCR120.dll) or [https://www.visualstudio.com/downloads/ Microsoft Visual C++ Redistributable Packages for Visual Studio 2015] (for MSVCR140.dll). You can check if all dependences are correct using [https://lucasg.github.io/Dependencies/ Dependencies]
  
 +
<gallery widths="400px" heights="280px" perrow="5">
 +
Image:Dependencies.png
 +
</gallery>
 +
 +
===In debug mode, execution cannot proceed because MSVCR120D.dll/MSVCR140D.dll was not found===
 +
Your version of Visual Studio doesn't support Debugging, only can be compiled in release mode.
  
 
== Available configurations ==
 
== Available configurations ==
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 [[Developer/Tests|Texttest]] usually picks up the release build.
+
The release build is used for the distribution of sumo. The Debug build allows all debugging features. Keep in mind that [[Developer/Tests|Texttest]] usually picks up the release build.
  
 
* Release:  All optimizations, assertions disabled, no debugging symbols, links against external release libs
 
* 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
 
* 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.
+
Left clicking over Solution/Properties/Configuration Manager allow to change between configurations:
 +
 
 +
<gallery widths="450px" heights="280px" perrow="5">
 +
Image:swichDebugRelease.png
 +
</gallery>
 +
 
 +
To switch to a different platform (e.g. 32bit instead of 64 bit) please run cmake again with a different generator.
 +
 
 +
Naming Conventions: 64bit executables have the same name as their 32bit counterpart. The Debug build additionally carries the suffix 'D'.

Latest revision as of 19:56, 9 September 2019

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-built Windows binaries.

Recommended Windows setup

VSInstall.png

optional but still recommended steps

  • Install notepad++
  • Install TortoiseGit
  • Install Git command line tools (this is mandatory if you install TortoiseGit)
  • If you decide to use the Python which comes with Visual Studio
  • If not use pip install pyautogui, matplotlib, rtree, pyproj, lxml
  • (after 30 days) Setup a Microsoft account (if you do not already have one) and register your Visual Studio

Short overview

  • Download Visual C++ Community Edition. SUMO is only compatible with Visual Studio 2013 or higher. If you are using Windows 8 or later be sure to download Visual Studio for Windows Desktop. Please install all the available Service Packs for Visual Studio as well. Note that with Visual Studio Community 2017 SUMO only can be compiled in Release Mode.
  • Download Python for Windows and install it. Our most preferred version is Python 2.7.x for the 32 bit platform, but you may try Python 3 and / or 64bit as well. Please be aware that the test environment needs Python 2.7 32bit
Note:
If you have Visual Studio 2017 you may skip the following steps and jump to Installing/Windows_Build#Doing_everything_inside_Visual_Studio
  • Download and install CMake
  • Download and install Git
  • Clone the sumo repository using git clone https://github.com/eclipse/sumo or download and extract a source package, see Downloads
    • set SUMO_HOME to the cloned directory
  • Install the #Libraries using git clone https://github.com/DLR-TS/SUMOLibraries and set the SUMO_LIBRARIES environment variable
  • Run the CMake-GUI and set the source path and define a build directory, for more details see Installing/Windows_CMake
  • Press Configure, select the Visual Studio 2017 Win64 Generator, then press Generate and Open Project
  • Compile SUMO in the opened Visual Studio

Doing everything inside Visual Studio 2017 (or later)

Visual Studio 2017 already brings git and CMake support, so you can

  • Team->Manage Connections and then choose Clone under Local Git repositories (see here for an Introduction to Git usage with Visual Studio including updating and comitting)
  • Visual Studio will try to generate the solutions using CMake automatically
    • will fail at first try if SUMOLibraries is not cloned yet or is in an unusual location (it does not find Xerces)
    • Select CMake->Generate to try again (it is Project->"Generate Cache" in VS 2019)
      • If it still fails, edit CMakeCache.txt from the CMake menu and set the path (e.g. SUMO_LIBRARIES:PATH=C:/Users/testus/source/repos/SUMOLibraries) and retry
  • Select CMake->"Build All" (Build->"BuildAll" in VS 2019)

Libraries

We provide a central location for getting all dependent libraries at https://github.com/DLR-TS/SUMOLibraries. The easiest way is to clone this repository and define an environment variable SUMO_LIBRARIES pointing to the resulting directory. They are built with Visual Studio 2017, but may be used with earlier and later versions as well. You may need to install the Visual C++ 2017 Runtime Distributable for running SUMO then (tested with Visual Studio 2013). For details on building your own and also on how to use different versions and additional libraries see Installing/Windows_Libraries. Make sure that the subdirectories fox-1.6.54/lib, proj_gdal-1911/bin and xerces-c-3.2.0/bin are in PATH. Note: for 32 bits compilations folders are 32bits/fox-1.6.54/lib, 32bits/proj_gdal-1911/bin and 32bits/xerces-c-3.2.0/bin. You can add both to the path but always add the 64 bit version first.

Tests

  • 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.

Troubleshooting

  • 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 SUMO or any of the libraries in such paths.

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 (missing version.h or *typemap.h)

If Visual Studio reports a failed pre-build event you can safely ignore this, unless you are building from the source code 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 via tools/build/version.py to fail. Either repair your file associations or undefine HAVE_VERSION_H in src/windows_config.h.

If you did install Python correctly, double check that it passes command line arguments. For a quick fix, you can also execute the following commands manually:

tools\build\version.py
tools\build\typemap.py

Execution cannot proceed because MSVCR120.dll/MSVCR140.dll was not found

Install Microsoft Visual C++ Redistributable Packages for Visual Studio 2012 (for MSVCR120.dll) or Microsoft Visual C++ Redistributable Packages for Visual Studio 2015 (for MSVCR140.dll). You can check if all dependences are correct using Dependencies

In debug mode, execution cannot proceed because MSVCR120D.dll/MSVCR140D.dll was not found

Your version of Visual Studio doesn't support Debugging, only can be compiled in release mode.

Available configurations

The release build is used for the distribution of sumo. 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
  • Debug: No optimizations, assertions enabled, debugging symbols included, links against external debug libs

Left clicking over Solution/Properties/Configuration Manager allow to change between configurations:

To switch to a different platform (e.g. 32bit instead of 64 bit) please run cmake again with a different generator.

Naming Conventions: 64bit executables have the same name as their 32bit counterpart. The Debug build additionally carries the suffix 'D'.