Skip to content

NS3 3.35 Installation error on MacOS M1 Monterey

Maybe it is a duplicate but I couldn't find the issue. It is the same issue in the google ns3 groups

When installing ns-3.35 with waf, I got this error:

[1487/2102] Compiling src/wifi/model/wifi-tx-timer.cc
12:04:45 runner ['/usr/bin/clang++', '-Wall', '-Wno-unused-local-typedefs', '-Wno-potentially-evaluated-expression', '-std=c++17', '-fPIC', '-I.', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_SEMAPHORE_H=1', '../src/wifi/model/wifi-tx-timer.cc', '-c', '-o/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/build/src/wifi/model/wifi-tx-timer.cc.1.o']
../src/wifi/model/ht/ht-frame-exchange-manager.cc:900:57: error: 'value' is unavailable: introduced in macOS 10.13
              hdr.SetQosQueueSize (queueSizeForTid[tid].value ());
                                                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/optional:959:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
1 error generated.

Waf: Leaving directory `/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/build'
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/./waf", line 170, in <module>
    Scripting.waf_entry_point(cwd, VERSION, wafdir)
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/.waf3-2.0.21-c6c9a875365426e5928462b9b74d40b5/waflib/Scripting.py", line 119, in waf_entry_point
    run_commands()
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/.waf3-2.0.21-c6c9a875365426e5928462b9b74d40b5/waflib/Scripting.py", line 182, in run_commands
    ctx=run_command(cmd_name)
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/.waf3-2.0.21-c6c9a875365426e5928462b9b74d40b5/waflib/Scripting.py", line 173, in run_command
    ctx.execute()
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/.waf3-2.0.21-c6c9a875365426e5928462b9b74d40b5/waflib/Scripting.py", line 375, in execute
    return execute_method(self)
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/.waf3-2.0.21-c6c9a875365426e5928462b9b74d40b5/waflib/Build.py", line 93, in execute
    self.execute_build()
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/.waf3-2.0.21-c6c9a875365426e5928462b9b74d40b5/waflib/Build.py", line 100, in execute_build
    self.compile()
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/.waf3-2.0.21-c6c9a875365426e5928462b9b74d40b5/waflib/Tools/errcheck.py", line 140, in check_compile
    ret=self.orig_compile()
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/.waf3-2.0.21-c6c9a875365426e5928462b9b74d40b5/waflib/Build.py", line 176, in compile
    raise Errors.BuildError(self.producer.error)
  File "/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/.waf3-2.0.21-c6c9a875365426e5928462b9b74d40b5/waflib/Errors.py", line 26, in __init__
    WafError.__init__(self,self.format_error())

Build failed
 -> task in 'ns3-wifi' failed with exit status 1:
	{task 4333366064: cxx ht-frame-exchange-manager.cc -> ht-frame-exchange-manager.cc.1.o}
['/usr/bin/clang++', '-Wall', '-Wno-unused-local-typedefs', '-Wno-potentially-evaluated-expression', '-std=c++17', '-fPIC', '-I.', '-DNS3_BUILD_PROFILE_DEBUG', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_SYS_IOCTL_H=1', '-DHAVE_IF_NETS_H=1', '-DHAVE_NET_ETHERNET_H=1', '-DHAVE_SQLITE3=1', '-DHAVE_SEMAPHORE_H=1', '../src/wifi/model/ht/ht-frame-exchange-manager.cc', '-c', '-o/Users/furkanguvenc/ns-allinone-3.35/ns-3.35/build/src/wifi/model/ht/ht-frame-exchange-manager.cc.1.o']

I have m1 with Monterey 12.1

My Xcode command line tools

package-id: com.apple.pkg.CLTools_Executables
version: 13.3.0.0.1.1645755326
volume: /
location: /
install-time: 1647988102
groups: com.apple.FindSystemFiles.pkg-group

My clang

Apple clang version 13.1.6 (clang-1316.0.21.2)
Target: arm64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin