I've actually been testing if it is possible to even use bindings with cppyy installed with pip to propose a workaround of setting it up outside Arch packaging (and adding virtual package) but this is not enough: even with working cppyy, bindings will complain that one of libs, that is being provided by older versions of DPDK in another distros, is missing. So yeah, it is hopelessly broken at this point until someone will want to tackle with both of these issues in Arch or upstream will move bindings towards something else (QT python bindings somehow has no issues with being built and packaged on Arch, as for example that it could "just work").
Search Criteria
Package Details: ns3 3.47-5
Package Actions
| Git Clone URL: | https://aur.archlinux.org/ns3.git (read-only, click to copy) |
|---|---|
| Package Base: | ns3 |
| Description: | Discrete-event network simulator for Internet systems |
| Upstream URL: | https://www.nsnam.org/ |
| Keywords: | ns3 nsnam |
| Licenses: | GPL-2.0-only |
| Submitter: | yhfudev |
| Maintainer: | SpacingBat3 |
| Last Packager: | SpacingBat3 |
| Votes: | 9 |
| Popularity: | 0.000004 |
| First Submitted: | 2015-10-07 15:56 (UTC) |
| Last Updated: | 2026-04-24 18:43 (UTC) |
Dependencies (25)
- boost-libs
- brite (brite-gitAUR)
- click-ns3 (click-ns3-gitAUR)
- dpdk (dpdk-gitAUR, dpdk-ltsAUR)
- gsl (gsl-gitAUR)
- gtk3 (gtk3-no_deadkeys_underlineAUR, gtk3-classicAUR, gtk3-patched-filechooser-icon-viewAUR, gtk3-classic-xfceAUR)
- libxml2 (libxml2-gitAUR, libxml2-meson-gitAUR)
- openflow (openflow-gitAUR)
- openmpi (openmpi-gitAUR)
- sqlite3 (sqlite)
- boost (boost-gitAUR) (make)
- cmake (cmake3AUR, cmake-gitAUR) (make)
- eigen3 (make)
- gcc (gcc-gitAUR, gccrs-gitAUR, gcc-snapshotAUR) (make)
- git (git-gitAUR, git-glAUR, git-wd40AUR) (make)
- ninja (ninja-gitAUR, ninja-memAUR, ninja-noemacs-gitAUR, ninja-kitwareAUR, ninja-fuchsia-gitAUR, n2-ninja-symlinkAUR) (make)
- python (make)
- iproute2 (iproute2-gitAUR, iproute2-selinuxAUR) (optional) – virtual machines in network
- iptables (iptables-gitAUR, iptables-fullconenat-nftAUR, iptables-legacy) (optional) – virtual machines in network
- lxc (lxc-selinuxAUR, lxc-gitAUR) (optional) – virtual machines in network
- Show 5 more dependencies...
Required by (2)
- netanim (optional)
- ns3-examples
Sources (3)
SpacingBat3 commented on 2026-04-24 16:04 (UTC) (edited on 2026-05-02 13:27 (UTC) by SpacingBat3)
SpacingBat3 commented on 2026-04-22 11:54 (UTC) (edited on 2026-04-22 13:11 (UTC) by SpacingBat3)
What is missing from
root? Could you provide an example of what isn't working?
@TUC libcppyy is not being provided as a Python module, so all lines and stuff that depends on import libcppyy are conflicting with root. root is just not a complete cppyy provider for the time being I suppose… unless something did change very recently in root I didn't take a record of.
TUC commented on 2026-04-22 08:20 (UTC)
Not everything works / can be confirmed to work. [..] and
rootpackage is not enough for using bindings.
What is missing from root? Could you provide an example of what isn't working?
SpacingBat3 commented on 2026-04-21 14:55 (UTC) (edited on 2026-05-02 13:29 (UTC) by SpacingBat3)
CURRENT PACKAGE STATUS
-
Not everything works / can be confirmed to work.
cppyycannot be built from AUR, for example, androotpackage is not enough for using bindings. -
As tests pass in Arch,
ns3as a set of libraries should work now with all components enabled. 🎉️ -
I've reworked
PKGBUILDdrastically. It should be much more readable and have less hacks, plus NS-3 is now a split package so eg. python bindings can be installed separatively fromns3. Most deps should also be organised properly so they are installed on-demand. -
Python bindings are broken, it requires a lot more effort to make them to work: at least providing
libcppyypython module alongsidecppyyis required and getting somehow alibrte_pmd_e1000.solibrary (that was part of DPDK but at least it isn't in the latest releases). As an alternative,mpiis being enabled in build so we at least can use this as optional feature. -
Local docs distribution is WIP. Doxygen seems to be too large to bundle into mosts systems (>1GB!!!) and does package slow and Sphinx docs are TBD.
I'll be keeping this comment up-to-date as we figure things out. In the meantime, feel free to comment and discuss what could be done better on my side with the packaging or maybe how to handle incompatibilities of components (MPI vs Python).
SpacingBat3 commented on 2026-03-13 00:26 (UTC) (edited on 2026-03-13 12:44 (UTC) by SpacingBat3)
For the time being I've adopted this package, I'll try to go as far as I'm able to, to make it fully functional. It's still very much at bad state and I might take a look how Debian folks are dealing with stuff:
-
I've started writting PKGBUILD mostly from scratch. Since it has so many deps I've also started documenting them somehow for the future maintainers (like for what purpose are there).
-
Not everything still was ported successfully or just works. For some there might be a need to colectively discuss with other package maintainers (i.e. maybe some stuff is missing as it is skipped at build time on their side). But some stuff from repo went fine and there's rather short list of integrations that are not being built within NS3.
-
I'm trying to split NS-3 to become a split package, so Python bindings (and docs! although I only did not made docs working as I focused on fixing more stuff that is important at runtime) will be in a separate optional package. Right now I'm still figuring out what bindings are needed for NS3 to work (I dunno what provides
libcppyyPython module in Arch). Maybe it is also a thing that needs to be patched, worst-case scenario, in caselibcppyyis somewhat outdated (hope not!). -
Also, the DPDK patch was actually made by me from scratch without looking at MR that @TUC mentioned. It is much simpler and basically does the same thing but in more Arch-centric way (does not provide backwards compatibility), so it'll stay until the next NS-3 release.
-
I might also work on another separate packages. And to also cleanup deps that are needed at runtime. Many of there are either build time only, or deps for another component that is packaged outside NS-3, or maybe even unnecessary at build time.
Should say, if there's anyone more capable of dealing with NS-3, mainly properly integrating it into system deployment, then I might either accept co-maintainers (as long as they can advocate well they are capable at maintaining it) or even step back entirely from maintaining this, as NS-3 is probably one of the most unusual software suites I've ever dealt with packaging. Feel free to share your thoughts / opinions / etc, even if you don't plan to really work on packaging. Might help at least with decision-making or figuring out the build framework.
TUC commented on 2025-01-31 14:51 (UTC)
The python packages cppyy-backend, cppyy, cpycppyy are in the extra repository now and should be removed from sources. Instead they should be added to the dependency section.
The custom sed command to fix the DPDK build could be replaced by a patch from https://gitlab.com/nsnam/ns-3-dev/-/merge_requests/2254
The license should be changed to 'GPL-2.0-only'.
xh-ch commented on 2024-09-05 22:15 (UTC) (edited on 2024-09-06 07:15 (UTC) by xh-ch)
There are severel problems with the build-process of the underlying project. However, I was able to successfully build it on a recent Arch-installation, by applying some patches. Note the list of problems that occured:
-
The waflib-file within this project is not compatible with any python installation starting from python3.4. This has been fixed by waf.io long time ago. But the project-maintainer need to update! My change fixes it by applying a patch to the waf-file (which is specifically NOT recommended)
-
The build-process of ns3 relies on
gzcatand uses in their dockerfile just a symlink tozcat. I applied this to the PKGBUILD-file here -
The install-step in building this package somehow misses the python-bindings (again a problem by the upstream project). I therefore added a manual installation
However, I haven't seen the NS3_BINDINGS_INSTALL_DIR was not set-error, reported previously.
Also note: if you have installed the package on your system, rebuilding it will fail with a problem on applying cppyy-cling-6.27.1.patch. I haven't investigated it further, but this should be fixed as well.
None of these points have so far been reported upstream, also because I have'nt found a channel to do so. Feel free to report them.
Here are my suggested changes:
diff --git a/PKGBUILD b/PKGBUILD
index 17aadf1..6cc38a3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -43,6 +43,7 @@ source=("https://www.nsnam.org/releases/ns-allinone-$pkgver.tar.bz2"
"https://files.pythonhosted.org/packages/source/c/cppyy-backend/cppyy-backend-$_cppyy_backend_ver.tar.gz"
"https://files.pythonhosted.org/packages/source/C/CPyCppyy/CPyCppyy-$_cpycppyy_ver.tar.gz"
"ns3-scratch-nested-subdir.patch"
+ "ns3-openflow-importlib.patch"
"cppyy-cling-6.27.1.patch"
"brite.tar.gz::https://code.nsnam.org/BRITE/archive/tip.tar.gz"
"openflow.tar.gz::https://code.nsnam.org/openflow/archive/tip.tar.gz"
@@ -52,6 +53,7 @@ sha256sums=('c0ba395b6fcb084c4d43d6117b28932f716b26aebb54498ce2f44c0c39be3e60'
'51ac01c4cca28ef54544ce0b41355d885242f1a0178619bea071f5c43fd03dac'
'19188585eda3538eb69d32fd3fa9db0cc85a6031b6ca6955efff8051b798a73e'
'20daecc727ac793732be25d5a2977f72c8edaa5c01720d5999069936cfe9d292'
+ '8cad25914a9365fff25e1c47af3062ebc15d3bf5246e73f02090a6d21b661ef2'
'2577f9db94474acf3f804cc9c38f1dfe8367e0e4a35888cb09407d40d372727f'
'SKIP'
'SKIP'
@@ -67,12 +69,24 @@ prepare() {
-e '/split_hdr_size/d'
patch -Np1 -i "$srcdir/ns3-scratch-nested-subdir.patch"
+ openflow_dir="$(realpath "$srcdir"/openflow-*)"
+ cd "$openflow_dir"
+ patch -Np1 -i "$srcdir/ns3-openflow-importlib.patch"
+
# https://github.com/kohler/click/issues/493
cd "$srcdir/click-git"
sed -i -e '/linux_true/d' include/click/cxxprotect.h
+
+ venv_dir="$srcdir/.venv"
+ rm -rf "$venv_dir" # cleanup from potential previous builds
}
build() {
+ build_bin_dir="$srcdir/.bin"
+ mkdir -p "$build_bin_dir"
+ ln -sf /bin/zcat "$build_bin_dir/gzcat"
+ PATH="$PATH:$build_bin_dir"
+
# brite
# https://www.nsnam.org/docs/models/html/brite.html
brite_dir="$(realpath "$srcdir"/BRITE-*)"
@@ -222,6 +236,10 @@ package() {
-e "s,;$srcdir,,g" \
-e "s,-I$srcdir,,g" \
"${FILES[@]}"
+
+ # Python bindings
+ python_dir="$(ls "$pkgdir"/usr/lib/ | grep python*)"
+ install -Dm755 ./bindings/python/ns__init__.py "$pkgdir"/usr/lib/"$python_dir"/site-packages/ns/__init__.py
}
# vim: set ts=4 sw=4 et :
diff --git a/ns3-openflow-importlib.patch b/ns3-openflow-importlib.patch
new file mode 100644
index 0000000..5372025
--- /dev/null
+++ b/ns3-openflow-importlib.patch
@@ -0,0 +1,28 @@
+diff --git a/waf b/waf
+index 3d0f216..2b03280 100755
+--- a/waf
++++ b/waf
+@@ -30,7 +30,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+ """
+
+-import os, sys, inspect
++import os, sys, inspect, fileinput
+
+ VERSION="2.0.18"
+ REVISION="ff4ae9f5cc05353d3dc3aeff8854ae69"
+@@ -157,6 +157,14 @@ def find_lib():
+
+ #unpack
+ unpack_wafdir(dir, src)
++
++ for line in fileinput.input(dir + "/waflib/Context.py", inplace=True):
++ if line.startswith('import os,re,imp,sys'):
++ print('import os,re,sys\nimport types')
++ elif line.startswith('\tmodule=imp.new_module(WSCRIPT_FILE)'):
++ print('\tmodule=types.ModuleType(\'WSCRIPT_FILE\')')
++ else:
++ print(line, end='')
+ return dir
+
+ wafdir = find_lib()
maelstrom799 commented on 2024-02-22 04:43 (UTC)
I tried installing the package but i get this error:
Can't exec "gzcat": No such file or directory at ./click-elem2man line 1316.
To fix this i symlinked gzcat to zcat but now i get this error:
gzip: /home/maelstrom/.cache/yay/ns3/src/click-git/install/share/man/man7/FilterFailures.7click.gz: No such file or directory
And later on i get this warning:
-- NS3_BINDINGS_INSTALL_DIR was not set. The visualizer python module won't be installed with ./ns3 install.
and then the install ends abruptly with this error:
-- ---- Summary of ns-3 settings:
Build profile : default
Build directory : /home/maelstrom/.cache/yay/ns3/src/ns-allinone-3.40/ns-3.40/build
Build with runtime asserts : ON
Build with runtime logging : ON
Build version embedding : ON
BRITE Integration : ON
DES Metrics event collection : OFF (not requested)
DPDK NetDevice : ON
Emulation FdNetDevice : ON
Examples : ON
File descriptor NetDevice : ON
GNU Scientific Library (GSL) : ON
GtkConfigStore : ON
LibXml2 support : ON
MPI Support : ON
ns-3 Click Integration : ON
ns-3 OpenFlow Integration : ON
Netmap emulation FdNetDevice : OFF (missing dependency)
PyViz visualizer : ON
Python Bindings : ON
SQLite support : ON
Eigen3 support : ON
Tap Bridge : ON
Tap FdNetDevice : ON
Tests : ON
Modules configured to be built:
antenna aodv applications
bridge brite buildings
click config-store core
csma csma-layout dsdv
dsr energy fd-net-device
flow-monitor internet internet-apps
lr-wpan lte mesh
mobility mpi netanim
network nix-vector-routing olsr
openflow point-to-point point-to-point-layout
propagation sixlowpan spectrum
stats tap-bridge test
topology-read traffic-control uan
virtual-net-device visualizer wifi
wimax
-- Configuring done (23.6s)
-- Generating done (1.8s)
-- Build files have been written to: /home/maelstrom/.cache/yay/ns3/src/ns-allinone-3.40/ns-3.40/cmake-cache
Finished executing the following commands:
mkdir cmake-cache
cd cmake-cache; /usr/bin/cmake -DPython3_LIBRARY_DIRS=/usr/lib -DPython3_INCLUDE_DIRS=/usr/include/python3.11 -DPython3_EXECUTABLE=/home/maelstrom/.cache/yay/ns3/src/.venv/bin/python3 -DCMAKE_BUILD_TYPE=default -DNS3_ASSERT=ON -DNS3_LOG=ON -DNS3_WARNINGS_AS_ERRORS=OFF -DNS3_NATIVE_OPTIMIZATIONS=OFF -DNS3_DPDK=ON -DNS3_EIGEN=ON -DNS3_ENABLE_BUILD_VERSION=ON -DNS3_EXAMPLES=ON -DNS3_GSL=ON -DNS3_GTK3=ON -DNS3_LOG=ON -DNS3_MONOLIB=ON -DNS3_MPI=ON -DNS3_PYTHON_BINDINGS=ON -DNS3_TESTS=ON -DNS3_WITH_BRITE=/home/maelstrom/.cache/yay/ns3/src/BRITE-30338f4f63b9 -DNS3_WITH_CLICK=/home/maelstrom/.cache/yay/ns3/src/click-git/install -DNS3_WITH_OPENFLOW=/home/maelstrom/.cache/yay/ns3/src/openflow-d45e7d184151 -DCMAKE_INSTALL_PREFIX=/usr -G Ninja .. ; cd ..
[0/2] Re-checking globbed directories...
[16/1998] Linking CXX executable ns3.40-stdlib_pch_exec-default
FAILED: ns3.40-stdlib_pch_exec-default
: && /usr/bin/c++ -march=native -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -flto=auto -O2 -g -DNDEBUG -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -fuse-ld=lld CMakeFiles/stdlib_pch_exec.dir/build-support/empty-main.cc.o -o ns3.40-stdlib_pch_exec-default -L/home/maelstrom/.cache/yay/ns3/src/ns-allinone-3.40/ns-3.40/build/lib && :
ld.lld: error: undefined symbol: main
>>> referenced by /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../lib/Scrt1.o:(_start)
collect2: error: ld returned 1 exit status
[30/1998] Building CXX object src/test/CMakeF...raced/traced-callback-typedef-test-suite.cc.o
ninja: build stopped: subcommand failed.
Finished executing the following commands:
cd cmake-cache; /usr/bin/cmake --build . -j 15 ; cd ..
==> ERROR: A failure occurred in build().
Aborting...
-> error making: ns3-exit status 4
-> Failed to install the following packages. Manual intervention is required:
ns3 - exit status 4
I'm not quite sure what to do for "manual intervention"
NTickiTavi commented on 2024-02-02 16:42 (UTC)
@kyechou thanks alot, the download worked 100%, I'm just not sure how to use the package to run cpp files, ns3 does not run, and if I use g++ alot of the classes are not recognized, I tried using -L ns3, also didn't work, I couldn't find any documentation for this exact package, just for the ns3 compiler as a whole, if there's some documentation that I'm missing just point me to it and I'll be out of your hair.
kyechou commented on 2024-01-28 17:13 (UTC)
Hi @NTickiTavi, thanks for letting me know! I've updated the checksum and it should be fixed now.
Pinned Comments
SpacingBat3 commented on 2026-04-21 14:55 (UTC) (edited on 2026-05-02 13:29 (UTC) by SpacingBat3)
CURRENT PACKAGE STATUS
Not everything works / can be confirmed to work.
cppyycannot be built from AUR, for example, androotpackage is not enough for using bindings.As tests pass in Arch,
ns3as a set of libraries should work now with all components enabled. 🎉️I've reworked
PKGBUILDdrastically. It should be much more readable and have less hacks, plus NS-3 is now a split package so eg. python bindings can be installed separatively fromns3. Most deps should also be organised properly so they are installed on-demand.Python bindings are broken, it requires a lot more effort to make them to work: at least providing
libcppyypython module alongsidecppyyis required and getting somehow alibrte_pmd_e1000.solibrary (that was part of DPDK but at least it isn't in the latest releases). As an alternative,mpiis being enabled in build so we at least can use this as optional feature.Local docs distribution is WIP. Doxygen seems to be too large to bundle into mosts systems (>1GB!!!) and does package slow and Sphinx docs are TBD.
I'll be keeping this comment up-to-date as we figure things out. In the meantime, feel free to comment and discuss what could be done better on my side with the packaging or maybe how to handle incompatibilities of components (MPI vs Python).