Linux Setup - northern-bites/nbites GitHub Wiki

If you need to install Ubuntu first, start with Installing Linux to see how you can dual boot Ubuntu or check out virtual solutions such as Parallels to get Ubuntu running under your current OS. Make sure you have at least version 11.10.

NOTE: We do not support 64-bit Linux! The setup process described below will only set up a 32-bit machine.

How To Set Up#

1. Install Git

To get to the terminal, click the swirly icon in the upper left corner of the screen and type in terminal. Open the Terminal application.

Update your package manager first. In the terminal, enter the command

$> sudo apt-get update

Then run

$> sudo apt-get install git-core gitk

2. Clone Our Code

See the Configuring Git page to get this all set up.

3. Run linux_setup.sh

Once you have the code downloaded, cd into nbites/util/scripts and run, with [naoqi version] being the latest version of Naoqi (as of June 2016, 2.1.0.19)

$> ./linux_setup.sh [naoqi version]

This script sets up a Linux machine with all necessary software and files. Make sure to keep an eye out for the script running or else it might time out on parts where user input is required! Also follow the instructions shown at the end of running the script.

3.5 Download Color Tables

We don't use color tables for categorizing colors anymore, but our build system requires that we have them. cd into data/tables/ and run ./sync down. Wait until all the color tables have been downloaded.

4. Build protobuf dependencies

Once the script has run, you can attempt to compile our robot code and offline tools. Do the following:

$> cd <path-to-nbites-folder>/nbites/src/man
$> make cross

This gets you to a screen where you can set various compilation settings for compiling the code. On this screen, you would set which robot you want to install onto, which behaviors you want the robot to run, various logging settings, and more.

The first time you run make cross, you have to perform certain setup steps.

  1. Navigate to the BUILD_PROTOBUF option using the arrow keys and press enter to turn it ON.
  2. Navigate to the CMAKE_BUILD_TYPE option and press enter to edit it. Type in release and press enter to submit this value.
  3. Navigate to the USE_LOGGING option and press enter to turn it on.

Press c (to configure) then g (to generate). If you see an error message (Configuring incomplete, errors occurred!) repeat from make cross.

Once you have made cross without any errors, then run:

$> make

This step will take a while, so go get some food or something. I'll wait.

Before you leave src/man, run make cross again and since you already built protobufs once, you don't want to do it again. So turn them off and you should never have to build protobufs again.

You should now have a folders named protobuf_cross in your nbites/lib folder.

Your computer is now ready for Robocup development. However, nbcross still hasn't been built and cannot be run -- this page has instructions for building and running nbcross. If you don't know anything about Git (or even if you do), you should read about it: it's the program we use to synchronize code we write. Check out the learning Git page for the next step in the Beginner's Guide once you're done with the setup! Alternatively, head to the list of current projects to see what we'd love for you to work on.


In the steps above, you ran a script called linux_setup.sh. This script installed a lot of programs and development tools that Robocup uses. Below is a description of what that automated script did.

A Description of linux_setup.sh:

We wrote the linux_setup script to make the rather complicated setup process automated. The steps below describe what it actually does to your computer. You can also check out the code itself.

1. Install Necessary Packages

Our software has a bunch of dependencies that you can get through apt-get, Ubuntu's package manager. These are...

  • build-essential : Compilation tools. This gets gcc and related stuff.

  • cmake : We use this for our build system. It should be version 2.8.

  • cmake-curses-gui, ccacche : A terminal GUI for editing build options, and cache for these options.

  • git-core, gitk : Our version control system (and a gui for it).

  • python2.7-dev : This is the version of python on the robots. Not actually necessary until we start running python offline one day... But you do need python for our autowrapping script.

  • emacs : Our favorite editor. Not necessary, but people on the team can help you use it.

  • aptitude : Alternative package manager interface.

  • qt4-dev-tools : Our offline tool is written using Qt.

  • python-pyparsing : Used for automatically boost-wrapping protobuffers.

  • libboost-all-dev : The boost libraries. Several parts of our code base depend on them.

  • default-jre : Default java version

  • default-jdk : Default again, lets you run javac

  • ant : used for the 8th version of the offline tool.

The script installs all of these en masse, but you can get any of them individually by running:

$> sudo apt-get install <package-name>

2. Get the NaoQi SDK

Download the latest SDK from the server, link here. It will be in a folder by version number, and you want the file named naoqi-sdk-...-tar.gz.

Extract this file and move it to a suitable place, usually nbites/lib/naoqi-sdk-[version]-linux. This location may change based on personal preference. In other words, run, in the directory where you downloaded the file

$> tar -xvzf [filename].tar.gz

Then move the file using

$> mv [extracted file] <path-to-nbites-dir>/lib/naoqi-sdk-[version]-linux

3. Get the Cross Toolchain

Download the latest toochain from the server, link here. It will be in a folder by version number, and you want the file named nbites-atom-toolchain-...-tar.gz.

Extract this file and move it to nbites/lib/atomtoolchain. In other words, run, in the directory where you downloaded the file

 $> tar -xvzf [filename].tar.gz

Then move the file using

$> mv [extracted file] <path-to-nbites-dir>/lib/atomtoolchain

It must be exactly in this place with the correct name for the build system to find it!

4. Setup Your .bashrc

Now that we have the dependencies, your computer needs to know how to find them. Add the following line to ~/.bashrc:

source /path/to/nbites/lib/nbites.bash

In other words, run

$> pico ~/.bashrc

Then paste the line above into the file. You can add a comment, prefaced with a #, to remind yourself that that line is for RoboCup. It creates a link to the file we're about to create...

So create a file in nbites/lib called "nbites.bash" which should contain the following lines:

export NBITES_DIR=<path-to-nbites-dir>`  
export AL_DIR=<path-to-naoqi-sdk>`  
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path-to-nbites-dir>/ext/lib`  
export PATH=$nbites_dir/ext/bin:$PATH`