Skip to content

Commit

Permalink
fix buildpath, add swapfile and improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
recipe committed Jun 6, 2020
1 parent 3ea2f6e commit 3533f45
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ Vagrant.configure("2") do |config|
cat /home/vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys
cat /home/vagrant/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
echo -e "\n-- Allocating a swap file for cmake builds"
fallocate -l 3G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab
echo -e "\n-- Add a package for cmake"
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
Expand Down Expand Up @@ -122,6 +129,7 @@ Vagrant.configure("2") do |config|
ninja install
echo -e "\n-- Installing googletest --\n"
cd /usr/src
apt install -y libgtest-dev valgrind
wget https://github.com/google/googletest/archive/release-1.7.0.tar.gz
tar xf release-1.7.0.tar.gz
Expand Down
8 changes: 8 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
apt update
apt -y install cmake libboost-all-dev libleveldb-dev

# in case ninja build fails with cannot allocate memory we have to create a swap file:
fallocate -l 3G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab

# we are building cpprestsdk from a source code
apt install -y git libssl-dev ninja-build
cd /usr/src
Expand All @@ -49,6 +56,7 @@ ninja
ninja install

# clone this repo with the source code
cd /usr/src
git clone https://github.com/recipe/bambooslacking.git
# compile application
cd bambooslacking/build/release
Expand Down

0 comments on commit 3533f45

Please sign in to comment.