From ef8d00409adc2a2411fb38c73b16f803e4a6cb73 Mon Sep 17 00:00:00 2001 From: Elisey Zanko Date: Wed, 25 Mar 2015 08:55:05 +0500 Subject: [PATCH] Add Vagrantfile --- contrib/vagrant/README.md | 22 ++++++++++++++++++++++ contrib/vagrant/Vagrantfile | 11 +++++++++++ contrib/vagrant/bootstrap.sh | 31 +++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 contrib/vagrant/README.md create mode 100644 contrib/vagrant/Vagrantfile create mode 100644 contrib/vagrant/bootstrap.sh diff --git a/contrib/vagrant/README.md b/contrib/vagrant/README.md new file mode 100644 index 000000000..48a6ef145 --- /dev/null +++ b/contrib/vagrant/README.md @@ -0,0 +1,22 @@ +# Vagrant + +Build the latest version of the MeTA toolkit using [Vagrant](https://www.vagrantup.com/). Ubuntu 14.04 is used as a base Vagrant box. This project was initially made for [Text Retrieval and Search Engines](https://www.coursera.org/course/textretrieval) Coursera course. + +## Instructions + +1. Install Vagrant +2. Run Vagrant + ``` + vagrant up + ``` + +3. Check that everything is OK + ``` + vagrant ssh + cd meta/build + ctest --output-on-failure + ``` + +## Notes + +Only VirtualBox provider was tested. diff --git a/contrib/vagrant/Vagrantfile b/contrib/vagrant/Vagrantfile new file mode 100644 index 000000000..97544e188 --- /dev/null +++ b/contrib/vagrant/Vagrantfile @@ -0,0 +1,11 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure(2) do |config| + config.vm.box = "ubuntu/trusty64" + config.vm.provision :shell, path: "bootstrap.sh", privileged: false + + config.vm.provider "virtualbox" do |v| + v.cpus = 2 + end +end diff --git a/contrib/vagrant/bootstrap.sh b/contrib/vagrant/bootstrap.sh new file mode 100644 index 000000000..245575075 --- /dev/null +++ b/contrib/vagrant/bootstrap.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# this might take a while +sudo apt-get update +sudo apt-get install -y software-properties-common + +# add the ppa for cmake +sudo add-apt-repository -y ppa:george-edison55/cmake-3.x +sudo apt-get update + +# install dependencies +sudo apt-get install -y cmake libicu-dev git g++ g++-4.8 + +# clone the project +git clone https://github.com/meta-toolkit/meta.git +cd meta/ + +# uncomment to build exact version +# git reset --hard v1.3.2 + +# set up submodules +git submodule update --init --recursive + +# set up a build directory +mkdir build +cd build +cp ../config.toml . + +# configure and build the project +cmake ../ -DCMAKE_BUILD_TYPE=Release +make \ No newline at end of file