Skip to content

Installation

Required environment setup

Update/upgrade the system:

sudo apt-get update
sudo apt-get upgrade

Install Clang:

sudo apt-get install -y libclang-9-dev

If Python 3.7 or higher is already installed, then skip this step.

Install Python:

sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.7
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
sudo update-alternatives --config python3

Add libclang path to DYLD_LIBRARY_PATH. If you have Xcode installed then run the following command:

echo 'export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib;"' >> ~/.profile

If only CommandLineTools is installed, then:

echo 'export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Library/Developer/CommandLineTools/usr/lib;"' >> ~/.profile

If your shell is Zsh instead of Bash, you need to replace .profile with .zshrc in the previous commands.

If Python 3.7 or higher is already installed, then skip this step.

Install Python:

brew install [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/lib:$PATH"' >> ~/.profile

CppBind requires Clang for parsing source files. Make sure you have Clang compiler installed on your Windows machine and it's added to the system path. Download and install latest version of LLVM from official website.

If Python 3.7 or higher is already installed then skip this step.

Install Python:

Download and install latest version of Python from official website.


User installation

cppbind is built as a standard Python package and can be installed using pip with the following command.

python3 -m pip install cppbind

If you use it as a standalone command-line application, we recommend using pipx instead. pipx creates an isolated environment for each application and its related packages and makes the application available from the shell. Using pipx also prevents dependency conflicts between cppbind and other packages within the current environment. To install cppbind with pipx, use the following commands:

python3 -m pip install pipx
python3 -m pipx ensurepath
python3 -m pipx install cppbind

To test the installation run the following command:

cppbind -h

Contributor installation

Clone the CppBind master branch into current directory:

git clone https://github.com/PicsArt/cppbind.git
cd cppbind

Create and activate a virtual environment:

python3 -m venv venv
source venv/bin/activate

Create and activate a virtual environment:

python3 -m venv venv
source venv/bin/activate

Create and activate a virtual environment:

python -m venv venv
./venv/Scripts/activate

And finally, the package build step:

python3 -m pip install -r src/requirements.txt
python3 setup.py develop

Last update: December 1, 2022