The NUbots use Vagrant to manage and version the build environment for the NUClearPort project.
The following is a guide to getting you set up and ready to contribute to the NUClearPort project.
Install the following prerequisites on your machine (packages/installers are available for Windows, OSX, and Linux):
- Virtualbox (or VMware Fusion)
- Vagrant (Note: The version of Vagrant that is available in the Ubuntu 12.04 repositories is an older version that is incompatible with the NUbots' Vagrantfile. If you're using Ubuntu 12.04, please install the latest version of Vagrant via a .deb from the Vagrant download page)
Clone this git repository onto your machine: e.g.
$ git clone email@example.com:nubots/NUClearPort.git ~/NUClearPort
Create a Vagrant base box using Packer:
The build-helper script has a command for this Linux:
$ cd ~/NUClearPort $ ./b create_box virtualbox
$ python b create_box virtualbox
vagrant upfrom the NUClearPort directory: e.g.
$ cd ~/NUClearPort $ vagrant up
vagrant upcommand tells Vagrant to create and start a VM for the NUClearPort project based on the project's
Note: The very first time
vagrant upis run on your computer, it will initiate a 282 MB download (the base box for the VM). Vagrant will store the box locally in a special location, and will not need to download it again (see the boxes page of Vagrant's Getting Started guide, or Vagrant's boxes documentation if you want to know more about boxes).
When given a choice of network interface, e.g.:
[default] Available bridged network interfaces: 1) en0: Wi-Fi (AirPort) 2) p2p0
Select which adapter the VM will use for its network connection by entering a number (if in doubt, the first option is likely to be the best choice).
$ vagrant sshto ssh into your new VM!
Vagrant will sync the
~/nubots/NUClearPortdirectory on the VM with the root of your NUClearPort repository. This allows for easy editing of code on your machine, and building on the VM.
To build NUClearPort, just run the following commands on the VM:
$ mkdir ~/nubots/NUClearPort/build $ cd ~/nubots/NUClearPort/build $ cmake .. $ make -j
Make robots do awesome stuff!
Also, read the steps in the NUClearPort Startup Guide about additional Vagrant config.
Important: Make sure to set your git identity correctly before committing to the project.
$ git config --global user.name "Your Name" $ git config --global user.email firstname.lastname@example.org $ git config --global color.ui auto