Difference between revisions of "Installing/Windows Build"

From Sumo
Jump to navigation Jump to search
(New page: This document describes how to build Sumo under Windows using only freely available (this does '''not''' mean "open source") tools. Due to incompatibilities between MSVC6 and MSVC8 it is v...)
 
Line 1: Line 1:
 
This document describes how to build Sumo under Windows using only freely
 
This document describes how to build Sumo under Windows using only freely
available (this does '''not''' mean "open source") tools. Due to incompatibilities
+
available (this does '''not''' mean "open source") tools. Please read the whole document before you start, there are some detours and shortcuts included.
between MSVC6 and MSVC8 it is very different from what can be read in the [http://sumo.sourceforge.net/docs/gen/sumo_howto_building.shtml#howto_build-windows-msvc6 Windows Build documentation].
 
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 the GUI, you can skip everything concerning Fox.
 
If you don't need precise Geodata conversion, you can skip everything concerning GDAL, Proj and FWTools.
 
If you don't need precise Geodata conversion, you can skip everything concerning GDAL, Proj and FWTools.
  
*Download [https://www.microsoft.com/germany/msdn/vstudio/products/express/download.mspx Visual C++ 2005 Express Edition] and the [http://en.wikipedia.org/wiki/Microsoft_Windows_SDK Platform SDK] and install them. Be sure to configure Visual Studio correctly to find the platform includes and libs.
+
*Download [https://www.microsoft.com/germany/msdn/vstudio/products/express/download.mspx Visual C++ 2005 Express Edition] (or a newer one) and the [http://en.wikipedia.org/wiki/Microsoft_Windows_SDK Platform SDK] and install them. Be sure to configure Visual Studio correctly to find the platform includes and libs.
 
*[http://www.python.org/ftp/python/2.5.1/python-2.5.1.msi Download Python] 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.)
 
*[http://www.python.org/ftp/python/2.5.1/python-2.5.1.msi Download Python] 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.)
*Download the [http://xml.apache.org/xerces-c/ Xerces-C] sources (I used [http://www.apache.org/dist/xml/xerces-c/xerces-c-current.tar.gz Version 2.7.0]), the [http://www.fox-toolkit.org/ Fox] sources (I used [http://prdownloads.sourceforge.net/sumo/fox-1.4.29.zip?download Version 1.4.29] and the [http://fwtools.maptools.org/ FWTools] including GDAL and PROJ (I used [http://www.gdal.org/dl/fwtools/FWTools113.exe Version 1.1.3]).
+
*Download the [http://xml.apache.org/xerces-c/ Xerces-C] sources (I used [http://www.apache.org/dist/xml/xerces-c/xerces-c-current.tar.gz Version 2.7.0]), the [http://www.fox-toolkit.org/ Fox] sources (I used [http://prdownloads.sourceforge.net/sumo/fox-1.4.29.zip?download Version 1.4.29]) and the [http://fwtools.maptools.org/ FWTools] including GDAL and PROJ (I used [http://www.gdal.org/dl/fwtools/FWTools113.exe Version 1.1.3]).
 
*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 any of the following libraries in such paths.
  

Revision as of 11:17, 17 March 2009

This document describes how to build Sumo under Windows using only freely available (this does not mean "open source") tools. 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 don't need precise Geodata conversion, you can skip everything concerning GDAL, Proj and FWTools.

  • Download Visual C++ 2005 Express Edition (or a newer one) and the Platform SDK and install them. Be sure to configure Visual Studio correctly to find the platform includes and libs.
  • Download Python 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.)
  • Download the Xerces-C sources (I used Version 2.7.0), the Fox sources (I used Version 1.4.29) and the FWTools including GDAL and PROJ (I used Version 1.1.3).
  • 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.

Everything described will only work with current SVN or with a release later than 0.9.5. 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

Xerces-C

  • For the brave: You may try the binary Xerces 2.8 distribution which was tested only in its 64bit version for the experimental 64bit build.
  • Following are the build instructions for Xerces 2.7 which is still the version we use for development.
  • It is not possible to use this binary distribution.
  • It is also not enough to follow the Xerces build instructions since after opening xerces-c-src_2_7_0\Projects\Win32\VC7.1\xerces-all\xerces-all.sln one has to edit xerces-c-src_2_7_0\src\xercesc\util\Platforms\Win32\Version.rc and change #include "winres.h" to #include "mfc/winres.h". --- I don't have to make this change, please try out.
  • Build the XercesLib project in the Release and the Debug configuration.
  • Create a directory lib inside xerces-c-src_2_7_0 and copy xerces-c-src_2_7_0\Build\Win32\VC7.1\Debug\xerces-c_2D.lib as well as xerces-c-src_2_7_0\Build\Win32\VC7.1\Release\xerces-c_2.lib to that location.
  • Copy the src tree to a directory named include under the same parent directory.
  • Create a environment variable XERCES pointing to your xerces-c directory, e.g.
set XERCES=D:\libs\xerces-c-src_2_7_0.
  • Copy dll-files %XERCES%\Build\Win32\VC7.1\Release\xerces-c_2_7.dll and %XERCES%\Build\Win32\VC7.1\Debug\xerces-c_2_7D.dll to some directory which is in your PATH (last resort: into windows' system32 directory).

Fox

  • If you don't need a GUI, you can skip this section.
  • Go to the Fox directory and open the VC project e.g. D:\libs\fox-1.4.29\windows\vcpp\win32.dsw.
  • Confirm the conversion to VC 8.0 and build all projects.
  • You will get approximately 240 warnings and one error, which can be ignored.
  • Errors on not finding windows.h mean You have not installed the SDK properly.
  • Create a environment variable FOX14 pointing to your Fox directory, e.g.
set FOX14=D:\libs\fox-1.4.29.
  • Copy dll-files %FOX14%\libs\fox-1.4.29\lib\FOXDLL-1.4.dll and %FOX14%\lib\FOXDLLD-1.4.dll to some directory which is in your PATH (last resort: into windows' system32 directory).

It works as well with the most recent fox release (1.4.35 as of 12.01.07).

FWTools

If you don't need transformation of geocoordinates you can disable proj and gdal in src/windows_config.h and skip this section.

  • 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.
  • Copy dll-file %PROJ_GDAL%\bin\proj_fw.dll to some directory which is in your PATH (last resort: into windows' system32 directory).

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 .vsprops files in the build/msvc8 subdirectory. If you change some setting 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 (.vcproj).
  • 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.vsprops or Win32.vsprops (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\msvc8\prj.sln and build the configurations you need.
  • The x64 build is still in experimental stage. It is configured not to use Proj, GDAL and Fox and therefore does not build the guisim.

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