Skip to content

Building from sources

Stanislav Pidhorskyi edited this page Apr 14, 2020 · 1 revision

Installation from PyPi

DareBlopy is available as pypi package and you can install it with:

$ pip install dareblopy

However, if you want to build it from sources, you will have to follow the guide below.

Installing NASM

We are going to need NASM to build libjpeg-turbo. The easiest way is to build it from sources. Download NASM:

curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.01/nasm-2.13.01.tar.bz2
tar xjvf nasm-2.13.01.tar.bz2
cd nasm-2.13.01

Apply patch:

curl -O -L https://src.fedoraproject.org/rpms/nasm/raw/0cc3eb244bd971df81a7f02bc12c5ec259e1a5d6/f/0001-Remove-invalid-pure_func-qualifiers.patch
patch include/nasmlib.h < 0001-Remove-invalid-pure_func-qualifiers.patch

Configure and build:

./autogen.sh
./configure
make -j 6
sudo make install
cd ..
nasm -v

Checkout repository

Clone repository and all submodules:

git clone https://github.com/podgorskiy/DareBlopy.git
cd DareBlopy
git submodule update --init

Protobuf compiler

To build protobuf compiler:

cd libs/protobuf
./autogen.sh
./configure
make  -j 6
sudo make install
sudo ldconfig
cd ../..
protoc --version

Compile example.proto file:

pushd sources/protobuf/
protoc example.proto --cpp_out=.
popd

Compiling

Two options are available:

  • With distutils
  • With CMake

I use CMake approach for development since it can be used together with PyCharm IDE. Wheels are built with distutils.

CMake

You will need to have build-essentials installed as well as last CMake.

Then, either open it in PyCharm, either:

mkdir build
cd build
cmake ../
make

Distutils

Install wheel package:

pip install wheel

Then build wheel:

python setup.py bdist_wheel -d wheel/