Difference between revisions of "Installing/Windows Build"

From Sumo
Jump to navigation Jump to search
(updated information about FWTools versions)
Line 7: Line 7:
 
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] (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.
+
*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] and install any longer.)
*[http://www.python.org/ftp/python/2.5.4/python-2.5.4.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://python.org/ftp/python/2.7.1/python-2.7.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.)
Python 3 won't work, Python 2.6 may work but has not been tested yet.
+
Python 3 won't work, Python 2.5 and 2.6 may work.
*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 2005 you need the *windows-vc-8.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 [http://fwtools.maptools.org/ FWTools] ([http://home.gdal.org/fwtools/FWTools113.exe Version 1.1.3] should work, 2.4.7 mysteriously fails) or [http://download.osgeo.org/proj/ PROJ] and [http://trac.osgeo.org/gdal/wiki/DownloadSource GDAL] sources separately.
+
*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 [http://fwtools.maptools.org/ FWTools] ([http://home.gdal.org/fwtools/FWTools113.exe Version 1.1.3] should work) or [http://download.osgeo.org/proj/ PROJ] and [http://trac.osgeo.org/gdal/wiki/DownloadSource GDAL] sources separately.
 
*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.
  
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 [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 19: Line 19:
 
===Xerces-C===
 
===Xerces-C===
 
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.0.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/msvc8/Win32.vsprops build/msvc8/Win32.vsprops] and / or [http://apps.sourceforge.net/trac/sumo/browser/trunk/sumo/build/msvc8/x64.vsprops build/msvc8/x64.vsprops].
 
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.0.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/msvc8/Win32.vsprops build/msvc8/Win32.vsprops] and / or [http://apps.sourceforge.net/trac/sumo/browser/trunk/sumo/build/msvc8/x64.vsprops build/msvc8/x64.vsprops].
*You just need to install [http://www.apache.org/dist/xerces/c/3/binaries/xerces-c-3.0.1-x86-windows-vc-8.0.zip the binary Xerces 3.0.1 distribution] or its [http://www.apache.org/dist/xerces/c/3/binaries/xerces-c-3.0.1-x86_64-windows-vc-8.0.zip 64bit version] for the 64bit build.
+
*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.
 
*Create a environment variable XERCES pointing to your xerces-c directory, e.g.
  set XERCES=D:\libs\xerces-c-3.0.1-x86-windows-vc-8.0.
+
  set XERCES=D:\libs\xerces-c-3.1.1-x86-windows-vc-10.0.
*Copy dll-files <code>%XERCES%\bin\xerces-c_3_0.dll</code> and <code>%XERCES%\bin\xerces-c_3_0D.dll</code> to some directory which is in your PATH (last resort: into windows' system32 directory).
+
*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
 
*For the 64bit build the name of the variable is XERCES_64
  
Line 29: Line 29:
 
*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) whereever you need it.
 
*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) whereever 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.
 
*Go to the fox directory and open the VC project e.g. D:\libs\fox-1.6.36\windows\vcpp\win32.dsw.
*Confirm the conversion to VC 8.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].
+
*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.
 
*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.
 
*Errors on not finding windows.h mean the SDK was not installed properly.
Line 37: Line 37:
  
 
===PROJ and GDAL===
 
===PROJ and GDAL===
If you don't need transformation of geocoordinates you can disable proj and gdal in [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/msvc8/Win32.vsprops build/msvc8/Win32.vsprops] and / or [http://apps.sourceforge.net/trac/sumo/browser/trunk/sumo/build/msvc8/x64.vsprops build/msvc8/x64.vsprops] and skip this section.
+
If you don't need transformation of geocoordinates you can disable proj and gdal in [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] and skip this section.
Otherwise you have the choice between downloading the binary FWTools distribution or compiling for yourself. Building from source
+
Otherwise you have the choice between downloading the binary FWTools distribution or compiling for yourself. 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.
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.
 
 
====FWTools====
 
====FWTools====
 
*Just execute the binary and select a target directory.
 
*Just execute the binary and select a target directory.
Line 54: Line 53:
 
===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 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).
+
*The Visual Studio build is configured using .props files in the build/msvc10 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 (.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.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.
+
*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===
 
===Build===
*Open the project sumo\build\msvc8\prj.sln and build the configurations you need.
+
*Open the project sumo\build\msvc10\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==
 
==Troubleshooting==
 
===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.4.29".
+
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===
 
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.
 
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.

Revision as of 07:06, 20 April 2011

This document describes how to build Sumo under 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 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++ 2010 Express Edition (or a newer one). (There is no need to install a separate Platform SDK and install any longer.)
  • 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.)

Python 3 won't work, Python 2.5 and 2.6 may work.

  • 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 FWTools (Version 1.1.3 should work) or PROJ and GDAL sources separately.
  • 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.


Libraries

Xerces-C

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.0.1. The changes needed to compile with a different xerces version should be limited to changing src/windows_config.h, build/msvc8/Win32.vsprops and / or build/msvc8/x64.vsprops.

set XERCES=D:\libs\xerces-c-3.1.1-x86-windows-vc-10.0.
  • Copy dll-files %XERCES%\bin\xerces-c_3_1.dll and %XERCES%\bin\xerces-c_3_1D.dll 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 don't 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) whereever 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.
  • 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 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 a environment variable FOX16 pointing to your fox directory, e.g.
set FOX16=D:\libs\fox-1.6.36.
  • Copy dll-files %FOX16%\libs\fox-1.6.36\lib\FOXDLL-1.6.dll and %FOX16%\lib\FOXDLLD-1.6.dll to some directory which is in your PATH (last resort: into windows' system32 directory).

PROJ and GDAL

If you don't need transformation of geocoordinates you can disable proj and gdal in src/windows_config.h, build/msvc10/Win32.props and / or build/msvc10/x64.props and skip this section. Otherwise you have the choice between downloading the binary FWTools distribution or compiling for yourself. 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.

FWTools

  • 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 %PROJ_GDAL%\bin to your PATH (or copy the contents to some directory in your PATH).

Building from source

If you want to build for some reason PROJ and GDAL yourself, please follow the relevant build instructions for PROJ and for GDAL. You should install in a common directory then 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 a 64bit build, the name of the environment variable needs to be PROJ_GDAL_64.

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 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 (.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 configurations you need.

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.