ns-3.25 installation with bake / Ubuntu 16.04 LTS / pygccxml, gccxml-ns3 build problem

3,826 views
Skip to first unread message

ptorab

unread,
Jul 12, 2016, 10:43:39 PM7/12/16
to ns-3-users
I've strictly followed the ns3.25 installation guide using bake on a clean Ubuntu 16.04 LTS system, multiple times, and get build errors on gccxml-ns3 and pygccxml; has anyone been successful with bake and Ubuntu 16.04? Thanks.

>> Building gccxml-ns3 - Problem
 > Problem: Optional dependency, module "gccxml-ns3" failed
   This may reduce the  functionality of the final build. 
   However, bake will continue since "gccxml-ns3" is not an essential dependency.
   For more information call bake with -v or -vvv, for full verbose mode.
 >> Building pygccxml - Problem
 >> Building netanim-3.107 - OK
 >> Building pybindgen-0.17.0.post49+ng0e4e3bc - Problem
 > Problem: Optional dependency, module "pybindgen-0.17.0.post49+ng0e4e3bc" failed
   This may reduce the  functionality of the final build. 
   However, bake will continue since "pybindgen-0.17.0.post49+ng0e4e3bc" is not an essential dependency.
   For more information call bake with -v or -vvv, for full verbose mode.

Tom Henderson

unread,
Jul 13, 2016, 3:49:16 PM7/13/16
to ns-3-...@googlegroups.com
On 07/12/2016 07:43 PM, 'ptorab' via ns-3-users wrote:
I've strictly followed the ns3.25 installation guide using bake on a clean Ubuntu 16.04 LTS system, multiple times, and get build errors on gccxml-ns3 and pygccxml; has anyone been successful with bake and Ubuntu 16.04? Thanks.

gccxml is not compatible with gcc-5.3, used by Ubuntu 16.04.

I was able to build it as described in this bug report:
https://www.nsnam.org/bugzilla/show_bug.cgi?id=2451

The other problems you pointed out may be downstream failures due to gccxml not being built properly; haven't checked yet, though.

This will be fixed in bake by the next release (3.26) but for now, must do a manual workaround (patch and build).

If anyone is interested in helping the project migrate from gccxml (no longer maintained) to castxml (its replacement), please contact me.

- Tom

malresser

unread,
Oct 30, 2016, 2:30:34 AM10/30/16
to ns-3-users
hi i came across same problem and changed the gcc version number 4.7 here is the link how to do it.now it built with no error except elf-loader but it is not important still works

ptorab

unread,
Nov 18, 2016, 9:56:29 AM11/18/16
to ns-3-users
Thanks -- I was wondering if this has indeed been resolved in 3.26 and if installation with bake works with no tweaks. Thanks.

Tom Henderson

unread,
Nov 18, 2016, 12:33:26 PM11/18/16
to ns-3-...@googlegroups.com
On 11/18/2016 06:56 AM, 'ptorab' via ns-3-users wrote:
> Thanks -- I was wondering if this has indeed been resolved in 3.26 and
> if installation with bake works with no tweaks. Thanks.

We did not get that upgrade done for ns-3.26, sorry. It is still an
open issue.

