当我尝试从在线来源安装 sumo 时:
git clone --recursive https://github.com/eclipse/sumo
使用 ubuntu 版本 16.04.7 LTS(Xenial Xerus)时出现以下错误:
[ 72%] Building CXX object src/libtraci/CMakeFiles/libtracistatic.dir/MeanData.cpp.o
[ 72%] Building CXX object src/libtraci/CMakeFiles/libtracistatic.dir/OverheadWire.cpp.o
[ 72%] Building CXX object src/libtraci/CMakeFiles/libtracistatic.dir/Simulation.cpp.o
[ 72%] Building CXX object src/libtraci/CMakeFiles/libtracistatic.dir/TrafficLight.cpp.o
[ 72%] Building CXX object src/libtraci/CMakeFiles/libtracistatic.dir/Vehicle.cpp.o
[ 72%] Building CXX object src/libtraci/CMakeFiles/libtracistatic.dir/VehicleType.cpp.o
[ 73%] Linking CXX static library ../../../../bin/libtracistatic.a
[ 73%] Built target libtracistatic
Scanning dependencies of target libtracicpp
[ 73%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Connection.cpp.o
[ 73%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Edge.cpp.o
[ 73%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/GUI.cpp.o
[ 73%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/InductionLoop.cpp.o
[ 73%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Junction.cpp.o
[ 73%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Lane.cpp.o
[ 73%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/LaneArea.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/MultiEntryExit.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Person.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/POI.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Polygon.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Route.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Calibrator.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/BusStop.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/ParkingArea.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/ChargingStation.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/RouteProbe.cpp.o
[ 74%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Rerouter.cpp.o
[ 75%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/VariableSpeedSign.cpp.o
[ 75%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/MeanData.cpp.o
[ 75%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/OverheadWire.cpp.o
[ 75%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Simulation.cpp.o
[ 75%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/TrafficLight.cpp.o
[ 75%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/Vehicle.cpp.o
[ 75%] Building CXX object src/libtraci/CMakeFiles/libtracicpp.dir/VehicleType.cpp.o
[ 75%] Linking CXX shared library ../../../../bin/libtracicpp.so
[ 75%] Built target libtracicpp
[ 75%] Swig source
Scanning dependencies of target _libtraci
[ 75%] Building CXX object src/libtraci/CMakeFiles/_libtraci.dir/__/__/tools/libtraci/libtraciPYTHON_wrap.cxx.o
[ 75%] Linking CXX shared module ../../../../tools/libtraci/_libtraci.so
[ 75%] Built target _libtraci
Scanning dependencies of target marouter
[ 75%] Building CXX object src/marouter/CMakeFiles/marouter.dir/marouter_main.cpp.o
[ 75%] Building CXX object src/marouter/CMakeFiles/marouter.dir/ROMAAssignments.cpp.o
[ 75%] Building CXX object src/marouter/CMakeFiles/marouter.dir/ROMAEdge.cpp.o
[ 75%] Building CXX object src/marouter/CMakeFiles/marouter.dir/ROMAEdgeBuilder.cpp.o
[ 75%] Building CXX object src/marouter/CMakeFiles/marouter.dir/ROMAFrame.cpp.o
[ 75%] Building CXX object src/marouter/CMakeFiles/marouter.dir/ROMARouteHandler.cpp.o
[ 75%] Linking CXX executable ../../../../bin/marouter
[ 75%] Built target marouter
Scanning dependencies of target netgenerate
[ 75%] Building CXX object src/netgen/CMakeFiles/netgenerate.dir/netgen_main.cpp.o
[ 75%] Building CXX object src/netgen/CMakeFiles/netgenerate.dir/NGEdge.cpp.o
[ 75%] Building CXX object src/netgen/CMakeFiles/netgenerate.dir/NGFrame.cpp.o
[ 75%] Building CXX object src/netgen/CMakeFiles/netgenerate.dir/NGNet.cpp.o
[ 76%] Building CXX object src/netgen/CMakeFiles/netgenerate.dir/NGNode.cpp.o
[ 76%] Building CXX object src/netgen/CMakeFiles/netgenerate.dir/NGRandomNetBuilder.cpp.o
[ 76%] Linking CXX executable ../../../../bin/netgenerate
[ 76%] Built target netgenerate
Scanning dependencies of target polyconvert
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/polyconvert_main.cpp.o
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/PCLoaderArcView.cpp.o
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/PCLoaderDlrNavteq.cpp.o
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/PCLoaderVisum.cpp.o
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/PCLoaderOSM.cpp.o
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/PCLoaderXML.cpp.o
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/PCNetProjectionLoader.cpp.o
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/PCPolyContainer.cpp.o
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/PCTypeDefHandler.cpp.o
[ 76%] Building CXX object src/polyconvert/CMakeFiles/polyconvert.dir/PCTypeMap.cpp.o
[ 77%] Linking CXX executable ../../../../bin/polyconvert
[ 78%] Built target polyconvert
Scanning dependencies of target emissionsDrivingCycle
[ 78%] Building CXX object src/tools/CMakeFiles/emissionsDrivingCycle.dir/emissionsDrivingCycle_main.cpp.o
[ 78%] Building CXX object src/tools/CMakeFiles/emissionsDrivingCycle.dir/TrajectoriesHandler.cpp.o
[ 78%] Building CXX object src/tools/CMakeFiles/emissionsDrivingCycle.dir/VTypesHandler.cpp.o
[ 79%] Linking CXX executable ../../../../bin/emissionsDrivingCycle
[ 79%] Built target emissionsDrivingCycle
Scanning dependencies of target emissionsMap
[ 79%] Building CXX object src/tools/CMakeFiles/emissionsMap.dir/emissionsMap_main.cpp.o
[ 79%] Linking CXX executable ../../../../bin/emissionsMap
[ 79%] Built target emissionsMap
Scanning dependencies of target testlibsumostatic
[ 79%] Building CXX object src/traci_testclient/CMakeFiles/testlibsumostatic.dir/testlibsumo_main.cpp.o
[ 79%] Linking CXX executable ../../../../bin/testlibsumostatic
[ 79%] Built target testlibsumostatic
Scanning dependencies of target testlibtraci
[ 80%] Building CXX object src/traci_testclient/CMakeFiles/testlibtraci.dir/testlibtraci_main.cpp.o
[ 80%] Linking CXX executable ../../../../bin/testlibtraci
[ 80%] Built target testlibtraci
Scanning dependencies of target testlibsumo
[ 80%] Building CXX object src/traci_testclient/CMakeFiles/testlibsumo.dir/testlibsumo_main.cpp.o
[ 80%] Linking CXX executable ../../../../bin/testlibsumo
[ 80%] Built target testlibsumo
Scanning dependencies of target utils_traci
[ 80%] Building CXX object src/utils/traci/CMakeFiles/utils_traci.dir/TraCIAPI.cpp.o
[ 80%] Linking CXX static library libutils_traci.a
[ 80%] Built target utils_traci
Scanning dependencies of target TraCITestClient
[ 80%] Building CXX object src/traci_testclient/CMakeFiles/TraCITestClient.dir/tracitestclient_main.cpp.o
[ 80%] Building CXX object src/traci_testclient/CMakeFiles/TraCITestClient.dir/TraCITestClient.cpp.o
[ 80%] Linking CXX executable ../../../../bin/TraCITestClient
[ 80%] Built target TraCITestClient
Scanning dependencies of target netedit_tools
[ 80%] Building CXX object src/netedit/tools/CMakeFiles/netedit_tools.dir/GNEPythonTool.cpp.o
[ 80%] Building CXX object src/netedit/tools/CMakeFiles/netedit_tools.dir/GNENetDiffTool.cpp.o
[ 80%] Building CXX object src/netedit/tools/CMakeFiles/netedit_tools.dir/GNERunPythonTool.cpp.o
[ 80%] Building CXX object src/netedit/tools/CMakeFiles/netedit_tools.dir/GNERunNetgenerate.cpp.o
[ 80%] Linking CXX static library libnetedit_tools.a
[ 80%] Built target netedit_tools
Scanning dependencies of target generate-templates-h
[ 80%] Generating templates.h
Traceback (most recent call last):
File "/home/narayan/sumo/src/netedit/../../tools/build_config/templates.py", line 420, in <module>
main()
File "/home/narayan/sumo/src/netedit/../../tools/build_config/templates.py", line 407, in main
with open("templates.h", 'w', encoding='utf8') as templateHeaderFile:
TypeError: 'encoding' is an invalid keyword argument for this function
src/netedit/CMakeFiles/generate-templates-h.dir/build.make:61: recipe for target 'src/netedit/templates.h' failed
make[2]: *** [src/netedit/templates.h] Error 1
CMakeFiles/Makefile2:5506: recipe for target 'src/netedit/CMakeFiles/generate-templates-h.dir/all' failed
make[1]: *** [src/netedit/CMakeFiles/generate-templates-h.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
narayan@narayan-virtual-machine:~/sumo/build/cmake-build$