jwl317 / 2020thesis

Thesis
1 stars 0 forks source link

Installing programs - difficulties #9

Closed jwl317 closed 1 year ago

jwl317 commented 1 year ago
jwl317 commented 1 year ago

2022.9.14

Screenshot 2022-09-14 124023

Downloaded all the necessary installation files on the Linux machine except sumo

jwl317 commented 1 year ago
  1. 09.15

Error: Command python setup.py egg_info failed with error code 1

Screenshot from 2022-09-15 10-44-11

Information: PIP is a package management system used to install and manage software packages written in Python.

Resource: https://heum-story.tistory.com/214

jwl317 commented 1 year ago
    1. 15

Install sumo python -m pip install eclipse-sumo==1.8.0

image

jwl317 commented 1 year ago
    1. 15

Since the EOL of python 2.x, it's better to upgrade to python 3.x

python --version sudo su update-alternatives --install /usr/bin/python python /usr/bin/python3 1 python --version

image

Resource: https://dev.to/meetsohail/change-the-python3-default-version-in-ubuntu-1ekb

jwl317 commented 1 year ago

sudo apt-get install sumo sumo-tools sumo-doc

Resource: https://sumo.dlr.de/docs/Installing/index.html#linux

jwl317 commented 1 year ago
    1. 15

Install sumo python -m pip install eclipse-sumo==1.8.0

image

  • [x] SUMO 1.8.0

According to https://veins.car2x.org/tutorial/

Download version 1.8.0 from sourceforge.net

image

jwl317 commented 1 year ago
    1. 15

Install sumo python -m pip install eclipse-sumo==1.8.0 image

  • [x] SUMO 1.8.0

According to https://veins.car2x.org/tutorial/

Download version 1.8.0 from sourceforge.net

image

Discovered that the installation and build did not start. sudo apt-get update sudo apt-get install git cmake python3 g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev python3-dev swig sudo apt-get git

Resource: https://sumo.dlr.de/docs/Installing/Linux_Build.html

Will be followed by the tutorial guide from Veins homepage.

Resource: https://veins.car2x.org/tutorial/

jwl317 commented 1 year ago
    1. 15

Install sumo python -m pip install eclipse-sumo==1.8.0 image

  • [x] SUMO 1.8.0

According to https://veins.car2x.org/tutorial/ Download version 1.8.0 from sourceforge.net image

Discovered that the installation and build did not start. sudo apt-get update sudo apt-get install git cmake python3 g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev python3-dev swig sudo apt-get git

Resource: https://sumo.dlr.de/docs/Installing/Linux_Build.html

Will be followed by the tutorial guide from Veins homepage.

Resource: https://veins.car2x.org/tutorial/

After some research on how sumo is built on Linux, I found this.  sudo apt-get install git cmake python3 g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev python3-dev swig default-jdk maven libeigen3-dev  export SUMO_HOME="$PWD" at the sumo folder,  mkdir build/cmake-build && cd build/cmake-build  cmake ../..  make -j$(nproc)

FYI, When you call cmake [path], you ask it to generate a Makefile in the current directory following instructions given in [path]/CMakeLists.txt

image

FYI, The nproc command gives you the number of logical cores on your computer, so that make will start parallel build jobs which makes the build a lot faster.

jwl317 commented 1 year ago

Opinion: Personally think the instructions in the SUMO Documentation was not so specific and direct. I think it's better to write separate installation and build guide in my project.

jwl317 commented 1 year ago

image

Download OMNeT++ 5.6.2

Prerequisites

clang - C++ compiler lld - provide faster compilation and linking in OMNeT++ Qtenv - the Qt bsed runtime environment supporting 3D visualization MPI - support parallel simulation execution openmpi_info //display info about the open MPI installation GraphViz, Doxyogen - packages used by the NED documentation generation feature of the IDE Akaroa 2.7.9 - implements Multiple Replications in Parallel (MRIP) Pcap - library that allows simulation models to capture and transmit network packets bypassing the OS's protocol stack Nemiver - default debugger for OMNet++ just-in-time debugging facility

*optional

cd omnetpp-5.6.2
sudo apt-get update
sudo apt-get install build-essential gcc g++ bison flex perl tcl-dev tk-dev libxml2-dev zlib1g-dev default-jre doxygen graphviz libwebkitgtk-1.0-0 openmpi-bin libopenmpi-dev nemiver
. setenv
gedit ~/.bashrc
  1. ADD AT THE EOF export PATH=$HOME/omnetpp-5.6.2/bin:$PATH
  2. save .bashrc, close and re-open the terminal for the changes to take effect

