Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Problem with using libsumo
  • From: Michael Behrisch <oss@xxxxxxxxxxx>
  • Date: Fri, 19 Apr 2019 18:46:44 +0200
  • Autocrypt: addr=oss@xxxxxxxxxxx; prefer-encrypt=mutual; keydata= mQGiBFLSvucRBACGsasS4GeIWs1CFNTOYmp3ScQ2ZTJLJWQxhPliwtHTzLsErYu9Y7e8qDov iHFviYyaNuceUNoACm1e4MT4eu0DmM2Wk3y/jjD6hfm7L0EZNPxQhj+CJf2oZAm2ezCe7/si xZ2d7TCO8yWavOGbF0EVi/ZDIJqVgupu6WBpv/NCewCg65HQiS1wm+1w1MdFYxKCmXzbv08D /iWXX3tzabbCrLlUum8hBgBpJEHRtlic2uaGsKm8Fize4tfLZkTBbTYLYXfcx2Oq9+lINPTW h9jnbCjAjErRWLTjNTQjel0JnDryCnqabub/R3wScR/EHRDBeS9L6YRj0xdVd2qIaArtSYRR auKPNc4M2qZNEFSM37cXC7avhpdeA/99oJf4qyVly4RxHmekAmj9UJjRx17x9xX8t9uzUuSt AeTh+kQ3o5jK7veU6/F/+pPyi96EOzym9BJA8pgXC8hLWNjOajI10filkdQ26QsfHOpUdPSZ 4Duyw9Ayj8loagEnnAONmU/xE0QlyVBANIut0W+SNqPScYXfnBbVOaG3HbQiTWljaGFlbCBC ZWhyaXNjaCA8b3NzQGJlaHJpc2NoLmRlPohjBBMRAgAjBQJS0sHSAhsjBwsJCAcDAgEGFQgC CQoLBBYCAwECHgECF4AACgkQPBD+ltFwpimlmQCdGgnYuHxoye4vFntyHRcE0Ij0318AoN3s szGyKcKdUmPpgXLhFcNfRGe4uQENBFLSvucQBACRAt3OW7eL8N3OJp2bZz/rRldtxjcViEcd +wpQcL9Ag0b6W7e4cbSc9oSU9MAdOvxR0UxualeRGz37W/VEC8cFZb3kFtRdl66gGygKb7gl 2S27495XEYqE7BBF1HfQDjL9sh5GfuIzORkqhCHSUTdkRuzRPxNQcEYFSrASEi9jQwADBQP9 FeuTC1SJHrX9tP3p4xrEa07XkCq+UzwNhDdezoQfT1CUbOv+LT66yLTXAaiHXelgaPMQO1Oo 76U2z0C1LudkAcDdwJbMuZ0RfDoRjsgfhfvM6kqiP4m0s2NR3Y3O+HKXjwtPbXuDwaYIAIvp aj8b59n7fQyfL6BZsO0QZc0i/t+ISQQYEQIACQUCUtK+5wIbDAAKCRA8EP6W0XCmKY1lAKCc 3miJueOXuvZJWV7qGBQxxyR83gCgxhGPL9OrP22rxNJSo1w5OOUxHsM=
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/sumo-user>
  • List-help: <mailto:sumo-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=unsubscribe>
  • Openpgp: preference=signencrypt
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Hi,
glad that it worked (BTW: it should not be necessary to have
administrator rights for your process to work). Concerning
C#, I really never used it but I would start with adding another CMake
target for it (take the java section in src/libsumo/CMakeLists.txt as a
template) and then search the internet for the upcoming errors ;-).
There are C# TraCI clients but I don't know whether the authors are
reading here: https://github.com/mennowo/TraCI.NET
https://github.com/CodingConnected/CodingConnected.Traci. Maybe they can
help.

Best regards,
Michael

