Permalink
Fetching contributors…
Cannot retrieve contributors at this time
107 lines (72 sloc) 2.45 KB

Ubuntu 16.04

Create lclsrc group, modify /usr/local/* to allow group members to write:

# Create a lclsrc group
sudo /usr/sbin/groupadd --system lclsrc

# Add this user to the group (will need to re-login)
sudo usermod -a -G lclsrc $USER

# Change the group ownership of /usr/local to lclsrc
sudo chgrp -R lclsrc /usr/local
sudo chmod -R g+rw /usr/local
sudo find /usr/local -type d -exec chmod g+s {} \;

Setup Git

sudo apt-get update
sudo apt-get install autoconf automake libtool curl make cmake g++ unzip
sudo apt-get install git arcanist
arc install-certificate
git config --global user.email "you@bons.ai"
git config --global user.name "Your Name"
git clone https://bonsai.phacility.com/diffusion/B/brain.git
sudo apt-get install plantuml

If you plan on building bonsai-simulink, skip down to the section titled Build with Static Dependencies and proceed from there

Boost

sudo apt-get install libboost-dev libboost-coroutine-dev libboost-program-options-dev

Etc

sudo apt-get install libcpprest-dev

Protobuf 3.4 - https://github.com/google/protobuf/blob/master/src/README.md

cd /usr/local/src
git clone https://github.com/google/protobuf.git
cd protobuf
git checkout 3.4.x
./autogen.sh
./configure
make
sudo make install
sudo ldconfig # refresh shared library cache.

Pip

sudo apt-get install python3-pip

Installation


Building

To build the library run ./build.sh, this will create a ./build folder with the dynamic and static libraries.

General Installation

Install by running make install from the build directory.

cd ./build
make install

Build With Static Dependencies

In some cases, it may be desirable to build libbonsai with as few shared object dependencies as possible. For example, when building a library to be loaded into another application or framework which may have hard dependencies on other versions of some of the same libraries upon which libbonsai depends.

To force static linkage internal to both libbonsai.a and libbonsa.so, do the following:

cd lib
./build_dependencies.sh
cd ..
mkdir build
cd build
cmake .. -DSTATIC_DEPS=TRUE
make

NB: build_dependencies.sh may take quite some time, as it needs to download and build all dependent libraries from source. This is required to produce position independent code in the object files comprising libbonsai's library dependencies.