Skip to content

Instantly share code, notes, and snippets.

@HASPIMA
Created October 2, 2025 11:58
Show Gist options
  • Select an option

  • Save HASPIMA/307bb0270a59631afb880ae9f55f9d68 to your computer and use it in GitHub Desktop.

Select an option

Save HASPIMA/307bb0270a59631afb880ae9f55f9d68 to your computer and use it in GitHub Desktop.
This a way for me to cope with the fact that installing ns3 on an Arch-based system is harder hahah

Setup on Arch-based systems for ns3.45

Setup

Building ns3

  1. Enable your virtualenv:

    source .venv/bin/activate
  2. Clean

    # ./ns3 distclean # if you've built successfully before uncomment this
    ./ns3 clean
  3. Configure the build target, focused on python:

    • --build-profile=release --enable-asserts --enable-logs are based on the contents of setup.py
    • --enable-python-bindings: This helps configure some stuff needed for python. Being more specific: Python3_LIBRARY_DIRS, Python3_INCLUDE_DIRS and Python3_EXECUTABLE.
    • These settings were based on
    • -G "Unix Makefiles": Force it to use make.
    • NS3_PIP_PACKAGING: Leave gtk symbols undefined and pray for the linker to find the correct libraries locally.
    • NS3_FETCH_OPTIONAL_COMPONENTS: Fetch Brite, Click and Openflow dependencies.
    • NS3_BINDINGS_INSTALL_DIR: The python bindings won't be installed with ./ns3 install. This setting is meant for packaging and redistribution.
    • GLOG_USE_GLOG_EXPORT: Glog was dying on me, so this apparently fixes it.
    ./ns3 configure --build-profile=release --enable-asserts --enable-logs --enable-examples --enable-tests --enable-python-bindings -G "Unix Makefiles" -- -DCMAKE_CXX_FLAGS="-DGLOG_USE_GLOG_EXPORT" -DNS3_PIP_PACKAGING=ON -DNS3_FETCH_OPTIONAL_COMPONENTS=ON -DNS3_BINDINGS_INSTALL_DIR=INSTALL_PREFIX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment