ns3.29 unused typedef error MacOs

775 views
Skip to first unread message

Giovanna Garcia

unread,
Sep 22, 2018, 7:33:37 AM9/22/18
to ns-3-users
Hello, 

I got the following problem after patching to the ns3.29 version:

In file included from ../src/internet/model/ipv6-interface.cc:33:
In file included from ../src/internet/model/icmpv6-l4-protocol.h:33:
In file included from ../src/internet/model/ndisc-cache.h:32:
In file included from ./ns3/timer.h:302:
In file included from ./ns3/timer-impl.h:24:
In file included from ./ns3/simulator.h:26:
./ns3/make-event.h:665:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]
    typedef void (*F)(U1, U2, U3);
                   ^
1 error generated.

Waf: Leaving directory `/Users/GGarciaBas/Documents/GitHub/nsnam_ns3/build'
Build failed
 -> task in 'ns3-internet' failed with exit status 1 (run with -v to display more information)

I have used the same version of ns3.27 in my MacOs 10.13.6 and Linux, after I patch to the ns3.28, ns3.28.1 and finally to ns3.29, I got that error just in the MacOs.

I opened the file described in the error and I saw that this typedef is used bellow, that do not make sense the 'unused' error.

template <typename U1, typename U2, typename U3,
typename T1, typename T2, typename T3>
EventImpl * MakeEvent (void (*f)(U1,U2,U3), T1 a1, T2 a2, T3 a3)
{
// three arg version
class EventFunctionImpl3 : public EventImpl
{
public:
typedef void (*F)(U1, U2, U3); // 665 line

EventFunctionImpl3 (F function, T1 a1, T2 a2, T3 a3)
: m_function (function),
m_a1 (a1),
m_a2 (a2),
m_a3 (a3)
{
}
protected:
virtual ~EventFunctionImpl3 ()
{
}
private:
virtual void Notify (void)
{
(*m_function)(m_a1, m_a2, m_a3);
}
F m_function;
typename TypeTraits<T1>::ReferencedType m_a1;
typename TypeTraits<T2>::ReferencedType m_a2;
typename TypeTraits<T3>::ReferencedType m_a3;
} *ev = new EventFunctionImpl3 (f, a1, a2, a3);
return ev;
}



Anyone know what it could be?


Thanks in advice,
Giovanna Garcia.

Rob Kers

unread,
Sep 22, 2018, 8:22:40 AM9/22/18
to ns-3-users
Hi!

I installed ns3 on my Mac 10.13.6 and did not have this problem. However, I do compile with GCC instead of Clang and I've noticed Clang complains about a lot of things (with default settings). 
I don't know a solution, but you might wanna try the following work arounds.
You might want to try to compile with GCC as a work around.  Or, remove the Wunusded compile flag that treats unused variables as errors. 

Hope this helps

Another work around for now could be 

Op zaterdag 22 september 2018 13:33:37 UTC+2 schreef Giovanna Garcia:

Tom Henderson

unread,
Sep 22, 2018, 12:00:28 PM9/22/18
to ns-3-...@googlegroups.com
On 09/22/2018 04:33 AM, Giovanna Garcia wrote:
Hello, 

I got the following problem after patching to the ns3.29 version:

In file included from ../src/internet/model/ipv6-interface.cc:33:
In file included from ../src/internet/model/icmpv6-l4-protocol.h:33:
In file included from ../src/internet/model/ndisc-cache.h:32:
In file included from ./ns3/timer.h:302:
In file included from ./ns3/timer-impl.h:24:
In file included from ./ns3/simulator.h:26:
./ns3/make-event.h:665:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]
    typedef void (*F)(U1, U2, U3);
                   ^
1 error generated.

Waf: Leaving directory `/Users/GGarciaBas/Documents/GitHub/nsnam_ns3/build'
Build failed
 -> task in 'ns3-internet' failed with exit status 1 (run with -v to display more information)

I have used the same version of ns3.27 in my MacOs 10.13.6 and Linux, after I patch to the ns3.28, ns3.28.1 and finally to ns3.29, I got that error just in the MacOs.


Hi all, this is a bug that was just fixed in the mainline ns-3-dev and will be part of an ns-3.29 maintenance update (hopefully published next week).

We have an errata page for issues discovered in the releases, and you can read about how to work around this issue:

https://www.nsnam.org/wiki/Ns-3.29-errata

- Tom

Sayed Mahdi Faghih Imani

unread,
Sep 24, 2018, 11:18:09 PM9/24/18
to 'pdbarnes' via ns-3-users
Hi Tom,

I have got the same error in ns-3.29 in macOS 10.13.6 like this:

In file included from ../src/internet/helper/ipv6-routing-helper.cc:23:
In file included from ./ns3/simulator.h:26:
./ns3/make-event.h:665:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]
    typedef void (*F)(U1, U2, U3);
                   ^
./ns3/make-event.h:699:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]
    typedef void (*F)(U1, U2, U3, U4);
                   ^
./ns3/make-event.h:633:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]
    typedef void (*F)(U1, U2);
                   ^
./ns3/make-event.h:665:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]
    typedef void (*F)(U1, U2, U3);
                   ^
4 errors generated.

Moreover, with ns-3.28 and Xcode 9, Python Bindings and visualizer were enabled, but when I upgrade to Xcode 10 with latest command line tools the error is:

