Difference between revisions of "Installing/Windows Build"

From Sumo
Jump to navigation Jump to search
(moved libraries to separate page)
Line 5: Line 5:
  
 
If you do not need the GUI, you can skip everything concerning Fox.
 
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.
+
If you do not need precise geodata conversion, you can skip everything concerning GDAL, Proj.
  
*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.
+
*Download [https://www.microsoft.com/germany/msdn/vstudio/products/express/download.mspx Visual C++ Express Edition]. If you are using Windows 8 or later be sure to download Visual Studio Express for Windows ''Desktop''. Please install all the available Service Packs for Visual Studio as well.
*[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.
+
*[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.  
*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 extract [http://prdownloads.sourceforge.net/sumo/sumo-src-svn.zip?download sumo-src-svn.zip] or a different version (or use a repository checkout, see [[Downloads]])
*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.
+
*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.
  
 
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.
 
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.
Line 16: Line 16:
 
==Libraries==
 
==Libraries==
 
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]].
 
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]].
 
+
*Download the [http://xml.apache.org/xerces-c/ Xerces-C] and [http://www.fox-toolkit.org/ Fox] prebuilt [http://sourceforge.net/projects/sumo/files/dependencies/ binaries] and extract them.
 +
** For Win32 build with Visual Studio 2013 you currently need http://sourceforge.net/projects/sumo/files/dependencies/xerces-c-3.1.2vc12.zip/download and http://sourceforge.net/projects/sumo/files/dependencies/fox-1.6.50vc12.zip/download
 +
**They are build for Visual Studio 2013, but may be used with earlier versions as well. You may need to install the Visual C++ 2013 Runtime Distributable for running SUMO then (tested with Visual Studio 2010).
 +
*Download the binary packages for PROJ and GDAL provided at http://www.gisinternals.com/release.php
 +
**For Win32 build with Visual Studio 2013 you currently need http://download.gisinternals.com/sdk/downloads/release-1800-gdal-1-11-3-mapserver-6-4-2.zip and http://download.gisinternals.com/sdk/downloads/release-1800-gdal-1-11-3-mapserver-6-4-2-libs.zip
 +
**Create a new directory and extract both files into that dir (if you download 64bit as well, create a separate dir and extract them there)
 +
*Execute <SUMO>/tools/build/pythonPropsMSVC.py
 +
*Edit the generated <SUMO>/build/msvc10/config.props and enter the paths of all the directories above. An example may look like this:
 +
<pre>
 +
<?xml version="1.0" encoding="utf-8"?>
 +
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 +
  <PropertyGroup Label="UserMacros">
 +
    <XERCES>D:\behr_mi\lib\xerces-c-3.1.2</XERCES>
 +
    <PROJ_GDAL>D:\behr_mi\lib\release-1800-gdal-1-11-3-mapserver-6-4-2</PROJ_GDAL>
 +
    <FOX16>D:\behr_mi\lib\fox-1.6.50</FOX16>
 +
    <OSG>$(OSG)</OSG>
 +
    <FFMPEG>$(FFMPEG)</FFMPEG>
 +
    <PYTHON_LIB>C:\Python27\libs\python27.lib</PYTHON_LIB>
 +
    <PYTHON_DEBUG_LIB>C:\Python27\libs\python27.lib</PYTHON_DEBUG_LIB>
 +
    <PYTHON_INCLUDE_DIR>C:\Python27\include</PYTHON_INCLUDE_DIR>
 +
    <XERCES_64>D:\behr_mi\lib\xerces-c-3.1.2_64</XERCES_64>
 +
    <PROJ_GDAL_64>D:\behr_mi\lib\release-1800-x64-gdal-1-11-3-mapserver-6-4-2</PROJ_GDAL_64>
 +
    <FOX16_64>D:\behr_mi\lib\fox-1.6.50_64</FOX16_64>
 +
    <OSG_64>$(OSG_64)</OSG_64>
 +
    <FFMPEG_64>$(FFMPEG_64)</FFMPEG_64>
 +
    <PYTHON_64_LIB></PYTHON_64_LIB>
 +
    <PYTHON_64_DEBUG_LIB></PYTHON_64_DEBUG_LIB>
 +
    <PYTHON_64_INCLUDE_DIR></PYTHON_64_INCLUDE_DIR>
 +
  </PropertyGroup>
 +
</Project>
 +
</pre>
 +
*Add all directories containing dlls (XERCES\bin, PROJ_GDAL\bin, FOX16\lib) to your PATH or copy the dlls into a directory which is in your PATH.
 +
**If you build for 64 bit and for 32 bit be sure that you add both dirs and that you add the 64 bit dir before the 32 bit dir.
  
 
==SUMO==
 
==SUMO==
 
===Configuration===
 
===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.
+
*If you installed all libraries and edited the config.props (or 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).
 
*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.
+
*Even if you generated the config.props as above, you can still define the places of the includes and libraries via environment variables (just refer to them as in the example above). If you want to disable certain features, set the config entry to the empty string. Everything but Xerces is optional, but without Fox it is not possible to build the GUI related projects.
 
===Build===
 
===Build===
*Open the project sumo\build\msvc10\prj.sln and build the [[#Available configurations|configurations]] you need.
+
*Open the project <SUMO>\build\msvc10\prj.sln and build the [[#Available configurations|configurations]] you need.
 +
*You will find the results in <SUMO>\bin
 
===Test===
 
===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.
Line 33: Line 66:
  
 
===Failure on pre-build event===
 
===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
+
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 via tools/build/version.py to fail. Either repair your file associations or undefine HAVE_VERSION_H in src/windows_config.h
  
  
Line 43: Line 76:
 
* 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.
+
Naming Conventions: 64bit executables have the same name as their 32bit counterpart. The Debug build additionally carries the suffix 'D' whereas the Fastbuild uses the 'F' suffix.

Revision as of 10:40, 7 January 2016

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.

  • Download Visual C++ Express Edition. If you are using Windows 8 or later be sure to download Visual Studio Express for Windows Desktop. Please install all the available Service Packs for Visual Studio as well.
  • 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.
  • Download and extract sumo-src-svn.zip or a different version (or use a repository checkout, see Downloads)
  • 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.

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.

Libraries

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.

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Label="UserMacros">
    <XERCES>D:\behr_mi\lib\xerces-c-3.1.2</XERCES>
    <PROJ_GDAL>D:\behr_mi\lib\release-1800-gdal-1-11-3-mapserver-6-4-2</PROJ_GDAL>
    <FOX16>D:\behr_mi\lib\fox-1.6.50</FOX16>
    <OSG>$(OSG)</OSG>
    <FFMPEG>$(FFMPEG)</FFMPEG>
    <PYTHON_LIB>C:\Python27\libs\python27.lib</PYTHON_LIB>
    <PYTHON_DEBUG_LIB>C:\Python27\libs\python27.lib</PYTHON_DEBUG_LIB>
    <PYTHON_INCLUDE_DIR>C:\Python27\include</PYTHON_INCLUDE_DIR>
    <XERCES_64>D:\behr_mi\lib\xerces-c-3.1.2_64</XERCES_64>
    <PROJ_GDAL_64>D:\behr_mi\lib\release-1800-x64-gdal-1-11-3-mapserver-6-4-2</PROJ_GDAL_64>
    <FOX16_64>D:\behr_mi\lib\fox-1.6.50_64</FOX16_64>
    <OSG_64>$(OSG_64)</OSG_64>
    <FFMPEG_64>$(FFMPEG_64)</FFMPEG_64>
    <PYTHON_64_LIB></PYTHON_64_LIB>
    <PYTHON_64_DEBUG_LIB></PYTHON_64_DEBUG_LIB>
    <PYTHON_64_INCLUDE_DIR></PYTHON_64_INCLUDE_DIR>
  </PropertyGroup>
</Project>
  • Add all directories containing dlls (XERCES\bin, PROJ_GDAL\bin, FOX16\lib) to your PATH or copy the dlls into a directory which is in your PATH.
    • If you build for 64 bit and for 32 bit be sure that you add both dirs and that you add the 64 bit dir before the 32 bit dir.

SUMO

Configuration

  • If you installed all libraries and edited the config.props (or 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).
  • Even if you generated the config.props as above, you can still define the places of the includes and libraries via environment variables (just refer to them as in the example above). If you want to disable certain features, set the config entry to the empty string. Everything but Xerces is optional, but without Fox it is not possible to build the GUI related projects.

Build

  • Open the project <SUMO>\build\msvc10\prj.sln and build the configurations you need.
  • You will find the results in <SUMO>\bin

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.

Troubleshooting

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 via tools/build/version.py to fail. Either repair your file associations or undefine HAVE_VERSION_H in src/windows_config.h


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 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: 64bit executables have the same name as their 32bit counterpart. The Debug build additionally carries the suffix 'D' whereas the Fastbuild uses the 'F' suffix.