For Ubuntu, there might be a workaround with a gccxml wrapper if someone
wants to try to work through the issues and let us know. Ubuntu 16.04
(haven't checked with 16.10) distributes castxml as a package, and also
'python-pygccxml' package. It also distributes a gccxml wrapper around
castxml. I disabled some gccxml version checking in
bindings/python/wscript, and './waf configure' reported that API
scanning was enabled. However, when I performed an API scan, it errored
out as follows:

pygccxml.parser.source_reader.gccxml_runtime_error_t: Error occured
while running GCC-XML: GCC-XML compatibility CastXML wrapper
Error: unsupported argument: --gccxml-cxxflags

I don't know whether this is an easily surmountable problem or not; it
may be something that could be mapped to castxml (see this post:
http://public.kitware.com/pipermail/castxml/2015-July/000014.html)

Longer term, we aim to call castxml directly and upgrade our wscripts to
do so. castxml seems easiest to install via binary package if possible
(e.g. recent Ubuntu releases); building from source takes a long time.

- Tom

>
> On Tuesday, July 12, 2016 at 7:43:39 PM UTC-7, ptorab wrote:
>
> I've strictly followed the ns3.25 installation guide _using bake_ on
> a clean Ubuntu 16.04 LTS system, multiple times, and get build
> errors on gccxml-ns3 and pygccxml; has anyone been successful with
> bake and Ubuntu 16.04? Thanks.
>
> >> Building gccxml-ns3 - Problem
> > Problem: Optional dependency, module "gccxml-ns3" failed
> This may reduce the functionality of the final build.
> However, bake will continue since "gccxml-ns3" is not an
> essential dependency.
> For more information call bake with -v or -vvv, for full
> verbose mode.
> >> Building pygccxml - Problem
> >> Building netanim-3.107 - OK
> >> Building pybindgen-0.17.0.post49+ng0e4e3bc - Problem
> > Problem: Optional dependency, module
> "pybindgen-0.17.0.post49+ng0e4e3bc" failed
> This may reduce the functionality of the final build.
> However, bake will continue since
> "pybindgen-0.17.0.post49+ng0e4e3bc" is not an essential dependency.
> For more information call bake with -v or -vvv, for full
> verbose mode.
>
>
> --
> Posting to this group should follow these guidelines
> https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
> ---
> You received this message because you are subscribed to the Google
> Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ns-3-users+...@googlegroups.com
> <mailto:ns-3-users+...@googlegroups.com>.
> To post to this group, send email to ns-3-...@googlegroups.com
> <mailto:ns-3-...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/ns-3-users.
> For more options, visit https://groups.google.com/d/optout.

tgodf...@gmail.com

unread,
Jul 23, 2017, 5:18:33 PM7/23/17
to ns-3-users
I'm trying to install ns3.26 under Ubuntu 16.04 LTS.
I'm running into the issue described here,
with "bake.py deploy" giving the error:
 >> Building gccxml-ns3 - Problem
   > Subprocess failed with error 2: ['make']

 > Problem: Optional dependency, module "gccxml-ns3" failed

I have tried to follow the steps in https://www.nsnam.org/bugzilla/show_bug.cgi?id=2451
specifically:

- download gccxml from git
- patch with the above patch from Fedora project
- follow the build instructions in the gccxml README, but modify the 'cmake' statement as above



To "download gccxml from git, I tried:
 git clone git://github.com/gccxml/gccxml.git
Enter code here...

This created the directory gccxml in my home.

To get the patch, I used:

I then edited the download file, removing the HTML wrapper, and renamed to gccxml-gcc5.patch. The file starts with this line:
diff -ur gccxml-0.9.0-20150423.orig/GCC/gcc/toplev.c gccxml-0.9.0-20150423/GCC/gcc/toplev.c

and ends with this line:
   return x == (x &amp; -x) &amp;&amp; x ? (int) CTZ_HWI (x) : -1


This patch file does not properly find the file to patch:

patch --dry-run -i ./gccxml.gcc5.patch
can
't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ur gccxml-0.9.0-20150423.orig/GCC/gcc/toplev.c gccxml-0.9.0-20150423/GCC/gcc/toplev.c
|--- gccxml-0.9.0-20150423.orig/GCC/gcc/toplev.c        2015-04-23 20:34:31.000000000 +0200
|+++ gccxml-0.9.0-20150423/GCC/gcc/toplev.c     2015-09-25 10:53:43.417679822 +0200
--------------------------
File to patch:



I'm not familiar with the patch



tgodf...@gmail.com

unread,
Jul 23, 2017, 5:23:44 PM7/23/17
to ns-3-users
Sorry the editor hung up and I couldn't do anything but post.  Now I can't find the link to edit the post.....

Anyway, I'm not familiar with how this patch process is supposed to work, or what underlying directory structure in gccxml is expected.

Once I get the gccxml patched, my next question will be "where do I apply the modifications to the cmake statement?  Is that somewhere in the bake.py code? Or elsewhere?



Tom Henderson

unread,
Jul 23, 2017, 6:40:23 PM7/23/17
to ns-3-...@googlegroups.com
On 07/23/2017 02:18 PM, tgodf...@gmail.com wrote:
I'm trying to install ns3.26 under Ubuntu 16.04 LTS.
I'm running into the issue described here,
with "bake.py deploy" giving the error:
 >> Building gccxml-ns3 - Problem
   > Subprocess failed with error 2: ['make']
 > Problem: Optional dependency, module "gccxml-ns3" failed

I have tried to follow the steps in https://www.nsnam.org/bugzilla/show_bug.cgi?id=2451
specifically:

- download gccxml from git

- patch with the above patch from Fedora project

- follow the build instructions in the gccxml README, but modify the 'cmake' statement as above






If you use gcc-4.9 from Ubuntu, it should work without any patching.

1) install the gcc-4.9 and g++-4.9 packages using apt-get

2) you should have /usr/bin/gcc-5 and /usr/bin/gcc-4.9 in your path now; /usr/bin/gcc is just a symbolic link to one of them.  The same is true for g++

To manage the symbolic link, the Ubuntu way to do this is to use 'update-alternatives'.  I did the following

$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 --slave /usr/bin/g++ g++ /usr/bin/g++-5

Now when I do:

$ sudo update-alternatives --config gcc

I see:

There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/gcc-4.9   100       auto mode
  1            /usr/bin/gcc-4.9   100       manual mode
  2            /usr/bin/gcc-5     50        manual mode


If I pick option 2, I can revert back to gcc-5.  But I want to use gcc-4.9 (and g++-4.9).  My g++ now shows:

$ g++ -v
...
gcc version 4.9.3 (Ubuntu 4.9.3-13ubuntu2)

3) now try ns-allinone-3.25

$ wget http://www.nsnam.org/release/ns-allinone-3.25.tar.bz2
$ tar xjf ns-allinone-3.25.tar.bz2
$ cd ns-allinone-3.25/bake/
$ ./bake.py configure -e ns-allinone-3.25
$ ./bake.py download
$ ./bake.py build
 >> Building gccxml-ns3 - OK
 >> Building click-ns-3.25 - OK
 >> Building BRITE - OK
 >> Building nsc-0.5.3 - OK
 >> Building pygccxml-1.0.0 - OK
 >> Building pygccxml - OK
 >> Building openflow-ns-3.25 - OK
 >> Building netanim-3.107 - OK
 >> Building pybindgen-0.17.0.post49+ng0e4e3bc - OK
 >> Building ns-3.25 - OK






tgodf...@gmail.com

unread,
Jul 23, 2017, 7:05:58 PM7/23/17
to ns-3-users


Thanks!  I'm further along, but "bake.py show"
still has errors:

-- System Dependencies --
 
> g++ - OK
 
> pygoocanvas - Missing
   
>> The pygoocanvas is not installed, try to install it.
   
>> Try: "sudo apt-get install python-pygoocanvas", if you have sudo rights.
 
> pygraphviz - Missing
   
>> The pygraphviz is not installed, try to install it.
   
>> Try: "sudo apt-get install python-pygraphviz", if you have sudo rights.


I have installed  python-pygoocanvas and python-pygraphviz, and they are already reported as installed.

ns-allinone-3.25 from my home directory just gives command not found, so I have a path problem too.


tgodf...@gmail.com

unread,
Jul 23, 2017, 7:11:05 PM7/23/17
to ns-3-users

I tried bake.py deploy, and still have an error in gccxml:

 >> Downloading ns-3.26 - (Nothing to do, source directory already exists) - OK
 
>> Building gccxml-ns3 - Problem

 
> Problem: Optional dependency, module "gccxml-ns3" failed
   
This may reduce the  functionality of the final build.
   
However, bake will continue since "gccxml-ns3" is not an essential dependency.
   
For more information call bake with -v or -vvv, for full verbose mode.


gcc is correct:

