Cannot find libgoocanvas2 in macOS 10.14 Mojave

533 views
Skip to first unread message

heartofra...@gmail.com

unread,
Feb 13, 2019, 7:51:03 PM2/13/19
to ns-3-users
Hello, I'm using ns-3 in macOS 10.14.3 Mojave. When I tried to build ns-3-dev with bake, it showed as following:

-- System Dependencies --

 > g++ - OK

 > gi-cairo - OK

 > libgoocanvas2 - Missing

   >> GooCanvas2 support missing from system.

   >> Try: "sudo port install libgoocanvas2", if you have sudo rights.

 > pygobject - OK

 > pygraphviz - OK

 > python-dev - OK

 > qt - OK

 > setuptools - OK


But there is no "libgoocanvas2" in macports. I installed nearly all ports in macports with "goocanvas" in their names, but libgoocanvas2 is still reported missing. 


Some websites suggest installing py27-pygoocanvas, but it is not in macports either. 


All modules except PyViz seems to be fine. I need PyViz for visualized simulation. Is there any solutions? Thank you!

Tom Henderson

unread,
Feb 26, 2019, 1:37:08 PM2/26/19
to ns-3-...@googlegroups.com, heartofra...@gmail.com
I was able to get pyviz working on my Mac today, but by using homebrew.

I installed the following packages via homebrew: gtk+3, gobject3,
graphviz, goocanvas

I then installed pygraphviz using homebrew's pip2: pip2 install pygraphviz

Finally, I needed to use the --disable-werror option when configuring Waf:

./waf configure --disable-werror --enable-examples --enable-tests

One should then see that the visualizer is enabled, and I confirmed that
it worked by later running (after the build):

./waf --pyrun src/flow-monitor/examples/wifi-olsr-flowmon.py --vis


You mention that you are using macports. I don't know if there is an
equivalent port for goocanvas. I have read elsewhere that it is not
advisable to mix use of macports and homebrew on the same machine, so
please do not try to mix homebrew and macports before investigating this
further.

- Tom

ahmad wildan

unread,
Dec 9, 2020, 7:37:11 AM12/9/20
to ns-3-users
Hi Tom,  I'm already did following step

ahmadyulianto@192 ns-3.32 % brew install gtk+3 pygobject3 graphviz goocanvas
Updating Homebrew...
Warning: gtk+3 3.24.24 is already installed and up-to-date
To reinstall 3.24.24, run `brew reinstall gtk+3`
Warning: pygobject3 3.38.0_1 is already installed and up-to-date
To reinstall 3.38.0_1, run `brew reinstall pygobject3`
Warning: graphviz 2.44.1 is already installed and up-to-date
To reinstall 2.44.1, run `brew reinstall graphviz`
Warning: goocanvas 2.0.4_2 is already installed and up-to-date
To reinstall 2.0.4_2, run `brew reinstall goocanvas`
ahmadyulianto@192 ns-3.32 % pip install pygraphviz
Requirement already satisfied: pygraphviz in /Users/ahmadyulianto/.pyenv/versions/3.8.6/lib/python3.8/site-packages (1.6)
ahmadyulianto@192 ns-3.32 % ./waf configure
Setting top to                           : /Volumes/MacHD/Myproject/Kampus/Course/WSN/release/ns-allinone-3.32/ns-3.32
Setting out to                           : /Volumes/MacHD/Myproject/Kampus/Course/WSN/release/ns-allinone-3.32/ns-3.32/build
Checking for 'clang' (C compiler)        : /usr/bin/clang
Checking for cc version                  : 12.0.0
Checking for 'clang++' (C++ compiler)    : /usr/bin/clang++
Checking for compilation flag -std=c++11 support : ok
Checking boost includes                          : headers not found, please provide a --boost-includes argument (see help)
Checking boost includes                          : headers not found, please provide a --boost-includes argument (see help)
Checking for program 'python'                    : /Users/ahmadyulianto/.pyenv/versions/3.8.6/bin/python3
Checking for python version >= 2.3               : 3.8.6
python-config                                    : /Users/ahmadyulianto/.pyenv/versions/3.8.6/bin/python3-config
Asking python-config for pyembed '--cflags --libs --ldflags --embed' 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.21.0 (guessed)
Checking for python module 'pybindgen'                                     : 0.21.0
Checking for pybindgen version                                             : 0.21.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'                                      : not found
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 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 'libdpdk'                                                     : not found
Checking for header linux/if_tun.h                                         : not found
Checking for header netpacket/packet.h                                     : not found
Checking for header net/netmap_user.h                                      : not found
Checking for NSC location                                                  : not found
Checking for 'sqlite3'                                                     : yes
Checking for header semaphore.h                                            : 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'                                    : 1.6
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                                                           : /usr/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)
DPDK NetDevice                : not enabled (libdpdk not found, $RTE_SDK and/or $RTE_TARGET environment variable not set or incorrect)
Emulation FdNetDevice         : not enabled (needs netpacket/packet.h)
Examples                      : not enabled (defaults to disabled)
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)
Netmap emulation FdNetDevice  : not enabled (needs net/netmap_user.h)
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, gi.repository.Gtk, gi.repository.Gdk, gi.repository.Pango, gi.repository.GooCanvas)
Python API Scanning Support   : not enabled (Missing 'pygccxml' Python module)
Python Bindings               : enabled
Real Time Simulator           : not enabled (librt is not available)
SQLite stats support          : enabled
Tap Bridge                    : not enabled (<linux/if_tun.h> include not detected)
Tap FdNetDevice               : not enabled (needs linux/if_tun.h)
Tests                         : not enabled (defaults to disabled)
Threading Primitives          : enabled
Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
XmlIo                         : enabled
'configure' finished successfully (7.150s)

