direct-code-execution / ns-3-dce

Run real programs in the discrete time simulator ns3
http://www.nsnam.org/projects/direct-code-execution/
75 stars 46 forks source link

Error about dependencies #137

Closed watalou closed 1 year ago

watalou commented 1 year ago

Description of the problem

I use "./bake.py configure -e dce-ns3-1.11", and run "./bake.py show", it shows some module are missing:

-- System Dependencies --

g++ - OK > gi-cairo - Missing

Python gobject components missing from system. Try: "sudo apt-get install python3-gi-cairo", if you have sudo rights. gir-bindings - OK > libc - Missing Didn't find: libc package; please install it. Try: "sudo apt-get install libc6", if you have sudo rights. libc-debug - OK libexpat-dev - OK libpcap-dev - OK mercurial - OK > pygobject - Missing Python gobject components missing from system. Try: "sudo apt-get install python3-gi", if you have sudo rights. > pygraphviz - Missing The pygraphviz is not installed, try to install it. Try: "sudo apt-get install python3-pygraphviz", if you have sudo rights. python3-dev - OK qt -OK setuptools - OK

But my OS has installed "python3-gi-cairo", "libc6","python3-gi", "pygraphviz":

sudo apt-get install python3-gi-cairo libc6 python3-gi python3-pygraphviz Reading package lists... Done Building dependency tree
Reading state information... Done python3-gi is already the newest version (3.20.0-0ubuntu1). python3-gi-cairo is already the newest version (3.20.0-0ubuntu1). python3-pygraphviz is already the newest version (1.3.1-0ubuntu2). libc6 is already the newest version (2.23-0ubuntu11.3). 0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.

From ./bake/bakeconf.xml, I find python3-gi-cairo's dependencies is ""_gi_cairo.x86_64-linux-gnu.so or _gi_cairo.cpython-38-x86_64-linux-gnu.so or _gi_cairo.cpython-39-x86_64-linux-gnu.so or _gi_cairo.so", but my os has "_gi_cairo.cpython-35m-x86_64-linux-gnu.so"

My python version is 3.7.0.

tomhenderson commented 1 year ago

I am not seeing the same problem on my test Ubuntu 16 system, but I think I know why for the python packages. I similarly have python3-pygraphviz and it provides _gi_cairo.cpython-35m-x86_64-linux-gnu.so, but I also have python-pygraphviz (for Python2) which provides _gi_cairo.x86_64-linux-gnu.so which is picked up by the bakeconf.xml. My Python 3 version is 3.5.

On these packages, it is safe to ignore them if you do not use PyViz visualizer with ns-3 (most people do not). But I will fix the bakeconf.xml for the future.

However, for missing libc, the bakeconf.xml searches for it in two places:

    <module name="libc">
      <source type="system_dependency">
        <attribute name="file_test" value="/usr/lib/ld-linux.so.2 or /lib/ld-linux.so.2"/>

On my Ubuntu 16 system, the /lib/ld-linux.so.2 is a symbolic link to another file:

ld-linux.so.2 -> i386-linux-gnu/ld-2.23.so

I am not sure whether I put this symlink there in the past, or whether an Ubuntu package installation did it. Regardless, for you, you should either duplicate this kind of symlink or else extend the list of places to look in the bakeconf.xml to include /lib/i386-linux-gnu/ld-2.23.so (or wherever this is installed on your system).

tomhenderson commented 1 year ago

I just updated bake dependency checks to fix this; please try again with bake commit 9252026.

tomhenderson commented 1 year ago

I did some further testing today and fixed an issue with net-next-nuse-4.4.0, for dce-linux-1.11 target. Please check with the latest bake commit bce9a0f54. Both dce-ns3-1.11 and dce-linux-1.11 should work.

I tested this on an Ubuntu 16.04 Docker container. Below is the list of packages I installed:

apt-get install git python3 python3-pip gir1.2-gtk-3.0 python3-gi-cairo
apt-get install python3-gi python3-pygraphviz python3-setuptools-scm
apt-get install pkg-config libssl-dev libpcap-dev bison flex qt4-dev-tools
apt-get install libdb-dev mercurial bc wget vim libc6 libc6-dbg

Then, the following specific versions of Python packages are needed:

pip3 install --user distro==1.5.0
pip3 install --user certifi==2019.6.16
pip3 install --user requests==2.22.0

Then follow the normal bake-based installation instructions at https://ns-3-dce.readthedocs.io/en/latest/getting-started.html

watalou commented 1 year ago

I just updated bake dependency checks to fix this; please try again with bake commit 9252026.

Hi, Tom, thanks for your hard work, I've tried the new version, and now it works fine in my system, without reporting any errors.

However, there's a new problem: When I tried to install quagga, I executed the instructions according to https://ns-3-dce-quagga.readthedocs.io/en/latest/getting-started.html#building-ns-3-dce-and-dce-quagga, it configured the ns3's version is ns3.34(i.e., ns3-dev), but build NS3 failed, and the err info is :

CMake Error at build-support/macros-and-definitions.cmake:206 (message): GNU 5.4.0 compiler is below the minimum required version 8.0.0 Call Stack (most recent call first): CMakeLists.txt:119 (include)

My g++ version is 5.4, and I ran "sudo apt-get update; sudo apt-get install gcc g++", it showed g++ was the newest version:

Reading package lists... Done Building dependency tree
Reading state information... Done g++ is already the newest version (4:5.3.1-1ubuntu1). gcc is already the newest version (4:5.3.1-1ubuntu1). 0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

So how to fix this problem, thanks in advance!


ns3 version : 3.34
DCE version: 1.11
Operating system/version (lsb_release -a): Ubuntu 16.04.7 LTS
Libc version (ldd -v): ldd (Ubuntu GLIBC 2.23-0ubuntu11.3) 2.23
compiler version : 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
tomhenderson commented 1 year ago

it configured the ns3's version is ns3.34(i.e., ns3-dev), but build NS3 failed, and the err info is :

CMake Error at build-support/macros-and-definitions.cmake:206 (message): GNU 5.4.0 compiler is below the minimum required version 8.0.0

ns-3.34 is not ns-3-dev. ns-3.34 uses the Waf build system; ns-3-dev uses the CMake build system. ns-3.34 will work with g++-5.4 but not ns-3-dev. It looks like you may be trying to use ns-3-dev with this system.

Please get the latest bake from: https://gitlab.com/nsnam/bake.git and then run

./bake.py configure -e dce-linux-1.11 -e dce-quagga-1.11
./bake.py download
./bake.py build

and it should build on Ubuntu 16.04 with g++-5.4.

watalou commented 1 year ago

Hi, Tom, I deleted the source and build directories, and repeated your steps, it built successfully. Thanks a lot!