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

Installation Issues with dce-linux-dev #106

Open realanda opened 4 years ago

realanda commented 4 years ago
### Description of the problem & Steps to reproduce 
I am new to DCE. I am trying the following the steps in the [Quick Start guide ](https://www.nsnam.org/docs/dce/manual/html/getting-started.html) in order to build DCE (with Linux Kernel).

git clone https://gitlab.com/nsnam/bake.git cd bake export PATH=$PATH:pwd/build/bin:pwd/build/bin_dce export PYTHONPATH=$PYTHONPATH:pwd/build/lib export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:pwd/build/lib python3 bake.py configure -e dce-linux-dev python3 bake.py check python3 bake.py show python3 bake.py download python3 bake.py build -vvv


all steps before the last command succeed with OK messages (i.e. check, show, download are successful). However, when I run the last command (i.e. python3 bake.py build -vvv)
I get the following messages:

Built ns-3-dev - OK Building dce-linux-dev - Setting top to : /home/realanda/dcei/bake/source/ns-3-dce Setting out to : /home/realanda/dcei/bake/source/ns-3-dce/build Checking for 'gcc' (C compiler) : /usr/bin/gcc Checking for cc version : 5.5.0 Checking for 'g++' (C++ compiler) : /usr/bin/g++ Checking for program 'pkg-config' : /usr/bin/pkg-config Checking for pkg-config version >= '0.0.0' : yes Checking for -Wl,--soname=foo : yes Checking for libns3-dev-core-debug (mandatory) : yes Checking for libns3-dev-network-debug (mandatory) : yes Checking for libns3-dev-internet-debug (mandatory) : yes Checking for libns3-dev-point-to-point-debug (optional) : yes Checking for libns3-dev-tap-bridge-debug (optional) : yes Checking for libns3-dev-netanim-debug (optional) : yes Checking for libns3-dev-wifi-debug (optional) : yes Checking for libns3-dev-csma-debug (optional) : yes Checking for libns3-dev-mobility-debug (optional) : yes Checking for libns3-dev-point-to-point-layout-debug (optional) : yes Checking for libns3-dev-mpi-debug (optional) : not found Checking for libns3-dev-lte-debug (optional) : yes Checking for libns3-dev-visualizer-debug (optional) : not found Checking for libns3-dev-applications-debug (optional) : yes Checking for libns3-dev-fd-net-device-debug (optional) : yes Checking for header stdint.h : yes Checking for header inttypes.h : yes Checking for header sys/inttypes.h : not found Checking for header sys/types.h : yes Checking for header sys/stat.h : yes Checking for header dirent.h : yes Checking for library dl : yes Checking for glibc get_cpu_features : yes Checking for glibc secure_getenv : yes Checking for glibc explicit_bzero : no Checking for header valgrind/valgrind.h : yes Checking for header valgrind/memcheck.h : yes Checking for header sim.h : yes Checking for libns3-dev-flow-monitor-debug (mandatory) : yes Checking for 'gcc' (C compiler) : /usr/bin/gcc Checking for 'g++' (C++ compiler) : /usr/bin/g++ Checking for libns3-dev-mpi-debug (mandatory) : not found The configuration failed (complete log in /home/realanda/dcei/bake/source/ns-3-dce/build/config.log) /usr/bin/python3 /home/realanda/dcei/bake/source/ns-3-dce/waf configure --prefix=/home/realanda/dcei/bake/build --with-ns3=/home/realanda/dcei/bake/build --with-elf-loader=/home/realanda/dcei/bake/build/lib --with-libaspect=/home/realanda/dcei/bake/build --enable-kernel-stack=/home/realanda/dcei/bake/source/ns-3-dce/../net-next-nuse-4.4.0/arch dir=/home/realanda/dcei/bake/source/ns-3-dce

Building dce-linux-dev - Problem Subprocess failed with error 1: ['/usr/bin/python3', '/home/realanda/dcei/bake/source/ns-3-dce/waf', 'configure', '--prefix=/home/realanda/dcei/bake/build', '--with-ns3=/home/realanda/dcei/bake/build', '--with-elf-loader=/home/realanda/dcei/bake/build/lib', '--with-libaspect=/home/realanda/dcei/bake/build', '--enable-kernel-stack=/home/realanda/dcei/bake/source/ns-3-dce/../net-next-nuse-4.4.0/arch'] Error: Critical dependency, module "dce-linux-dev" failed For more information call Bake with --debug and/or -v, -vvv, for full verbose mode (bake --help)


   It appears there is some issue with libns3-dev-mpi-debug.

   Further, when I grep in the bake folder for libns3-dev-mpi-debug, I see the following output, which may be useful:

root@potato:/home/realanda/dcei/bake# grep -nr libns3-dev-mpi-debug . ./build_log.txt:7443:Checking for libns3-dev-mpi-debug (optional) : not found ./build_log.txt:7464:Checking for libns3-dev-mpi-debug (mandatory) : not found ./source/ns-3-dce/build/config.log:607:Checking for libns3-dev-mpi-debug (optional) ./source/ns-3-dce/build/config.log:608:['/usr/bin/pkg-config', '--cflags', '--libs', 'libns3-dev-mpi-debug'] ./source/ns-3-dce/build/config.log:609:err: Package libns3-dev-mpi-debug was not found in the pkg-config search path. ./source/ns-3-dce/build/config.log:610:Perhaps you should add the directory containing libns3-dev-mpi-debug.pc' ./source/ns-3-dce/build/config.log:612:No package 'libns3-dev-mpi-debug' found ./source/ns-3-dce/build/config.log:1416:Checking for libns3-dev-mpi-debug (mandatory) ./source/ns-3-dce/build/config.log:1417:['/usr/bin/pkg-config', '--cflags', '--libs', 'libns3-dev-mpi-debug'] ./source/ns-3-dce/build/config.log:1418:err: Package libns3-dev-mpi-debug was not found in the pkg-config search path. ./source/ns-3-dce/build/config.log:1419:Perhaps you should add the directory containinglibns3-dev-mpi-debug.pc' ./source/ns-3-dce/build/config.log:1421:No package 'libns3-dev-mpi-debug' found



Note: I guess there are duplicate log messages because I attempted this installation multiple times.

=======================================

I would be grateful for any solution or advice regarding this issue.
teto commented 4 years ago

you should enable MPI in your ns3-installation most likely (e.g., add it to the list of modules to compile, see ns-3 doc).

realanda commented 4 years ago

Are you saying to build dce using waf? I tried to modify bakeconf.xml to add the --enable-mpi flag at appropriate places, but it still doesn't enable mpi.

Note that my use case doesn't require mpi.

mervin0502 commented 4 years ago

@realanda I have the same problem.

teto commented 4 years ago

I am saying you should build ns3 with mpi support since DCE cna't find the library (or build DCE without the library). Double check that the library is present and that it''s not a PKG_CONFIG issue. I don't use bake (and can't use it on my distrib either) and I am not sure how up to date it is. btw I can't find the dce commit 40c877996e416e271251061d881113a80548b04e

realanda commented 4 years ago

Hi, I'm still struggling with this issue. I was unable to set up MPI via bake, but then I tried manually with the -enable-mpi flag and I still got the same error. I am currently trying to dig into bake and see why libns3-dev-mpi-debug is not being generated.

0100est commented 3 years ago

Hi. This is probably not the best way to do it (i.e. disable MPI in DCE), but it is easy to do it. Just remove the directory myscripts/dce-mpi-udp from the DCE distribution. Or rename it to mysqcripts/.dce-mpi-udp - it works just the same. And then I was able to build the DCE using waf (although initially I used "bake" for downloading everything and building everything, but it got stuck in building DCE because of the MPI error you mention above). The waf configure command I used is the one used by bake, namely: ./waf configure --prefix=/home/forest/Projects/ns-3-dce/python3-virtualenv-ns-3-dce/bake/build --with-ns3=/home/forest/Projects/ns-3-dce/python3-virtualenv-ns-3-dce/bake/build --enable-kernel-stack=/home/forest/Projects/ns-3-dce/python3-virtualenv-ns-3-dce/bake/source/ns-3-dce/../net-next-nuse-4.4.0/arch

After fixing the MPI error, I still had to add this where "cmpfunc" is defined in bindings/python/ns3_module_dce.cpp in order to avoid the compilation error "error: invalid conversion from ‘cmpfunc {aka void}’ to ‘PyAsyncMethods’ [-fpermissive]":

if PY_VERSION_HEX >= 0x03000000

if PY_VERSION_HEX >= 0x03050000

typedef PyAsyncMethods* cmpfunc;

else

typedef void* cmpfunc;

endif

I have approximately the same OS/library configuration as yours: Ubuntu 16.04.2 LTS, python3.5, gcc/g++ 5.4.0, used ns-3-dev, ns-3-dce.