Python binding fails in ns3.30.1 on Mac

479 views
Skip to first unread message

Qianwen Huang

unread,
Oct 9, 2019, 4:32:17 PM10/9/19
to ns-3-users
Hello,

My ns3 works well when disabling python, but it fails after configuring python bindings. My environment is ns3.30.1, macOS10.14.6, python3.6.5, Xcode11.0(11A420a), clang&clang++11.0.0(clang--1100.0.33.8), pybindgen0.20, pygccxml1.9.1, castxml0.2. Output of command ./waf configure ... are listed below:

Setting top to                           : /Users/qianwenhuang/Documents/ns-3/ns-allinone-3.30.1/ns-3.30.1 

Setting out to                           : /Users/qianwenhuang/Documents/ns-3/ns-allinone-3.30.1/ns-3.30.1/build ble-werror --enable-examples --enable-tests --with-python=/usr/local/bin/python3.6 CXX=/usrChecking for 'clang' (C compiler)        : /usr/bin/clang 

Checking for cc version                  : 11.0.0 

Checking for 'clang++' (C++ compiler)    : /usr/bin/clang++ 

Checking for compilation flag -std=c++11 support : ok 

Checking boost includes                          : 1_71 

Checking boost libs                              : lib signals not found in /usr/local/lib 

Checking boost includes                          : 1_71 

Checking boost libs                              : lib signals not found in /usr/local/lib 

Checking for program 'python'                    : /usr/local/bin/python3.6 

Checking for python version >= 2.3               : 3.6.5 

python-config                                    : /usr/local/bin/python3.6-config 

Asking python-config for pyembed '--cflags --libs --ldflags --embed' flags : not found 

Asking python-config for pyembed '--cflags --libs --ldflags' flags         : yes 

Testing pyembed configuration                                              : yes 

Asking python-config for pyext '--cflags --libs --ldflags' flags           : yes 

Testing pyext configuration                                                : yes 

Checking for compilation flag -Wno-array-bounds support                    : ok 

Checking for pybindgen location                                            : ../pybindgen-0.20.0 (guessed) 

Checking for python module 'pybindgen'                                     : 0.20.0 

Checking for pybindgen version                                             : 0.20.0 

Checking for code snippet                                                  : no 

Checking for types uint64_t and unsigned long equivalence                  : yes 

Checking for code snippet                                                  : yes 

Checking for types uint64_t and unsigned long long equivalence             : no 

Checking for the apidefs that can be used for Python bindings              : gcc-ILP32 

Checking for internal GCC cxxabi                                           : incomplete 

Checking for python module 'pygccxml'                                      : 1.9.1 

Checking for pygccxml version                                              : 1.9.1 

Checking for program 'castxml'                                             : /opt/local/bin/castxml 

Checking for castxml version                                               : 0.2 

Checking for click location                                                : not found 

Checking for program 'pkg-config'                                          : /usr/local/bin/pkg-config 

Checking for 'gtk+-3.0'                                                    : yes 

Checking for 'libxml-2.0'                                                  : yes 

checking for uint128_t                                                     : not found 

checking for __uint128_t                                                   : yes 

Checking high precision implementation                                     : 128-bit integer (default) 

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 header stdlib.h                                               : yes 

Checking for header signal.h                                               : yes 

Checking for header pthread.h                                              : yes 

Checking for header stdint.h                                               : yes 

Checking for header inttypes.h                                             : yes 

Checking for header sys/inttypes.h                                         : not found 

Checking for library rt                                                    : not found 

Checking for header sys/ioctl.h                                            : yes 

Checking for header net/if.h                                               : yes 

Checking for header net/ethernet.h                                         : yes 

Checking for header linux/if_tun.h                                         : not found 

Checking for header netpacket/packet.h                                     : not found 

Checking for NSC location                                                  : not found 

Checking for 'sqlite3'                                                     : yes 

Checking for header linux/if_tun.h                                         : not found 

Checking for python module 'gi'                                            : not found 

Checking for python module 'gi.repository.GObject'                         : not found 

Checking for python module 'cairo'                                         : not found 

Checking for python module 'pygraphviz'                                    : not found 

Checking for python module 'gi.repository.Gtk'                             : not found 

Checking for python module 'gi.repository.Gdk'                             : not found 

Checking for python module 'gi.repository.Pango'                           : not found 

Checking for python module 'gi.repository.GooCanvas'                       : not found 

Checking for program 'sudo'                                                : /usr/bin/sudo 

Checking for program 'valgrind'                                            : not found 

Checking for 'gsl'                                                         : not found 

libgcrypt-config                                                           : /opt/local/bin/libgcrypt-config 

Checking for libgcrypt                                                     : yes 

Checking for program 'doxygen'                                             : not found 

---- Summary of optional NS-3 features:

Build profile                 : debug

Build directory               : 

BRITE Integration             : not enabled (BRITE not enabled (see option --with-brite))

DES Metrics event collection  : not enabled (defaults to disabled)