Setting top to                           : /Users/imani/ns-allinone-3.29/ns-3.29 
Setting out to                           : /Users/imani/ns-allinone-3.29/ns-3.29/build 
Checking for 'clang' (C compiler)        : /usr/bin/clang 
Checking for cc version                  : 10.0.0 
Checking for 'clang++' (C++ compiler)    : /usr/bin/clang++ 
Checking for compilation flag -std=c++11 support : ok 
Checking for program 'python'                    : /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python 
Checking for python version >= 2.3               : 2.7.15 
python-config                                    : /opt/local/bin/python2.7-config 
Asking python-config for pyembed '--cflags --libs --ldflags' flags : yes 
Testing pyembed configuration                                      : Could not build a python embedded interpreter 
Checking boost includes                                            : 1_66 
Checking boost libs                                                : ok 
Checking for boost linkage                                         : ok 
Checking for click location                                        : not found 
Checking for program 'pkg-config'                                  : /opt/local/bin/pkg-config 
Checking for 'gtk+-3.0'                                            : not found 
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 OpenFlow location                                     : not found 
Checking for 'sqlite3'                                             : yes 
Checking for header linux/if_tun.h                                 : not found 
Checking for program 'sudo'                                        : /usr/bin/sudo 
Checking for program 'valgrind'                                    : not found 
Checking for 'gsl'                                                 : not found 
python-config                                                      : not found 
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                : 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 (OpenFlow not enabled (see option --with-openflow))
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 (Python Bindings are needed but not enabled)
Python Bindings               : not enabled (Python library or headers missing)
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                         : 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 (3.049s)
Mahdis-MBP:ns-3.29 imani$ 

After that, I followed the ns-3.29-errata post that you mentioned and I have configured with —disable-werror that lead to Python Bindings enabled but PyViz not:

PyViz visualizer              : not enabled (Missing python modules: gi, gi.repository.GObject, 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

What is the problem? Can you help me, please?
Thanks


--
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.
To post to this group, send email to 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.

Devin Y

unread,
Oct 15, 2018, 5:22:17 AM10/15/18
to ns-3-users
./waf configure --disable-werror

Manali Sharma

unread,
Nov 4, 2018, 2:17:28 PM11/4/18
to ns-3-users
This did not work for me. Is there any other solution to this.
Here is my error log:

[1232/1820] Compiling src/spectrum/model/spectrum-model-ism2400MHz-res1MHz.cc

In file included from ../src/internet/helper/ipv6-routing-helper.cc:23:

In file included from ./ns3/simulator.h:26:

./ns3/make-event.h:665:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]

    typedef void (*F)(U1, U2, U3);

                   ^

./ns3/make-event.h:699:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]

    typedef void (*F)(U1, U2, U3, U4);

                   ^

./ns3/make-event.h:633:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]

    typedef void (*F)(U1, U2);

                   ^

./ns3/make-event.h:665:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]

    typedef void (*F)(U1, U2, U3);

                   ^

4 errors generated.


In file included from ../src/internet/helper/ipv4-routing-helper.cc:23:

In file included from ./ns3/simulator.h:26:

./ns3/make-event.h:665:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]

    typedef void (*F)(U1, U2, U3);

                   ^

./ns3/make-event.h:699:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]

    typedef void (*F)(U1, U2, U3, U4);

                   ^

./ns3/make-event.h:633:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]

    typedef void (*F)(U1, U2);

                   ^

./ns3/make-event.h:665:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]

    typedef void (*F)(U1, U2, U3);

                   ^

4 errors generated.


In file included from ../src/internet/model/ipv6-interface.cc:33:

In file included from ../src/internet/model/icmpv6-l4-protocol.h:33:

In file included from ../src/internet/model/ndisc-cache.h:32:

In file included from ./ns3/timer.h:302:

In file included from ./ns3/timer-impl.h:24:

In file included from ./ns3/simulator.h:26:

./ns3/make-event.h:665:20: error: unused typedef 'F' [-Werror,-Wunused-local-typedef]

    typedef void (*F)(U1, U2, U3);

                   ^

1 error generated.


Waf: Leaving directory `/Users/manalisharma/Desktop/NS3 Source Code/ns-allinone-3.29/ns-3.29/build'

Build failed

 -> task in 'ns3-internet' failed with exit status 1 (run with -v to display more information)

 -> task in 'ns3-internet' failed with exit status 1 (run with -v to display more information)

 -> task in 'ns3-internet' failed with exit status 1 (run with -v to display more information)

Traceback (most recent call last):

  File "./build.py", line 176, in <module>

    sys.exit(main(sys.argv))

  File "./build.py", line 167, in main

    build_ns3(config, build_examples, build_tests, args, build_options)

  File "./build.py", line 87, in build_ns3

    run_command([sys.executable, "waf", "build"] + build_options)

  File "/Users/manalisharma/Desktop/NS3 Source Code/ns-allinone-3.29/util.py", line 25, in run_command

    raise CommandError("Command %r exited with code %i" % (argv, retval))

util.CommandError: Command ['/usr/bin/python', 'waf', 'build'] exited with code 1


On Monday, 15 October 2018 05:22:17 UTC-4, Devin Y wrote:
./waf configure --disable-werror

Tom Henderson

unread,
Nov 14, 2018, 5:28:12 PM11/14/18
to ns-3-...@googlegroups.com
On 11/4/18 11:17 AM, Manali Sharma wrote:
This did not work for me. Is there any other solution to this.
Here is my error log:

[1232/1820] Compiling src/spectrum/model/spectrum-model-ism2400MHz-res1MHz.cc

In file included from ../src/internet/helper/ipv6-routing-helper.cc:23:

In file included from ./ns3/simulator.h:26:

I just tested that this still works for me still using the ns-3.29 release on a Mac.  If I do not include '--disable-werror' in the configure step, it fails with the above, but if I do include it, it succeeds.

If you need more visibility into how Waf is building, try building with the -vvv flag:

./waf build -vvv


Reply all
Reply to author
Forward
0 new messages