diff options
author | Tor Brede Vekterli <vekterli@yahoo-inc.com> | 2017-10-04 15:28:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-04 15:28:00 +0200 |
commit | 4730bfadb553cc75a761f82a9841ebbc9e4c846c (patch) | |
tree | dd4028d57a143c8a2c74cd01b628a4abd89faf4d | |
parent | 9daec1d86c0360ee8ad8ecd7ec84968337e68de5 (diff) | |
parent | 425cd4a88c66510914fb5b34ce980c785389f64d (diff) |
Merge pull request #3646 from vespa-engine/geirst/update-vagrant-centos-clion-build-guide
Geirst/update vagrant centos clion build guide
-rw-r--r-- | vagrant/README.md | 42 | ||||
-rw-r--r-- | vagrant/Vagrantfile | 10 |
2 files changed, 42 insertions, 10 deletions
diff --git a/vagrant/README.md b/vagrant/README.md index 02d11900558..1ca811f982d 100644 --- a/vagrant/README.md +++ b/vagrant/README.md @@ -7,22 +7,52 @@ ## Create dev environment -### Change working directory to <vespa-source>/vagrant +1. Change working directory to <vespa-source>/vagrant cd <vespa-source>/vagrant -### Start and provision the environment +1. Install Vagrant VirtualBox Guest Additions plugin +This is required for mounting shared folders and get mouse pointer integration and seamless windows in the virtual CentOS desktop. + + vagrant plugin install vagrant-vbguest + +1. Start and provision the environment vagrant up -### Connect to machine via SSH +1. Connect to machine via SSH SSH agent forwarding is enabled to ensure easy interaction with GitHub inside the machine. vagrant ssh -### Checkout vespa source inside machine -This is needed in order to compile and run tests fast on the local file system inside the machine. +1. Checkout vespa source inside virtual machine +This is needed in order to compile and run tests fast on the local file system inside the virtual machine. git clone git@github.com:vespa-engine/vespa.git ## Build C++ modules -Please follow the instructions described [here](../README.md#build-c-modules). +Please follow the build instructions described [here](../README.md#build-c-modules). +Skip these steps if doing development with CLion. + + +## Build and Develop using CLion +CLion is installed as part of the environment and is recommended for C++ development. + +1. Bootstrap C++ building +Go to <vespa-source> directory and execute: + + ./bootstrap-cpp.sh . . + +1. Start CLion +Open a terminal inside the virtual CentOS desktop and run: + + clion + +1. Open the Vespa Project +Go to *File* -> *Open* and choose <vespa-source>/CMakeLists.txt. + +1. Set compiler threads +Go to *File* -> *Settings* -> *Build, Execution, Deployment* -> *CMake*. +Under *Build Options* specify "-j 4" and click *Apply*. + +1. Build all modules +Choose target **all_modules** from the set of build targets and click build. diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index 74b2f5bdbdb..a06f5afbd49 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -4,7 +4,7 @@ # For a complete reference, please see the online documentation at https://docs.vagrantup.com. Vagrant.configure("2") do |config| - config.vm.box = "boxcutter/centos73-desktop" + config.vm.box = "boxcutter/centos7-desktop" config.ssh.forward_agent = true @@ -16,7 +16,7 @@ Vagrant.configure("2") do |config| vb.name = "vespa-dev" vb.memory = "8192" - vb.cpus = 8 + vb.cpus = 4 end # Install required and nice-to-have packages @@ -27,6 +27,7 @@ Vagrant.configure("2") do |config| yum -y install yum-utils yum -y install git \ ccache \ + maven \ rpm-build \ valgrind \ sudo \ @@ -35,7 +36,8 @@ Vagrant.configure("2") do |config| yum-builddep -y /vagrant/dist/vespa.spec echo -e "* soft nproc 409600\n* hard nproc 409600" > /etc/security/limits.d/99-nproc.conf echo -e "* soft nofile 262144\n* hard nofile 262144" > /etc/security/limits.d/99-nofile.conf - wget -q -O - https://download.jetbrains.com/cpp/CLion-2017.2.2.tar.gz | tar -C /opt -zx - ln -sf /opt/clion-2017.2.2/bin/clion.sh /usr/bin/clion + echo -e "fs.inotify.max_user_watches = 524288" > /etc/sysctl.d/clion.conf + wget -q -O - https://download.jetbrains.com/cpp/CLion-2017.2.3.tar.gz | tar -C /opt -zx + ln -sf /opt/clion-2017.2.3/bin/clion.sh /usr/bin/clion SHELL end |