Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest SUMO fails to build on Windows when setting CS_ENABLE_BINDINGS to true #16148

Closed
bran-jnw opened this issue Feb 10, 2025 · 6 comments
Closed

Comments

@bran-jnw
Copy link

bran-jnw commented Feb 10, 2025

Getting:

Syntax error in input(1) at line 572 in libsumo_typemap.i, which is the line
SELF_NULL_CHECKER(TraCIPosition)

Have tried commenting out the line but then it just moves on to the next one.
Compiles without issue when building just Java and python bindings.

Full error message here:

FAILED: src/libsumo/cs/libsumoCSHARP_wrap.cxx src/libsumo/cs/libsumo.cs src/libsumo/cs/libsumoPINVOKE.cs E:/_UNITY/WUInity/SUMO_wuinity/SUMO/out/build/x64-Release/src/libsumo/cs/libsumoCSHARP_wrap.cxx E:/_UNITY/WUInity/SUMO_wuinity/SUMO/out/build/x64-Release/src/libsumo/cs/libsumo.cs E:/_UNITY/WUInity/SUMO_wuinity/SUMO/out/build/x64-Release/src/libsumo/cs/libsumoPINVOKE.cs
C:\WINDOWS\system32\cmd.exe /C "cd /D E:_UNITY\WUInity\SUMO_wuinity\SUMO\out\build\x64-Release\src\libsumo && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E make_directory E:/_UNITY/WUInity/SUMO_wuinity/SUMO/out/build/x64-Release/src/libsumo/CMakeFiles/libsumocs.dir E:/_UNITY/WUInity/SUMO_wuinity/SUMO/out/build/x64-Release/src/libsumo/cs E:/_UNITY/WUInity/SUMO_wuinity/SUMO/out/build/x64-Release/src/libsumo/cs && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E env SWIG_LIB=E:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/swigwin-4.0.2/Lib E:/_UNITY/WUInity/SUMO_wuinity/SUMO/../SUMOLibraries/swigwin-4.0.2/swig.exe -csharp -namespace LIBSUMO -DHAVE_LIBSUMOGUI -outdir E:/_UNITY/WUInity/SUMO_wuinity/SUMO/out/build/x64-Release/src/libsumo/cs -c++ -dllimport libsumocs -IE:/_UNITY/WUInity/SUMO_wuinity/SUMO/../SUMOLibraries/googletest-1.15.2/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/xerces-c-3.3.0/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/proj-9.5.0/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/fox-1.6.58/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/3rdPartyLibs/freetype-2.13.3/include/freetype2 -IE:/_UNITY/WUInity/SUMO_wuinity/SUMO/../SUMOLibraries/3rdPartyLibs/fmt-11.0.2/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/3rdPartyLibs/zlib-1.3.1/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/gettext-0.21/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/eigen-3.4.0/include/eigen3 -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/gdal-3.9.3/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/FFMPEG-7.1.0/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/OSG-3.6.5/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/gl2ps-1.4.2/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMOLibraries/3rdPartyLibs/geos-3.13.0/include -IE:/_UNITY/WUInity/SUMO_wuinity/SUMO/out/build/x64-Release/src -IE:/_UNITY/WUInity/SUMO_wuinity/SUMO/src "-IC:/Program Files (x86)/Eclipse Adoptium/jdk-17.0.7.7-hotspot/include" "-IC:/Program Files (x86)/Eclipse Adoptium/jdk-17.0.7.7-hotspot/include/win32" -o E:/_UNITY/WUInity/SUMO_wuinity/SUMO/out/build/x64-Release/src/libsumo/cs/libsumoCSHARP_wrap.cxx E:/_UNITY/WUInity/SUMO_wuinity/SUMO/src/libsumo/libsumo.i"
E:_UNITY\WUInity\SUMO_wuinity\SUMO\src\libsumo\libsumo_typemap.i(572): error : Syntax error in input(1).

@bran-jnw
Copy link
Author

bran-jnw commented Feb 10, 2025

Works by commenting out all SELF_NULL_CHECKER, assume that the function definition is missing for C#, but not sure how to fix it.

/SELF_NULL_CHECKER(TraCIResult)
SELF_NULL_CHECKER(TraCIPosition)
SELF_NULL_CHECKER(TraCIPositionVector)
SELF_NULL_CHECKER(TraCIRoadPosition)
SELF_NULL_CHECKER(TraCIColor)
SELF_NULL_CHECKER(TraCIInt)
SELF_NULL_CHECKER(TraCIDouble)
SELF_NULL_CHECKER(TraCIDoubleList)
SELF_NULL_CHECKER(TraCIString)
SELF_NULL_CHECKER(TraCIStringList)
SELF_NULL_CHECKER(TraCIPhase)
SELF_NULL_CHECKER(TraCILogic)
SELF_NULL_CHECKER(TraCILink)
SELF_NULL_CHECKER(TraCIConnection)
SELF_NULL_CHECKER(TraCIVehicleData)
SELF_NULL_CHECKER(TraCINextTLSData)
SELF_NULL_CHECKER(TraCINextStopData)
SELF_NULL_CHECKER(TraCINextStopDataVectorWrapped)
SELF_NULL_CHECKER(TraCIBestLanesData)
SELF_NULL_CHECKER(TraCIStage)
SELF_NULL_CHECKER(TraCIReservation)
SELF_NULL_CHECKER(TraCICollision)
SELF_NULL_CHECKER(TraCISignalConstraint)
SELF_NULL_CHECKER(TraCIJunctionFoe)
/

@behrisch behrisch self-assigned this Feb 11, 2025
@behrisch behrisch added the bug label Feb 11, 2025
@behrisch behrisch added this to the 1.23.0 milestone Feb 11, 2025
@behrisch
Copy link
Contributor

@bran-jnw Thanks for reporting! It would be great if you can check whether the new code works.

@bran-jnw
Copy link
Author

@behrisch Works fine now, thanks! And thanks for adding getIncoming/OutgoingEdges to Junctions in libsumo at some point, made my life easier (had to add that myself before).

@behrisch
Copy link
Contributor

@bran-jnw Since you seem to use this actively. Would you mind writing up a small "tutorial" how to use it similar to what is there for Java and Python for instance (https://sumo.dlr.de/docs/Libsumo.html or https://sumo.dlr.de/docs/Libtraci.html)? Thanks a lot in advance! If we can build a test after the tutorial we would also consider enabling it by default and releasing it.

@bran-jnw
Copy link
Author

@behrisch I could do that, would be great if C# bindings would be included as default! How do I go about actually adding to the documentation?

@bran-jnw
Copy link
Author

bran-jnw commented Feb 14, 2025

@behrisch Would it also be possible to add this (or similar namespace) to the SWIG settings?
set(CMAKE_SWIG_FLAGS -namespace Libsumo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants