Skip to content

Instantly share code, notes, and snippets.

@CodeAsm
Created February 19, 2026 14:26
Show Gist options
  • Select an option

  • Save CodeAsm/5b45799611a5d4ad2a9e6013e8416f12 to your computer and use it in GitHub Desktop.

Select an option

Save CodeAsm/5b45799611a5d4ad2a9e6013e8416f12 to your computer and use it in GitHub Desktop.
compile iperf3 without makefile, for example on systems where you do have musl, but no make. var/lib/dpkg/status can be skipped
mkdir -p /tmp
chmod 1777 /tmp

cd ~
wget https://github.com/esnet/iperf/releases/download/3.20/iperf-3.20.tar.gz
tar -xvf iperf-3.20.tar.gz 

cd ~/iperf-3.20/
./configure --without-openssl --build=x86_64-linux-musl

cd ~/iperf-3.20/src
gcc -O2 -static -o iperf3 \
  main.c \
  iperf_api.c \
  iperf_client_api.c \
  iperf_server_api.c \
  iperf_error.c \
  iperf_locale.c \
  iperf_pthread.c \
  iperf_tcp.c \
  iperf_udp.c \
  iperf_time.c \
  iperf_util.c \
  net.c \
  tcp_info.c \
  timer.c \
  units.c \
  dscp.c \
  cjson.c \
  -lpthread -lm

    cat << EOF >> /var/lib/dpkg/status
Package: iperf3
Status: install ok installed
Priority: optional
Section: net
Version: 3.20

EOF

cp iperf3 /bin/iperf3

./iperf3 -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment