Errors during install

149 views
Skip to first unread message

grou...@synthify.com

unread,
May 2, 2025, 10:03:39 AMMay 2
to ns-3-users
I'm installing ns-3.44 on a Debian 12 system.
I'm following the process in quick start
I downloaded and extracted the .bz2 release file
I ran the configure process `$ ./ns3 configure --enable-examples --enable-tests`
I ran the build `$ ./ns3 build`

At 12%, I see a number of errors:

[ 12%] Building CXX object src/antenna/CMakeFiles/antenna-test.dir/test/test-adjacency-matrix.cc.o
In file included from /home/tim/ns-3/ns-allinone-3.44/ns-3.44/build/include/ns3/symmetric-adjacency-matrix.h:1,
                 from /home/tim/ns-3/ns-allinone-3.44/ns-3.44/src/antenna/test/test-adjacency-matrix.cc:9:
/home/tim/ns-3/ns-allinone-3.44/ns-3.44/src/antenna/utils/symmetric-adjacency-matrix.h:240:36: error: expected ‘)’ before ‘numRows’
  240 |     SymmetricAdjacencyMatrix(size_t numRows = 0, T value = {})
      |                             ~      ^~~~~~~~
      |                                    )

The build process stopped at 16% with these errors:

[ 16%] Building CXX object src/network/CMakeFiles/network.dir/utils/timestamp-tag.cc.o
[ 16%] Linking CXX shared library /home/tim/ns-3/ns-allinone-3.44/ns-3.44/build/lib/libns3.44-network-default.so
gmake: *** [Makefile:136: all] Error 2
Finished executing the following commands:
/usr/bin/cmake --build /home/tim/ns-3/ns-allinone-3.44/ns-3.44/cmake-cache -j 3
tim@test03:~/ns-3/ns-allinone-3.44/ns-3.44$

Where should I start to resolve these errors?


Tommaso Pecorella

unread,
May 2, 2025, 1:59:54 PMMay 2
to ns-3-users
You can start by checking (and tell) the compiler version...

Most probably you'll have to upgrade the compiler.

grou...@synthify.com

unread,
May 2, 2025, 6:07:42 PMMay 2
to ns-3-users
@ Tommaso Pecorella, thank you!
Here are the versions:

$ gcc --version
gcc (Debian 12.2.0-14) 12.2.0

$ cpp --version
cpp (Debian 12.2.0-14) 12.2.0

$ python3 --version
Python 3.11.2

What are the required compiler versions? Maybe they have changed from what is found in Prerequisites

Tommaso Pecorella

unread,
May 3, 2025, 6:07:52 AMMay 3
to ns-3-users
I'll have to check. It seems that you have a supported compiler.

Just to make sure, check when you issue the command "./ns3 configure", it will tell you which compiler it's using:

➜  ns-3-dev git:(master) ./ns3 configure --enable-examples --enable-tests
Warn about uninitialized values.
-- The CXX compiler identification is AppleClang 17.0.0.17000013
-- The C compiler identification is AppleClang 17.0.0.17000013

grou...@synthify.com

unread,
May 3, 2025, 10:42:16 AMMay 3
to ns-3-users
Here is the output of ./ns3 configure --enable-examples --enable-tests "

$ ./ns3 configure --enable-examples --enable-tests
Warn about uninitialized values.
-- Using default output directory /home/tim/ns-3/ns-3-dev/build
-- CCache is enabled.
-- Proceeding without cmake-format
-- Bindings: python bindings disabled due to the following missing dependencies: cppyy
-- NS3_BINDINGS_INSTALL_DIR was not set. The python bindings won't be installed with ./ns3 install. This setting is meant for packaging and redistribution.
-- Set NS3_BINDINGS_INSTALL_DIR="/home/tim/.local/lib/python3.11/site-packages" to install it to the default location.
-- Boost was not found
-- docs: doxygen documentation not enabled due to missing dependencies: doxygen dot dia
-- Failed to locate sphinx-build executable (missing: SPHINX_EXECUTABLE)
-- docs: sphinx documentation not enabled due to missing dependencies: Sphinx epstopdf pdflatex latexmk convert dvipng dia
-- Processing src/antenna
-- Standard library Bessel function has been found
-- Processing src/aodv
-- Processing src/applications
-- Processing src/bridge
-- Processing src/brite
-- Skipping src/brite
-- Processing src/buildings
-- Processing src/click
-- Skipping src/click
-- Processing src/config-store
-- Processing src/core
-- Boost Units are an optional feature of length.cc.  Ubuntu ships it within the libboost-dev package.  You may need to clean up the CMake cache after installing it to pass this check.
-- Processing src/csma
-- Processing src/csma-layout
-- Processing src/dsdv
-- Processing src/dsr
-- Processing src/energy
-- Processing src/fd-net-device
-- Checking for module 'libdpdk'
--   Package 'libdpdk', required by 'virtual:world', not found
-- Processing src/flow-monitor
-- Processing src/internet
-- Processing src/internet-apps
-- Processing src/lr-wpan
-- Processing src/lte
-- Processing src/mesh
-- Processing src/mobility
-- Processing src/netanim
-- Processing src/network
-- Processing src/nix-vector-routing
-- Processing src/olsr
-- Processing src/openflow
-- Skipping src/openflow
-- Processing src/point-to-point
-- Processing src/point-to-point-layout
-- Processing src/propagation
-- Processing src/sixlowpan
-- Processing src/spectrum
-- Processing src/stats
-- Processing src/tap-bridge
-- Processing src/test
-- Processing src/topology-read
-- Processing src/traffic-control
-- Processing src/uan
-- Processing src/virtual-net-device
-- Processing src/wifi
-- Processing src/wimax
-- Processing src/zigbee
-- ---- Summary of ns-3 settings:
Build profile                 : default
Build directory               : /home/tim/ns-3/ns-3-dev/build
Build with runtime asserts    : ON
Build with runtime logging    : ON
Build version embedding       : OFF (not requested)
BRITE Integration             : OFF (Missing headers: "Brite.h" and missing libraries: "brite")
DES Metrics event collection  : OFF (not requested)
DPDK NetDevice                : OFF (not requested)
Emulation FdNetDevice         : ON
Examples                      : ON
File descriptor NetDevice     : ON
GNU Scientific Library (GSL)  : OFF (GSL was not found)
GtkConfigStore                : OFF (Harfbuzz is required by GTK3 and was not found)
LibXml2 support               : ON
MPI Support                   : OFF (not requested)
ns-3 Click Integration        : OFF (Missing headers: "simclick.h" and missing libraries: "nsclick click")
ns-3 OpenFlow Integration     : OFF (Missing headers: "openflow.h" and missing libraries: "openflow")
Netmap emulation FdNetDevice  : OFF (missing dependency)
PyViz visualizer              : OFF (missing Python Bindings)
Python Bindings               : OFF (missing dependency: cppyy)
SQLite support                : OFF (Missing headers: "sqlite3.h" and missing libraries: "sqlite3")
Eigen3 support                : OFF (Eigen was not found)
Tap Bridge                    : ON
Tap FdNetDevice               : ON
Tests                         : ON


