Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Building h2load (of nghttp2) on Ubuntu 16.04
#! /bin/bash
# https://nghttp2.org/documentation/h2load-howto.html
sudo apt-get update
sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \
zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
libc-ares-dev libjemalloc-dev cython python3-dev python-setuptools libjemalloc-dev \
libspdylay-dev
git clone https://github.com/nghttp2/nghttp2.git && cd nghttp2
autoreconf -i && automake && autoconf
./configure --enable-app
make
./src/h2load --help
@sufehmi

This comment has been minimized.

Copy link

@sufehmi sufehmi commented Jul 12, 2021

Hi, now nghttp2 require Python 3.8 and GCC 6 (and cython3) - which Ubuntu 16.04 does not have.

Also current h2load source code won't compile on Ubuntu Xenial 16.04 with error messages such as :

nghttp2.c:31779:11: error: PyThreadState {aka struct _ts} has no member named exc_value

So I've installed h2load with these steps instead:

# get h2load sourcecode from Ubuntu Xenial 16.04 repo
cd /tmp
wget http://mirror.biznetgio.com/ubuntu/pool/main/n/nghttp2/nghttp2_1.43.0-1.debian.tar.xz
xz -d nghttp2_1.43.0-1.debian.tar.xz
tar xvf nghttp2_1.43.0-1.debian.tar
cd  nghttp2-1.43.0

# to enable installation of Python 3.8 & gcc 6
sudo apt-get update ; sudo apt-get install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y

sudo apt-get update ; sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \
  zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
  libc-ares-dev libjemalloc-dev cython python3.8-dev python-setuptools libjemalloc-dev \
  libspdylay-dev python3.8-distutils gcc-6 g++-6 python3-setuptools cython3

alias python=/usr/bin/python3.8
. ~/.bashrc
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6

gcc -v

autoreconf -i && automake && autoconf
./configure --enable-app  PYTHON_VERSION=3.8
make
./src/h2load --help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment