Open regisin opened 6 years ago
1.10 should solve some pbs already. I am not a huge fan of bake and I don't have commit access to it anyway but I am working on a nix-based packages which should be a lot more reliable. The last nix(os) release 18.09 seems to have brought some support for raspberry pi 3 so in the long term that could help, in the short term you are on your own sorry :) https://nixos.wiki/wiki/NixOS_on_ARM/Raspberry_Pi https://www.reddit.com/r/NixOS/comments/5p3f7l/nixos_in_raspberry_pi/ https://github.com/NixOS/nixpkgs/issues/22014
Well, iperf error disappeared, but the rest are still there.
Do you know how I'd go about building with waf?
The docs are very vague. I don't need most of the subprojects (I don't need net-next-sim for example, just dce, ns3, iperf and ping to work together), but the docs don't say how to obtain them one by one.
I want to use this setup to actually test my own ns3 modules on a testbed.
I'm willing to write a good tutorial about that, but I have to learn first.
@teto
Update:
I'm tackling each problem individually.
iv. netanim (I think it's solved):
v. elf-loader (progress, not solved):
The script extract-system-config.py
looks for a libc-debug file. In the script onli ubuntu files are listed.
I added '/lib/arm-linux-gnueabihf/ld-2.24.so',
to the files_to_try
list.
Now the problem seems to be that the python script can't read the values from that libc-debug file. Not sure why.
I was sure we had a detailed explanation for ./waf only but can't find it. Maybe it was just on the mailing list or somewhere else. Basically you just need ./waf configure --with-ns3=/installed/ns3
directly. You can then deal with error along as you do /waf build. I never used netanim so not sure what's going on there.
To get iperf & co, you can look at the bakeconf.xml to see what urls/commands bake uses to fetch/compile.
So I think I'm on the right track. I started over and now I'm doing everything by hand.
I have:
elf-loader
on the Pi without success. Is it really necessary, I feel like it is but am not sure. Even though I added the path to the ld-2.24.so to the extract...py script, the vdl-config.h
file comes out empty. The python script can't read anything from the ld.so (I also teste the python script in my Ubuntu 17.04 with the same behavior)Would DCE work this way or is there any other dependency I'm missing? I followed the folder structure from bakefile.xml
I've been getting this error when compiling dce:
pi@raspberrypi:~/Desktop/dce/ns-3-dce $ ./waf build
Waf: Entering directory `/home/pi/Desktop/dce/ns-3-dce/build'
[ 9/255] Linking build/lib/libns3-netlink.so
[ 10/255] Creating build/lib/pkgconfig/libns3-dev-netlink-debug.pc
[ 11/255] Compiling model/dce-manager.cc
[ 12/255] Compiling model/dce-application.cc
[ 13/255] Compiling model/dce.cc
[ 14/255] Compiling model/dce-signal.cc
[ 15/255] Compiling model/libc-dce.cc
[ 16/255] Compiling model/utils.cc
../model/libc-ns3.h: In function ‘void libc_dce(Libc**)’:
../model/libc-dce.cc:191:61: error: invalid conversion from ‘int (*)(pollfd*, nfds_t, int, size_t) {aka int (*)(pollfd*, long unsigned int, int, unsigned int)}’ to ‘int (*)(pollfd*, long unsigned int, int, long unsigned int)’ [-fpermissive]
#define DCE_EXPLICIT(name,rtype,...) (*libc)->name ## _fn = dce_ ## name;
^
../model/libc-ns3.h:441:1: note: in expansion of macro ‘DCE_EXPLICIT’
DCE_EXPLICIT (__poll_chk, int, struct pollfd *, long unsigned int, int, long unsigned int)
^~~~~~~~~~~~
Waf: Leaving directory `/home/pi/Desktop/dce/ns-3-dce/build'
Build failed
-> task in './lib/ns3-dce' failed (exit status 1):
{task 1985207088: cxx libc-dce.cc -> libc-dce.cc.6.o}
['/usr/bin/g++', '-g', '-std=c++11', '-Wno-deprecated-declarations', '-Wno-psabi', '-fPIC', '-pthread', '-pthread', '-pthread', '-Imodel', '-I../model', '-Imodel/freebsd', '-I../model/freebsd', '-Ihelper', '-I../helper', '-Imodel/linux', '-I../model/linux', '-Iinclude', '-I../include', '-I/home/pi/Desktop/dce/build/include/ns3.26', '-DNS3_LOG_ENABLE', '-DNS3_ASSERT_ENABLE', '-DHAVE_STDINT_H=1', '-DHAVE_INTTYPES_H=1', '-DHAVE_SYS_TYPES_H=1', '-DHAVE_SYS_STAT_H=1', '-DHAVE_DIRENT_H=1', '-DHAVE_SECURE_GETENV=1', '-DHAVE_VALGRIND_VALGRIND_H=1', '-DHAVE_VALGRIND_MEMCHECK_H=1', '-DPYTHONDIR="/home/pi/Desktop/dce/build/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="/home/pi/Desktop/dce/build/lib/python2.7/site-packages"', '-DHAVE_PYEMBED=1', '-DHAVE_PYEXT=1', '-DHAVE_PYTHON_H=1', '-DHAVE_NS3_CORE=1', '-DHAVE_NS3_NETWORK=1', '-DHAVE_NS3_INTERNET=1', '../model/libc-dce.cc', '-c', '-o', '/home/pi/Desktop/dce/ns-3-dce/build/model/libc-dce.cc.6.o']
pi@raspberrypi:~/Desktop/dce/ns-3-dce $ nano wscript
I couldn't find the culprit.
The prototypes are different, the last parameter especially. You might need to change it
ns3 version (cat $NS3FOLDER/VERSION or the commit hash): 3.26
DCE version (git log|head -n1): 1.9
Operating system/version (lsb_release -a): No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 9.3 (stretch) Release: 9.3 Codename: stretch
Libc version (ld -v): GNU ld (GNU Binutils for Raspbian) 2.28
compiler version (gcc -v/g++ -v/clang -v/clang++ -v): gcc -v/g++ -v gcc version 6.3.0 20170516 (Raspbian 6.3.0-18+rpi1+deb9u1) clang -v/clang++ -v clang version 3.8.1-24+rpi1 (tags/RELEASE_381/final)
Description of the problem
I'm trying to compile DCE/ns3 on a Raspberry Pi. I know it's not a tested platform, but I'm willing to put some effort to make it work. Currently, following instructions from the official docs, I ran into some issues.
The bakeconfig file lists some options for libc and libc-debug, but on a Raspbian, the path for the files it looks for are wrong.
To fix this (bake not finding libc), I had to create the following symlinks (I suppose editing the bake conf xml file would also work, but on a Pi, opening the xml was not easy) - this is a workaround, not following best practices:
Note: similar issue with boost for ns-3 itself:
Looks like the source for iperf that Bake downloads is not updated. While bake was compiling, it ran into this bug: iperf bug
My solution, which I believe is the correct one, was to simply replace the source/iperf folder by the updated source from here: iperf2.0.9
And then modifying Thread.c to add the
sleep(1);
to line 412 line as per instructions.The following items fail during
bake.py build -vvv
. I split each item from the output, files are attached.output of ./waf configure
If this refers to the dce waf configure, please see file
dce.log
attached.Steps to reproduce
On a fresh install of the Raspbian Stretch on a Raspberry Pi 3 model B
Note that I couldn't find a list of dependencies that DCE requires, because it mainly encourages you to install with bake, so I installed a lot of packages.
P.S. About documentation
I know bake is supposed to be the easiest way to build dce, but is it possible to improve the documentation? For example, the step-by-step of the instructions to build with WAF are not clear. Where do I put the source code for ns-3? How do I build it? How about each other source folder (i.e. ccnx, iperf, ping, etc)? If I do NOT need one of those applications, can I simply delete the folder or is there a special way to configure it?