Modules configured to be built:
antenna                   aodv                      applications
bridge                    buildings                 config-store
core                      csma                      csma-layout
dsdv                      dsr                       energy
fd-net-device             flow-monitor              internet
internet-apps             lr-wpan                   lte
mesh                      mobility                  netanim
network                   nix-vector-routing        olsr
point-to-point            point-to-point-layout     propagation
sixlowpan                 spectrum                  stats
tap-bridge                test                      topology-read
traffic-control           uan                       virtual-net-device
wifi                      wimax                     zigbee


Modules that cannot be built:
brite                     click                     mpi
openflow                  visualizer


-- Configuring done
-- Generating done
-- Build files have been written to: /home/tim/ns-3/ns-3-dev/cmake-cache

Finished executing the following commands:
/usr/bin/cmake -S /home/tim/ns-3/ns-3-dev -B /home/tim/ns-3/ns-3-dev/cmake-cache -DNS3_EXAMPLES=ON -DNS3_TESTS=ON --warn-uninitialized

There are some missing headers, but it is not clear if they are required to build an instance able to run the test and first run.

Tommaso Pecorella

unread,
May 3, 2025, 7:02:03 PMMay 3
to ns-3-users
Super-weird, I opened a ticket: https://gitlab.com/nsnam/ns-3-dev/-/issues/1217

As a temporary workaround, you can:
- Install gcc-11 (apt install g++-11)
- Set the compiler (export CXX=g++-11)
- Reconfigure and recompile (./ns3 clean; ./ns3 configure --enable-examples --enable-tests; ./ns3)

If you don't want to export the CXX variable in every shell, you can do one of the following:
- Add the export to your profile, or

Note that the configuration will tell you that you're still using the gcc 12 as the C compiler. This is generally harmless, as ns-3 doesn't have pure-C parts. However, if you want you can use "export CC=gcc-11".

Tommaso Pecorella

unread,
May 4, 2025, 12:21:14 PMMay 4
to ns-3-users
Good news: you don't need to downgrade the compiler.

Bad news: you'll have to use ns-3-dev (i.e., use git to clone the ns-3 repository).

The bug is going to be fixed as soon as https://gitlab.com/nsnam/ns-3-dev/-/merge_requests/2420 is merged.

Gabriel Ferreira

unread,
May 5, 2025, 4:27:22 AMMay 5
to ns-3-users
You don't need ns-3-dev. Just add `#include<cstddef>` to src/antenna/utils/symmetric-adjacency-matrix.h

grou...@synthify.com

unread,
May 6, 2025, 1:29:30 PMMay 6
to ns-3-users
@Gabriel Ferreira, thank you! I added the line, and build, test, and run first complete without errors.

tim@test03:~/ns-3/ns-allinone-3.44/ns-3.44$ ./ns3 run first
[0/2] Re-checking globbed directories...
ninja: no work to do.
At time +2s client sent 1024 bytes to 10.1.1.2 port 9
At time +2.00369s server received 1024 bytes from 10.1.1.1 port 49153
At time +2.00369s server sent 1024 bytes to 10.1.1.1 port 49153
At time +2.00737s client received 1024 bytes from 10.1.1.2 port 9


Reply all
Reply to author
Forward
0 new messages