hark-lib (Source Compilation) for v.2.x

[!!CAUTION!!] This page is under preparation and most of it is a duplicate only of the contents of v.1.x and is therefore incorrect.

These instructions are for hark-lib version 1.0.0 or later.

Compilation Environment

  • OS
    • Ubuntu 20.04 Focal (64bit)
    • Ubuntu 22.04 Jammy (64bit)


Installation instruction

Step.0 Registering our repository.

    Step.0 can be skipped in the environment where HARK is installed in the https://hark.jp/install/linux/ procedure. Step.0 is required if you want to install only hark-lib without installing HARK.
  • Ubuntu 20.04

Register HARK apt repository to install HARK deb packages.

sudo bash -c 'echo -e "deb http://archive.hark.jp/harkrepos $(lsb_release -cs) non-free\ndeb-src http://archive.hark.jp/harkrepos $(lsb_release -cs) non-free" > /etc/apt/sources.list.d/hark.list'

Setup the GPG key.

wget -q -O - http://archive.hark.jp/harkrepos/public.gpg | sudo apt-key add -


  • Ubuntu 22.04 or later
#### Install curl.
sudo apt update && sudo apt install curl

#### Download the GPG key.
sudo curl -sSL http://archive.hark.jp/harkrepos/public.gpg -o /usr/share/keyrings/hark-archive-keyring.asc

#### Setup the repository URI.
sudo bash -c 'echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hark-archive-keyring.asc] http://archive.hark.jp/harkrepos $(lsb_release -cs) non-free\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hark-archive-keyring.asc] http://archive.hark.jp/harkrepos $(lsb_release -cs) non-free" > /etc/apt/sources.list.d/hark.list'


Step.1 Get build tools and dependent libraries.

sudo apt update
sudo apt install libtool cmake cmake-extras build-essential libopenblas-base libopenblas-dev gfortran liblapack-dev liblapacke-dev libeigen3-dev pybind11-dev python3-dev python3-pybind11 python3-setuptools python3-pkgconfig python3-pip python3-numpy python3-scipy python3-matplotlib python3-kivy libfmt-dev zlib1g-dev libharkio3

Notes: In order to use the plotting node used kivy, additional installation of kivy garden graph is required.

python3 -m pip install https://github.com/kivy-garden/graph/archive/master.zip


python3 -m pip install kivy_garden.graph --extra-index-url https://kivy-garden.github.io/simple/

Notes: If you are using Ubuntu 20.04, the version of pybind11 is older than 2.6.0 and you need to do the following.

sudo apt purge pybind11-dev python3-pybind11
sudo python3 -m pip install pybind11 pybind11-global


Step.2 Download and Build hark-lib and hark-lib python bindings source code.

cd ~/
mkdir YOUR_DIR

apt source libhark-lib

#### As an alternative to apt source, you can also download it directly using the command below.
# wget http://archive.hark.jp/harkrepos/dists/DISTRO/non-free/source/libhark-lib_HARK_VER.tar.xz
# tar -Jxvf libhark-lib_HARK_VER.tar.xz

cd libhark-lib-HARK_VER
mkdir build
cd build
sudo make install

cd ..
cd python
python3 ./setup.py build
sudo python3 ./setup.py install

If you want to know which HARK_VER that can be downloaded, please access directly from your browser at the following location.

  • For Ubuntu 20.04 (focal) users.

    Unfortunately, we do not provide packages for Ubuntu20.04 environment. Please build it yourself using the source code for Ubuntu22.04. In that case, please make sure that the pybind11 version is updated to 2.6.0 or higher.

  • For Ubuntu 22.04 (jammy) users.


  • YOUR_DIR : Your work directory path
  • HARK_VER : Package version
      e.g.) 1.0.0, 1.0.1, etc…
  • DISTRO : Ubuntu distribution
      e.g.) focal, jammy, etc…


Back to Top