Emulation FdNetDevice         : not enabled (needs netpacket/packet.h)

Examples                      : enabled

File descriptor NetDevice     : enabled

GNU Scientific Library (GSL)  : not enabled (GSL not found)

Gcrypt library                : enabled

GtkConfigStore                : enabled

MPI Support                   : not enabled (option --enable-mpi not selected)

NS-3 Click Integration        : not enabled (nsclick not enabled (see option --with-nsclick))

NS-3 OpenFlow Integration     : not enabled (Required boost libraries not found)

Network Simulation Cradle     : not enabled (NSC not found (see option --with-nsc))

PlanetLab FdNetDevice         : not enabled (PlanetLab operating system not detected (see option --force-planetlab))

PyViz visualizer              : not enabled (Missing python modules: gi, gi.repository.GObject, cairo, pygraphviz, gi.repository.Gtk, gi.repository.Gdk, gi.repository.Pango, gi.repository.GooCanvas)

Python API Scanning Support   : enabled

Python Bindings               : enabled

Real Time Simulator           : not enabled (librt is not available)

SQlite stats data output      : enabled

Tap Bridge                    : not enabled (<linux/if_tun.h> include not detected)

Tap FdNetDevice               : not enabled (needs linux/if_tun.h)

Tests                         : enabled

Threading Primitives          : enabled

Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)

XmlIo                         : enabled


Command ./waf --apiscan=all can be run with some "did not match" (e.g.'std::ostream *' did not match,'ns3::Hash::Hash32Function_ptr' did not match), although I have installed Xcode, command line tools, python3, macOS_SDK_headers_for_macOS_10.14.pkg, disabled Anaconda and configured Waf to use python3.6.5.


If you have any questions, please feel free to contact me. Thanks in advance.


Qianwen

Tom Henderson

unread,
Oct 9, 2019, 7:57:18 PM10/9/19
to ns-3-...@googlegroups.com, Qianwen Huang
> BRITE Integration             : *not enabled (BRITE not enabled (see
> option --with-brite))*
>
> DES Metrics event collection  : *not enabled (defaults to disabled)*
>
> Emulation FdNetDevice         : *not enabled (needs netpacket/packet.h)*
>
> Examples                      : enabled
>
> File descriptor NetDevice     : enabled
>
> GNU Scientific Library (GSL)  : *not enabled (GSL not found)*
>
> Gcrypt library                : enabled
>
> GtkConfigStore                : enabled
>
> MPI Support                   : *not enabled (option --enable-mpi not
> selected)*
>
> NS-3 Click Integration        : *not enabled (nsclick not enabled (see
> option --with-nsclick))*
>
> NS-3 OpenFlow Integration     : *not enabled (Required boost libraries
> not found)*
>
> Network Simulation Cradle     : *not enabled (NSC not found (see option
> --with-nsc))*
>
> PlanetLab FdNetDevice         : *not enabled (PlanetLab operating system
> not detected (see option --force-planetlab))*
>
> PyViz visualizer              : *not enabled (Missing python modules:
> gi, gi.repository.GObject, cairo, pygraphviz, gi.repository.Gtk,
> gi.repository.Gdk, gi.repository.Pango, gi.repository.GooCanvas)*
>
> Python API Scanning Support   : enabled
>
> Python Bindings               : enabled
>
> Real Time Simulator           : *not enabled (librt is not available)*
>
> SQlite stats data output      : enabled
>
> Tap Bridge                    : *not enabled (<linux/if_tun.h> include
> not detected)*
>
> Tap FdNetDevice               : *not enabled (needs linux/if_tun.h)*
>
> Tests                         : enabled
>
> Threading Primitives          : enabled
>
> Use sudo to set suid bit      : *not enabled (option --enable-sudo not
> selected)*
>
> XmlIo                         : enabled
>
>
> Command ./waf --apiscan=all can be run with some "did not match"
> (e.g.'std::ostream *' did not match,'ns3::Hash::Hash32Function_ptr' did
> not match), although I have installed Xcode, command line tools,
> python3, macOS_SDK_headers_for_macOS_10.14.pkg, disabled Anaconda and
> configured Waf to use python3.6.5.
>
>
> If you have any questions, please feel free to contact me. Thanks in
> advance.
>
>

Thanks for the report. This has been a longstanding problem that no one
has tried to get API scanning working for clang. I thought we had a
Bugzilla issue open for this but I didn't find it now. It is in our
documentation here:

https://www.nsnam.org/docs/release/3.30/manual/html/python.html#generating-bindings-on-macos

I opened up an issue with the details that you provided. Anyone want to
work on this?

https://gitlab.com/nsnam/ns-3-dev/issues/93

- Tom

Qianwen Huang

unread,
Oct 9, 2019, 9:20:19 PM10/9/19
to ns-3-users
Hello Tom,

Thanks for your reply. I didn't notice that difference for MacOS.

Regards,
Qianwen
Reply all
Reply to author
Forward
0 new messages