The result still not enabled for visualizer

Tom Henderson

unread,
Dec 9, 2020, 12:29:40 PM12/9/20
to ns-3-...@googlegroups.com, ahmad wildan
On 12/9/20 4:37 AM, ahmad wildan wrote:
> Hi Tom,  I'm already did following step
>

Can you check whether brew installed your packages here:

/Users/ahmadyulianto/.pyenv/versions/3.8.6/lib/python3.8/site-packages

or in a place where the version of Python you are using can find it?

i.e. if you open a python interpreter from the command line:

$ /Users/ahmadyulianto/.pyenv/versions/3.8.6/bin/python3

can you successfully do 'import gi' from the prompt?

If not, you may need to extend your PYTHONPATH environment variable to
include the location where brew is putting its packages.

- Tom


> ahmadyulianto@192 ns-3.32 % *brew install gtk+3 pygobject3 graphviz
> goocanvas*
> Updating Homebrew...
> Warning: gtk+3 3.24.24 is already installed and up-to-date
> To reinstall 3.24.24, run `brew reinstall gtk+3`
> Warning: pygobject3 3.38.0_1 is already installed and up-to-date
> To reinstall 3.38.0_1, run `brew reinstall pygobject3`
> Warning: graphviz 2.44.1 is already installed and up-to-date
> To reinstall 2.44.1, run `brew reinstall graphviz`
> Warning: goocanvas 2.0.4_2 is already installed and up-to-date
> To reinstall 2.0.4_2, run `brew reinstall goocanvas`
> ahmadyulianto@192 ns-3.32 % *pip install pygraphviz*
> *PyViz visualizer              : not enabled (Missing python modules:
> gi, gi.repository.GObject, cairo, gi.repository.Gtk, gi.repository.Gdk,
> gi.repository.Pango, gi.repository.GooCanvas)*
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ns-3-users/53ccce1c-a554-4319-84b7-00f253acb9fcn%40googlegroups.com
> <https://groups.google.com/d/msgid/ns-3-users/53ccce1c-a554-4319-84b7-00f253acb9fcn%40googlegroups.com?utm_medium=email&utm_source=footer>.

ahmad wildan

unread,
Dec 14, 2020, 11:02:29 AM12/14/20
to ns-3-users
Hi Tom,
After several hours I found that when I used python version 3.9.1 PyViz successfully enabled, but it cannot build since ns-3 not yet support for python 3.9. When I use python 3.8.6 PyViz not enabled..  Any suggestion pls ?

.....
Checking for python version >= 2.3               : 3.9.1
...
---- 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)
DPDK NetDevice                : not enabled (libdpdk not found, $RTE_SDK and/or $RTE_TARGET environment variable not set or incorrect)
Emulation FdNetDevice         : not enabled (needs netpacket/packet.h)
Examples                      : not enabled (defaults to disabled)
File descriptor NetDevice     : enabled
GNU Scientific Library (GSL)  : not enabled (GSL not found)
Gcrypt library                : not enabled (libgcrypt not found: you can use libgcrypt-config to find its location.)
GtkConfigStore                : not enabled (library 'gtk+-3.0 >= 3.0' not found)

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)
Netmap emulation FdNetDevice  : not enabled (needs net/netmap_user.h)
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              : enabled

Python API Scanning Support   : not enabled (Missing 'pygccxml' Python module)
Python Bindings               : enabled
Real Time Simulator           : not enabled (librt is not available)
SQLite stats support          : enabled
Tap Bridge                    : not enabled (<linux/if_tun.h> include not detected)
Tap FdNetDevice               : not enabled (needs linux/if_tun.h)
Tests                         : not enabled (defaults to disabled)
Threading Primitives          : enabled
Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
XmlIo                         : enabled
'configure' finished successfully (7.517s)

Tom Henderson