$ gcc -v
Using built-in specs.
COLLECT_GCC
=gcc
COLLECT_LTO_WRAPPER
=/usr/lib/gcc/i686-linux-gnu/4.9/lto-wrapper
Target: i686-linux-gnu
...snip...

gcc version
4.9.3 (Ubuntu 4.9.3-13ubuntu2)
$

Tom Henderson

unread,
Jul 23, 2017, 8:35:30 PM7/23/17
to ns-3-...@googlegroups.com
On 07/23/2017 04:11 PM, tgodf...@gmail.com wrote:

I tried bake.py deploy, and still have an error in gccxml:

 >> Downloading ns-3.26 - (Nothing to do, source directory already exists) - OK
 
>> Building gccxml-ns3 - Problem
 
> Problem: Optional dependency, module "gccxml-ns3" failed
   
This may reduce the  functionality of the final build.
   
However, bake will continue since "gccxml-ns3" is not an essential dependency.
   
For more information call bake with -v or -vvv, for full verbose mode.


gcc is correct:

Try running './bake.py build -v' with more verbosity to see why it is failing.

As for the other problems with pygraphviz and pygoocanvas, if you think you have them installed, it could be that your PYTHONPATH is not pointing to them.

- Tom

tgodf...@gmail.com

unread,
Jul 24, 2017, 1:01:56 PM7/24/17
to ns-3-users
Here's the relevant output of bake.py deploy -vvv  for maximum verbosity"

sched-ebb.c:(.text+0x22): multiple definition of `exact_log2'
../libbackend.a(tree-cfg.c.o):tree-cfg.c:(.text+0x1dce): first defined here
collect2: error: ld returned 1 exit status
GCC/gcc/cp/CMakeFiles/gccxml_cc1plus.dir/build.make:1450: recipe for target 'bin/gccxml_cc1plus' failed
make[2]: *** [bin/gccxml_cc1plus] Error 1
CMakeFiles/Makefile2:2195: recipe for target 'GCC/gcc/cp/CMakeFiles/gccxml_cc1plus.dir/all' failed
make[1]: *** [GCC/gcc/cp/CMakeFiles/gccxml_cc1plus.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
()
 >> Building gccxml-ns3 - Problem
   > Subprocess failed with error 2: ['make']
 > Problem: Optional dependency, module "gccxml-ns3" failed
   This may reduce the  functionality of the final build.
   However, bake will continue since "gccxml-ns3" is not an essential dependency.
   For more information call bake with -v or -vvv, for full verbose mode.

 >> Building netanim-3.107 -
    > cd /home/tim/source/netanim-3.107;qmake NetAnim.pro



I have added the three following path lines to the end of ~/.profile  (as shown in https://www.nsnam.org/wiki/Installation#Installation_with_Bake):

 export BAKE_HOME=`pwd`/bake 
 export PATH=$PATH:$BAKE_HOME
 export PYTHONPATH=$PYTHONPATH:$BAKE_HOME


My PYTHONPATH contains only that one directory - nothing else:

$ printenv | grep PYTHON
PYTHONPATH=:/home/tim/bake


What is the required additions to include pygraphviz and pygoocanvas in PYTHONPATH?  I don't see any details in the ns-3 wiki.  Perhaps there is another installation process beyond "sudo apt-get install...." needed to set PYTHONPATH?


tgodf...@gmail.com

unread,
Jul 24, 2017, 4:41:54 PM7/24/17
to ns-3-users
I contacted a colleague who has set up ns-3, and he recommended to avoid the bake method. 
 

I extracted it and ran the build script.  
From there I was able to enable the tests with waf, and the test.py script ran successfully. 

So I think I'm up and running.  thanks for your help. 


Tom Henderson

unread,
Jul 24, 2017, 4:44:29 PM7/24/17
to ns-3-...@googlegroups.com
bake is only needed if you would like help with downloading and installing optional components of ns-3:
- Direct Code Execution
- API scanning for modified Python bindings
- Network Simulation Cradle
- click modular routing
and a few others.

- Tom
Reply all
Reply to author
Forward
0 new messages