Am 18.04.19 um 01:47 schrieb cchadj01@xxxxxxxxxxxx:
> Hello,
>  Thank you for the reply!
>  Indeed python 3.7 seems to work. I have tried to cmake it once more.
>  I use the generator "Visual Studio 14 2015 Win64". This time i used
> cmake-gui this time and I have added
>  SWIG_EXECUTABLE to point to swig.exe (found in SUMOLibraries) and the
>  SWIG_DIR to point to the swig directory in SUMOLibraries.
>  Now it seems to work. I don't know what exactly the problem was but
> maybe in my previous attempts
>  I didn't build the sln in Release (I am not sure).
> 
>  For anyone who has this problem in windows here are the steps to build
> in order to use libsumo:
>  1. Make sure to have python 3.7 in PATH environmental variable.
>  2. Download SUMOLibraries (git clone them from
> https://github.com/DLR-TS/SUMOLibraries)
>  3. Configure them in the PATH (like it is specified in
> https://github.com/DLR-TS/SUMOLibraries README.md)
>  4. git clone https://github.com/eclipse/sumo
>  5. Open terminal as administrator and go to the path that is cloned.
> (cd sumo)
>  6. Set SUMO_HOME at that directory
>  7. Make directory cmake-buid inside sumo folder
>  8. use cmake-gui
>     8.1 specify the source to be the folder that was cloned
>     8.2 specify the build to be the created cmake-build folder
>     8.3 click Configure and use Visual Studio 14 2015 <target> (other
> versions should work) -> Finish
>     8.4 Add Entry Name: SWIG_EXECUTABLE Type: FILE_PATH value:
> /path/to/swige.exe (inside SUMOLibraries)
>     8.5 Add Entry Name: SWIG_DIR Type: PATH value: /path/to/swig (inside
> SUMOLibraries)
>     8.9 Click Generate
>  9. go to cmake-build folder and open SUMO.SLN
>  10. !!!Build solution as RELEASE!!!
> 
> Thank  you,
> 
> P.S I would really appreciate it if you could guide me on how I could
> use SWIG for c#.
>     I don't know how I should go about this and I have just used libsumo
> in python now.
> 
> Quoting Michael Behrisch <oss@xxxxxxxxxxx>:
> 
>> Hello Tom,
>> using Python 3 is definitely the right thing to do because libsumo
>> only works with Python3. Concerning the error it seems that the
>> configure step already fails because it is looking for pthread.h and
>> does not find it. Which cmake version do you use? And did you clone
>> SUMOLibraries?
>>
>> Best regards,
>> Michael
>>
>> Am 2019-04-16 23:39, schrieb cchadj01@xxxxxxxxxxxx:
>>> Hello,
>>> I am happy to learn that sumo 1.2.0 was released with cool new
>>> features and bug fixes.
>>> I tried to install sumo v1.2.0 again using cmake so I can use
>>> libsumo. This time  I decided to use python version 3.7
>>> and for this reason I created a conda environment that uses python
>>> 3.7. Having this environment activated the python.exe is in path and
>>> so when using cmake correctly configures the python to desired
>>> executable.
>>> SUMO_LIBRARIES were correctly set up in PATH. I changed the
>>> SUMO_HOME to the newly downloaded directory.
>>> I have the PYTHONPATH=%SUMO_HOME%/tools/libsumo;%SUMO_HOME%/tools/%
>>> and the PATH to point to these directories as-well.
>>>
>>> I have attached the CMakeCache.txt. Also attached you can find
>>> CMakeOutput.log and CMakeError.log
>>>
>>> I have again tried to import libsumo but it did't work. Attached you
>>> can find an image with the error.
>>>
>>> Thank you,
>>> Tom.
>>>
>>> Quoting cchadj01@xxxxxxxxxxxx:
>>>
>>>> Hello,
>>>>
>>>> I am trying to run sumo simulation faster so I decided to use libsumo.
>>>> I followed the guide to build using cmake.
>>>> I have set up the SUMO_HOME.
>>>> in SUMO_HOME/tools/libsumo I have libsumo.py (which helps import 
>>>> _libsumo), the _libsumo.pyd dll and some other stuff.
>>>> I have set the PATH to have SUMO_HOME/tools/libsumo. I have also 
>>>> set PYTHONPATH to SUMO_HOME/tools/libsumo.
>>>> I use conda and I have an environment called sumo which uses python 
>>>> 2.7. I have build sumo by following the guide at
>>>> https://sumo.dlr.de/wiki/Installing/Windows_CMake (command line)
>>>> and  having the sumo environment activated during that process.  I
>>>> have  also build as release (Visual Studio 2013 Win64).
>>>>
>>>> I have created a simple script just importing libsumo like so:
>>>>
>>>> import os
>>>> import sys
>>>>
>>>> if 'SUMO_HOME' in os.environ:
>>>>    tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
>>>>    sys.path.append(tools)
>>>> else:
>>>>    sys.exit("please declare environment variable 'SUMO_HOME'")
>>>>
>>>> from sumolib import checkBinary # noqa
>>>> import traci
>>>> import sumolib
>>>> import libsumo as libs
>>>>
>>>> and I get this error:
>>>>
>>>>
>>>> Traceback (most recent call last):
>>>>  File "C:/Users/VR_Lab/source/repos/sumo/tools/libsumo/test.py", 
>>>> line 14, in <module>
>>>>    import libsumo as libs
>>>>  File "C:\Users\VR_Lab\source\repos\sumo\tools\libsumo\libsumo.py", 
>>>> line 17, in <module>
>>>>    _libsumo = swig_import_helper()
>>>>  File "C:\Users\VR_Lab\source\repos\sumo\tools\libsumo\libsumo.py", 
>>>> line 16, in swig_import_helper
>>>>    return importlib.import_module('_libsumo')
>>>>  File 
>>>> "C:\ProgramData\Anaconda2\envs\sumo\lib\importlib\__init__.py",
>>>> line  37, in import_module
>>>>    __import__(name)
>>>> ImportError: DLL load failed: The specified procedure could not be
>>>> found.
>>>>
>>>>
>>>> This script was called with python 2.7 (having the same conda 
>>>> environment activated as the one it was build from).
>>>> The PYTHONPATH is correctly set to SUMO_HOME/tools/libsumo.
>>>> Why does that happen?
>>>>
>>>> I would like to add that in https://sumo.dlr.de/wiki/Libsumo it 
>>>> says to use the extended package and has a reference to a link but
>>>>  the referenced package doesn't have any CMakeLists.txt so I can
>>>> use  cmake.
>>>>
>>>> Thank you,
>>>> Tom
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> sumo-user mailing list
>>>> sumo-user@xxxxxxxxxxx
>>>> To change your delivery options, retrieve your password, or 
>>>> unsubscribe from this list, visit
>>>> https://www.eclipse.org/mailman/listinfo/sumo-user
>>>
>>>
>>>
>>> _______________________________________________
>>> sumo-user mailing list
>>> sumo-user@xxxxxxxxxxx
>>> To change your delivery options, retrieve your password, or
>>> unsubscribe from this list, visit
>>> https://www.eclipse.org/mailman/listinfo/sumo-user
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top