Ns-3.32-errata: Difference between revisions

From Nsnam
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 9: Line 9:
If Python is enabled with ns-3.32 and the Python being used is version 3.9, then the build may fail with messages such as:
If Python is enabled with ns-3.32 and the Python being used is version 3.9, then the build may fail with messages such as:


```
src/antenna/bindings/ns3module.h:1200:27: error: 'PyEval_ThreadsInitialized' is deprecated [-Werror,-Wdeprecated-declarations]
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);
         __py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
```
 


If this occurs, one workaround is to disable the CXXFLAGS `-Werror` flag at configuration time, with a Waf flag called ``--disable-werror``:
If this occurs, one workaround is to disable the CXXFLAGS `-Werror` flag at configuration time, with a Waf flag called ``--disable-werror``:


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


See:  https://gitlab.com/nsnam/ns-3-dev/-/issues/318  for discussion of the long-term fix.
See:  https://gitlab.com/nsnam/ns-3-dev/-/issues/318  for discussion of the long-term fix.
Line 28: Line 26:
This is causing ns-3 Python-enabled builds to fail, when using Python 3.9:
This is causing ns-3 Python-enabled builds to fail, when using Python 3.9:


```
 
TypeError: str expected, not int
TypeError: str expected, not int
```
 


One workaround is to apply the patch to Waf:  https://gitlab.com/ita1024/waf/-/commit/60e3f5f488dc88ff50984f51be7f7293b9a0b0fb
One workaround is to apply the patch to Waf:  https://gitlab.com/ita1024/waf/-/commit/60e3f5f488dc88ff50984f51be7f7293b9a0b0fb
Line 36: Line 34:
A different workaround is to use the system Python, and not a Homebrew or Anaconda Python version, during Waf configure:
A different workaround is to use the system Python, and not a Homebrew or Anaconda Python version, during Waf configure:


```
./waf configure --python=/usr/bin/python3 ...
./waf configure --python=/usr/bin/python3 ...
 
```


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

Latest revision as of 23:10, 17 December 2020

Main Page - Roadmap - Summer Projects - Project Ideas - Developer FAQ - Tools - Related Projects

HOWTOs - Installation - Troubleshooting - User FAQ - Samples - Models - Education - Contributed Code - Papers

Errata against ns-3.32 release

The following issues have been identified since the ns-3.32 release, and will be addressed in ns-3.33 release. In the meantime, the below workarounds are possible.

Python 3.9 compatibility (general)

If Python is enabled with ns-3.32 and the Python being used is version 3.9, then the build may fail with messages such as:

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);


If this occurs, one workaround is to disable the CXXFLAGS `-Werror` flag at configuration time, with a Waf flag called ``--disable-werror``:

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


See: https://gitlab.com/nsnam/ns-3-dev/-/issues/318 for discussion of the long-term fix.

Python 3.9 compatibility (macOS Big Sur)

macOS 11 (Big Sur) apparently has a regression with CPython: https://bugs.python.org/issue42504

This is causing ns-3 Python-enabled builds to fail, when using Python 3.9:


TypeError: str expected, not int


One workaround is to apply the patch to Waf: https://gitlab.com/ita1024/waf/-/commit/60e3f5f488dc88ff50984f51be7f7293b9a0b0fb

A different workaround is to use the system Python, and not a Homebrew or Anaconda Python version, during Waf configure:

./waf configure --python=/usr/bin/python3 ...


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