gedit ./configure.user

  1. CHANGE WITH_QTENV variable to "no"
  2. CHANGE WITH_OSG variable to "no"
  3. CHANGE WITH_OSGEARTH variable to "no"
  4. CHANGE PREFER_QTENV to "no"
  5. CHANGE WITH_TKENV to "yes"
  6. save
./configure
make
omnetpp

If changes are made to the configuration files make cleanall

Resources: InstallGuide.pdf InstallGuide.pdf in folder omnetpp-5.6.2/doc https://networksimulationtools.com/how-to-install-omnet-in-ubuntu-16-04/

jwl317 commented 1 year ago

There's been an error with the build. I will reinstall the programs again.

Resource: https://youtu.be/N5iyW-JRCqk

jwl317 commented 1 year ago

There's been an error with the build. I will reinstall the programs again.

Resource: https://youtu.be/N5iyW-JRCqk


- [x] check if .basrc was edited properly with the following lines at EOF

export PATH=$PATH:/home/jwlee/omnetpp-5.6.2/bin export OMNET_DIR=/home/jwlee/omnetpp-5.6.2

- [x] `source ~/.bashrc`
- [ ] make cleanall
- [ ] Check ./configure.user is edited properly

gedit ./configure.user CHANGE WITH_QTENV variable to "no" CHANGE WITH_OSG variable to "no" CHANGE WITH_OSGEARTH variable to "no" PREFER_QTENV "no" WITH_TKENV=yes


- [ ] configure
`./configure`
- [ ] make
`make`
- [ ] Run
`omnetpp`
- [ ]
jwl317 commented 1 year ago
'/home/jwlee/veins-veins-5.2/sumo-launchd.py' -vv -c '/usr/bin/sumo-gui'

Simulating veins -run has encountered a problem. Finished with error.

Find /usr/tmp/sumo-launchd.log

DEBUG:root:Logging to /tmp/sumo-launchd.log
INFO:root:Listening on port 9999
DEBUG:root:Connection from 127.0.0.1 on port 51818
DEBUG:root:Handling connection from 127.0.0.1 on port 51818
DEBUG:root:Got TraCI message of length 2
DEBUG:root:Got TraCI command of length 1
DEBUG:root:Got TraCI command 0x0
DEBUG:root:Got CMD_GETVERSION
DEBUG:root:Got TraCI message of length 292
DEBUG:root:Got TraCI command of length 287
DEBUG:root:Got TraCI command 0x75
DEBUG:root:Got CMD_FILE_SEND for "b'sumo-launchd.launch.xml'"
DEBUG:root:Got CMD_FILE_SEND with data "b'<launch>\n  <copy file="erlangen.net.xml"/>\n  <copy file="erlangen.rou.xml"/>\n  <copy file="erlangen.poly.xml"/>\n  <copy file="erlangen.sumo.cfg" type="config"/>\n  <basedir path="/home/jwlee/veins-veins-5.2/examples/veins/"/>\n  <seed value="0"/>\n</launch>\n'"
DEBUG:root:Creating temporary directory...
DEBUG:root:Temporary dir is /tmp/sumo-launchd-tmp-fvtl74dd
DEBUG:root:Base dir is /home/jwlee/veins-veins-5.2/examples/veins/
DEBUG:root:Seed is 0
DEBUG:root:Finding free port number...
DEBUG:root:Claiming lock on port
DEBUG:root:...found port 36911
INFO:root:Starting SUMO (/usr/bin/sumo-gui -c erlangen.sumo.cfg) on port 36911, seed 0
DEBUG:root:Connecting to SUMO (/usr/bin/sumo-gui -c erlangen.sumo.cfg) on port 36911 (try 1)
DEBUG:root:Error ([Errno 111] Connection refused)
DEBUG:root:Connecting to SUMO (/usr/bin/sumo-gui -c erlangen.sumo.cfg) on port 36911 (try 2)
DEBUG:root:Error ([Errno 111] Connection refused)
DEBUG:root:Connecting to SUMO (/usr/bin/sumo-gui -c erlangen.sumo.cfg) on port 36911 (try 3)
DEBUG:root:Error ([Errno 111] Connection refused)
DEBUG:root:Connecting to SUMO (/usr/bin/sumo-gui -c erlangen.sumo.cfg) on port 36911 (try 4)
DEBUG:root:Releasing lock on port
DEBUG:root:Starting proxy mode
DEBUG:root:Done with proxy mode
DEBUG:root:Done with proxy mode, killing SUMO
DEBUG:root:SIGTERM
INFO:root:Done running SUMO
DEBUG:root:Cleaning up
DEBUG:root:Result: "<?xml version="1.0"?>
<status>
    <exit-code>-15</exit-code>
    <start>1663821496</start>
    <end>1663821500</end>
    <status>Exited with error code -15</status>
    <stdout><![CDATA[Loading configuration... done.
]]></stdout>
    <stderr><![CDATA[]]></stderr>
</status>
"
DEBUG:root:Closing connection from 127.0.0.1 on port 51818
jwl317 commented 1 year ago

The daemon is designed to run in the background and to listen for incoming requests. On each incoming connection, it receives the simulation seup in XML format, then launches instance of SUMO and proxies requests between OMNeT++ and SUMO.

Because the daemon has no way of telling how long it takes for SUMO to start, it will retry connecting to SUMO, leading to output like above. This is perfectly normal.

After SUMO terminates (successfully or unsuccessfully), the daemon will display its exit code, exit status, as well as its output (stdout and stderr). Look at the end of the log above.

Resource: https://veins.car2x.org/documentation/sumo-launchd/

jwl317 commented 1 year ago
OMNeT++ Discrete Event Simulation  (C) 1992-2019 Andras Varga, OpenSim Ltd.
Version: 5.6.2, build: 200518-aa79d0918f, edition: Academic Public License -- NOT FOR COMMERCIAL USE
See the license for distribution terms and warranty disclaimer

Setting up Tkenv...

Loading NED files from .:  1
Loading NED files from ../../src/veins:  43

Loading images from '/home/jwlee/veins-veins-5.2/images': *: 0  veins/*: 0  veins/sign/*: 5  veins/node/*: 45  
Loading images from '/home/jwlee/omnetpp-5.6.2/images': *: 0  maps/*: 9  logo/*: 1  old/*: 111  msg/*: 55  background/*: 4  misc/*: 70  status/*: 28  abstract/*: 90  device/*: 195  block/*: 320  

Plugin path: ./plugins

[Warning: Program was compiled without debug info, you might not be able to debug.]

RUNTIME ERROR. A cRuntimeError exception is about to be thrown, and you
requested (by setting debug-on-errors=true in the ini file) that errors
abort execution and break into the debugger.

You should now probably be running the simulation under gdb or another
debugger. The simulation kernel will now raise a SIGINT signal which will
get you into the debugger. If you are not running under a debugger, you can
still use the core dump for post-mortem debugging. Once in the debugger,
view the call stack (in gdb: "bt" command) to see the context of the
runtime error.

<!> TraCI server reports unsupported TraCI API version: 10. We recommend using Sumo version 1.0.1 or 0.32.0 -- in module (veins::TraCIScenarioManagerLaunchd) RSUExampleScenario.manager (id=6), at t=0s, event #1

TRAPPING on the exception above, due to a debug-on-errors=true configuration option. Is your debugger ready?

Simulation terminated with exit code: 133
Working directory: /home/jwlee/veins-veins-5.2/examples/veins
Command line: opp_run -m -n .:../../src/veins --image-path=../../images -l ../../src/veins omnetpp.ini

Environment variables:
PATH=/home/jwlee/omnetpp-5.6.2/bin::/home/jwlee/omnetpp-5.6.2/bin:/home/jwlee/bin:/home/jwlee/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/jwlee/omnetpp-5.6.2/bin
LD_LIBRARY_PATH=/home/jwlee/omnetpp-5.6.2/lib::/home/jwlee/veins-veins-5.2/src:
OMNETPP_IMAGE_PATH=/home/jwlee/omnetpp-5.6.2/images

More information:

Debug output for OMNeT++ can be found on the console (immediately before the "simulation terminated" line). You can get more in-depth information by enabling debug-on-errors and running the simulation with a debugger attached.

More information on debugging can be found in the list of Frequently Asked Questions (FAQ) on documentation

Then, let's see

Resource: https://groups.google.com/g/omnetpp/c/aLqUgkLhsfo?pli=1

jwl317 commented 1 year ago
  • [ ] Is debugger ready?

Resource: https://groups.google.com/g/omnetpp/c/aLqUgkLhsfo?pli=1

image

image

Screenshot from 2022-09-22 14-34-56

Copy Stack

veins [OMNeT++ Simulation]  
    opp_run_dbg [5739] [cores: 0,1] 
        Thread #1 [opp_run_dbg] 5739 [core: 1] (Suspended : Signal : SIGTRAP:Trace/breakpoint trap) 
            omnetpp::cRuntimeError::notifyEnvir() at cexception.cc:260 0x7ffff6d3a436   
            omnetpp::cRuntimeError::cRuntimeError() at cexception.cc:234 0x7ffff6d3a108 
            veins::TraCICommandInterface::setApiVersion() at TraCICommandInterface.cc:91 0x7fffef0932b6 
            veins::TraCIScenarioManager::init_traci() at TraCIScenarioManager.cc:302 0x7fffef0b6cfe 
            veins::TraCIScenarioManagerLaunchd::init_traci() at TraCIScenarioManagerLaunchd.cc:127 0x7fffef0d2283   
            veins::TraCIScenarioManager::handleSelfMsg() at TraCIScenarioManager.cc:485 0x7fffef0b8e52  
            veins::TraCIScenarioManager::handleMessage() at TraCIScenarioManager.cc:474 0x7fffef0b8d11  
            omnetpp::cSimulation::doMessageEvent() at csimulation.cc:671 0x7ffff6da1fa8 
            omnetpp::cSimulation::executeEvent() at csimulation.cc:613 0x7ffff6da1be9   
            omnetpp::tkenv::Tkenv::doRunSimulation() at tkenv.cc:525 0x7ffff74cbb12 
            <...more frames...> 
        Thread #2 [opp_run_dbg] 5747 [core: 0] (Suspended : Container)  
    gdb (7.11.1)    
jwl317 commented 1 year ago

See the fullframes from Copy Stack

veins [OMNeT++ Simulation]  
    opp_run_dbg [6120] [cores: 1]   
        Thread #1 [opp_run_dbg] 6120 [core: 1] (Suspended : Signal : SIGTRAP:Trace/breakpoint trap) 
            omnetpp::cRuntimeError::notifyEnvir() at cexception.cc:260 0x7ffff6d3a436   
            omnetpp::cRuntimeError::cRuntimeError() at cexception.cc:234 0x7ffff6d3a108 
            veins::TraCICommandInterface::setApiVersion() at TraCICommandInterface.cc:91 0x7fffef0932b6 
            veins::TraCIScenarioManager::init_traci() at TraCIScenarioManager.cc:302 0x7fffef0b6cfe 
            veins::TraCIScenarioManagerLaunchd::init_traci() at TraCIScenarioManagerLaunchd.cc:127 0x7fffef0d2283   
            veins::TraCIScenarioManager::handleSelfMsg() at TraCIScenarioManager.cc:485 0x7fffef0b8e52  
            veins::TraCIScenarioManager::handleMessage() at TraCIScenarioManager.cc:474 0x7fffef0b8d11  
            omnetpp::cSimulation::doMessageEvent() at csimulation.cc:671 0x7ffff6da1fa8 
            omnetpp::cSimulation::executeEvent() at csimulation.cc:613 0x7ffff6da1be9   
            omnetpp::tkenv::Tkenv::doRunSimulation() at tkenv.cc:525 0x7ffff74cbb12 
            omnetpp::tkenv::Tkenv::runSimulation() at tkenv.cc:407 0x7ffff74cb662   
            omnetpp::tkenv::run_cmd() at tkcmd.cc:507 0x7ffff74daef0    
            TclInvokeStringCommand() at 0x7ffff49ebb96  
            TclNRRunCallbacks() at 0x7ffff49edfa7   
            0x7ffff49eed15  
            Tcl_EvalEx() at 0x7ffff49ee5f3  
            Tk_BindEvent() at 0x7ffff4d97105    
            TkBindEventProc() at 0x7ffff4d9da55 
            Tk_HandleEvent() at 0x7ffff4da5eab  
            0x7ffff4da6494  
            Tcl_ServiceEvent() at 0x7ffff4ab4f3f    
            Tcl_DoOneEvent() at 0x7ffff4ab5175  
            omnetpp::tkenv::runTk() at tklib.cc:114 0x7ffff74e92b5  
            omnetpp::tkenv::Tkenv::doRun() at tkenv.cc:276 0x7ffff74cad0f   
            omnetpp::envir::EnvirBase::run() at envirbase.cc:747 0x7ffff78ea326 
            omnetpp::envir::EnvirBase::run() at envirbase.cc:358 0x7ffff78e7c14 
            omnetpp::envir::setupUserInterface() at startup.cc:259 0x7ffff78df94e   
            omnetpp::envir::evMain() at evmain.cc:33 0x7ffff78e0f61 
            main() at main.cc:31 0x4007d6   
        Thread #2 [opp_run_dbg] 6128 [core: 1] (Suspended : Container)  
            select() at syscall-template.S:84 0x7ffff51bc693    
            0x7ffff4af5bc0  
            start_thread() at pthread_create.c:333 0x7ffff42ac6ba   
            clone() at clone.S:109 0x7ffff51c64dd   
    gdb (7.11.1)    
jwl317 commented 1 year ago
  • [x] check if .basrc was edited properly with the following lines at EOF
export PATH=$PATH:/home/jwlee/omnetpp-5.6.2/bin
export OMNET_DIR=/home/jwlee/omnetpp-5.6.2
export PATH=$PATH:/home/jwlee/omnetpp-5.6.2/bin
export OMNET_DIR=/home/jwlee/omnetpp-5.6.2
export SUMO_HOME=/home/jwlee/sumo-1.8.0
jwl317 commented 1 year ago

CHECK THE INSTALLATION STEPS AGAIN>

  1. omnet Download omnetpp-5.6.2-src-linux.tgz Extract Open terminal from folder omnetpp-5.6.2
    sudo apt-get update
    sudo apt-get install build-essential gcc g++ bison flex perl tcl-dev tk-dev libxml2-dev zlib1g-dev default-jre doxygen graphviz libwebkitgtk-1.0-0 qt4-qmake libqt4-dev libqt4-opengl-dev openscenegraph libopenscenegraph-dev openscenegraph-plugin-osgearth osgearth osgearth-data libosgearth-dev openmpi-bin libopenmpi-dev nemiver qt5-default

. setenv [1-1] gedit ~/.bashrc

export PATH=$PATH:/home/jwlee/omnetpp-5.6.2/bin
export OMNET_DIR=/home/jwlee/omnetpp-5.6.2
export SUMO_HOME=/home/jwlee/sumo-1.8.0

[1-1-1] apply the changes

save .bashrc, close and re-open the terminal for the changes to take effect or source ~/.bashrc

*check by echo

[2] undo any changes that were made to ./configure.user Then, ./configure

//if there is an error in configuring due to outdated Qt packages sudo apt-get libqt5opengl5-dev

//if there is an error in configuring due to openscenegraph package //osgverion: I have OpenSceneGraph Library 3.2.1 sudo apt-add-repository universe sudo apt-get openscenegraph

//if there is an error in configuring due to osgEarth package

sudo apt-get install osgearth
./configure

//if it still shows an error due to osgEarth ./configure WITH_OSGEARTH=no

make
omnetpp

install INET build all

  1. sumo

download and extract sumo-src-1.8.0.tar.gz

sudo apt-get install git cmake python3 g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev python3-dev swig python-numpy python-opengl python-imaging python-matplotlib python-mpltoolkits.basemap openjdk-8-jdk
mkdir build/cmake-build && cd build/cmake-build
cmake ../..
make -j$(nproc)
  1. veins Download veins-veins-5.1.zip and unpack.

Create new workspace mkdir ~/samples

IDE Wizard Select ~/samples as workspace

Import the project into your OMNeT++ IDE workspace File > Import > General: Existing Projects into Workspace Select veins-veins-5.2 directory

Build the imported project Project > Build All

jwl317 commented 1 year ago

sumo 0.25.0 was running instead of sumo 1.8.0

jwl317 commented 1 year ago

Installation problems are fixed. #10

jwl317 commented 11 months ago

problem: forgot root password

tried to access GRUB mode and edit command line then change root password in terminal but random warning kept showing up random warning showed when changing root password

so rebooted again and changed the password finally once rebooted, keyboard error 995 showed up a problem in virtualbox instead of installed ubuntu

according to a source, this error is from virtualbox

in the end, when VM was rebooted, the new password did not work

decision: create a new VM and install softwares again