How to Install BARK¶
This section describes the prerequisites and installation-steps of BARK.
Prerequisites¶
- Bazel > 3(requires Java)
- Python3.7 (
sudo apt-get install python3.7 python3.7-dev python3.7-tk
) - Virtual Env (
pip3 install virtualenv==16.7.8
) (note that the newest version does not seem to link the Python.h) - gcc7 (needs to be set as the default compiler)
- Visual Studio Code
Using ad-rss-lib¶
- sqlite 3 (
sudo apt-get install libsqlite3-dev sqlite3
)
Install using pip¶
- pip3 install bark-simulator
Setup on Linux¶
Optional: We recommend to use Anaconda. This way, you can create a clean python environment. After installation, create a conda env conda create --name bark_python_env python=3.7
and follow with activating it: conda activate bark_python_env
. You can now proceed with the following:
- Use
git clone https://github.com/bark-simulator/bark.git
or download the repository from this page. - Run
bash install.sh
: creates a virtual environment (located in python/venv) and installs all python packages - Run
source dev_into.sh
: activates the virtual environment (make sure to run this before bazel) - Use
bazel test //...
to validate that BARK is working. - Finally, try one of the examples provided in BARK by running
bazel run //examples:merging
.
Setup on MacOS¶
- Install pyenv:
brew install pyenv
. - Install a newer version of tcl-tk:
brew upgrade tcl-tk
. - Run
pyenv install python3.7-dev
. If you run into trouble with TKInter have a look here. - Set this as your global Python version:
pyenv global 3.7-dev
. - Also add this Python version to your
~/.zshrc
by addingeval "$(pyenv init -)"
. - Install an older version of the virtualenv package by running:
pip install virtualenv==16.7.8
- In order to set TKAgg as backend have a look here.
- Modify the file
install.sh
by usingvirtualenv -p python ./python/venv
instead as python is now the pyenv version. - Now you can follow the same steps as when using Linux.
Build Pip package¶
- Install twine using python3 -m pip install –user –upgrade twine
- Run script bash package.sh to build code, package and upload to pypi
Frequently Asked Questions (FAQs)¶
Python.h not found¶
Make sure that there is a ‘Python.h’ file in the python/venv
folder.
GCC: Interal Compiler Error: Killed (program cc1plus)¶
You might be running out of memory during the bazel build.
Try limiting the memory available to bark via
bazel build //... --local_ram_resources=HOST_RAM*.4
(or any other build or test call).