Installation¶
System requirements¶
Operating system: Linux, macOS, Windows
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 python@3.7
echo 'export PATH="/usr/local/opt/python@3.7/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.
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
Developer installation¶
You can build a package manually if you want.
Clone the CppBind master branch into current directory:
git clone https://github.com/PicsArt/cppbind.git
cd cppbind
If the project is already cloned, pull the latest version:
git fetch
git pull
Install virtualenv:
python3 -m pip install virtualenv
Create and activate virtualenv:
python3 -m venv venv
source venv/bin/activate
Install virtualenv:
python3 -m pip install virtualenv
Create and activate a virtualenv:
python3 -m venv venv
source venv/bin/activate
Install virtualenv:
python -m pip install virtualenv
Create and activate a virtualenv:
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