unread,
Dec 14, 2020, 12:10:44 PM12/14/20
to ns-3-...@googlegroups.com, ahmad wildan
On 12/14/20 8:02 AM, ahmad wildan wrote:
> Hi Tom,
> After several hours I found that when I used python version 3.9.1 PyViz
> successfully enabled, but it cannot build since ns-3 not yet support for
> python 3.9. When I use python 3.8.6 *PyViz not enabled..*  Any
> suggestion pls ?

Why do you believe that ns-3 does not have support for Python 3.9? I
have been using it on Fedora 33 which ships Python 3.9.0.

- Tom

ahmad wildan

unread,
Dec 14, 2020, 6:58:59 PM12/14/20
to ns-3-users
Because I face an error when build with 3.9.1, this is the log:

[2224/2847] Processing command (${PYTHON}): ../bindings/python/ns3modulegen-modular.py ../src/wimax/bindings/modulegen__gcc_ILP32.py -> src/wimax/bindings/ns3module.cc src/wimax/bindings/ns3module.h src/wimax/bindings/ns3modulegen.log
[2225/2847] Compiling build/src/antenna/bindings/ns3module.cc
In file included from src/antenna/bindings/ns3module.cc:1:
src/antenna/bindings/ns3module.h:1200:27: error: 'PyEval_ThreadsInitialized' is deprecated [-Werror,-Wdeprecated-declarations]
        __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
                          ^

/usr/local/Cellar/python@3.9/3.9.1/Frameworks/Python.framework/Versions/3.9/include/python3.9/ceval.h:129:1: note: 'PyEval_ThreadsInitialized' has been explicitly marked deprecated here
Py_DEPRECATED(3.9) PyAPI_FUNC(int) PyEval_ThreadsInitialized(void);
^
I got success build with 3.8.6 . Any suggest with that?

ahmad wildan

unread,
Dec 14, 2020, 7:41:21 PM12/14/20
to ns-3-users
In normally build, when warning generated that show the errors happen, build process will exit.. but with --disable-werror it still continue to build.
Is it OK to disable error with this command ? (as you mention in previous message)
./waf configure --disable-werror --enable-examples --enable-tests

does it affect the simulation program compiling/results after this?

Tom Henderson

unread,
Dec 14, 2020, 10:09:48 PM12/14/20
to ns-3-...@googlegroups.com, ahmad wildan
On 12/14/20 4:41 PM, ahmad wildan wrote:
In normally build, when warning generated that show the errors happen, build process will exit.. but with --disable-werror it still continue to build.
Is it OK to disable error with this command ? (as you mention in previous message)
./waf configure --disable-werror --enable-examples --enable-tests

Yes, it is OK, but if you can use a more recent release, you may not need to take this step.  ns-3.32 is our most recent release.

- Tom

Tom Henderson

unread,
Dec 14, 2020, 10:42:54 PM12/14/20
to ns-3-...@googlegroups.com, ahmad wildan

I understand now why you are seeing this and I'm not.

The upstream pybindgen tool is generating that header; it needs to be updated.

However, you are compiling with -Wdeprecated-declarations while I am compiling with -Wno-error=deprecated-declarations.

The reason is that we disabled this for whenever the GTK config store is enabled (see https://www.nsnam.org/bugzilla/show_bug.cgi?id=2978).  You seem to be building on a Mac where you probably do not picking up this flag (which comes from src/config-store/wscript:40).

So, I see now that we have a problem and will try to get it fixed.

For now, the --disable-werror option to 'waf configure' should work around it.

- Tom

ahmad wildan

unread,
Dec 14, 2020, 10:54:13 PM12/14/20
to ns-3-users
Btw I use ns-3.32, and should take this step..

'distclean' finished successfully (0.024s)

(labWSN) ahmadyulianto@192 ns-3.32 % ./waf configure

Setting top to                           
  /Users/ahmadyulianto/labWSN/ns-3-allinone/ns-3.32

Setting out to                           
  /Users/ahmadyulianto/labWSN/ns-3-allinone/ns-3.32/build

ahmad wildan

unread,
Dec 14, 2020, 11:06:17 PM12/14/20
to ns-3-users
 Thanks Tom for your info, hope this will get fixed soon.. I use macOS 10.15.7 , python 3.9.1 with pyenv and pipenv

For now, the --disable-werror option to 'waf configure' should work around it.

- Tom

Yes, I used this n it works.

ahmad wildan

unread,
Dec 16, 2020, 12:08:27 AM12/16/20
to ns-3-users
Here's the result, some module failed to build using python 3.9.1

fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Waf: Leaving directory `/Users/ahmadyulianto/labWSN/ns-3-allinone/ns-3.32/build'
Build failed
 -> task in 'ns3module_antenna' failed with exit status 1 (run with -v to display more information)
 -> task in 'ns3module_aodv' failed with exit status 1 (run with -v to display more information)
 -> task in 'ns3module_applications' failed with exit status 1 (run with -v to display more information)

Reply all
Reply to author
Forward
0 new messages