NRP Installation¶
1. Initial set up¶
Create a folder in you home which will contain required 3rd-party software
Create a new directory where you will install all the source code for NRP. We suggest
$HOME/Documents/NRP. This directory will be referred to in the rest of this document as $HBP.
Add the$HBPenvironment variable to your bashrc.
Add the$NRP_INSTALL_MODEvariable to your bashrc which will make sure you use the publicly accessible code and build process, unless you are a core developer and have writing rights to the repos.Source your .bashrc
Apt prerequisites
sudo apt-get install python3-venv python-is-python3 cmake git build-essential doxygen python3-dev python3-h5py python3-lxml autogen automake libtool build-essential autoconf libltdl-dev libtinyxml-dev libreadline-dev libncurses5-dev libgsl-dev python3-all-dev python3-docopt python3-numpy python3-scipy python3-matplotlib ipython3 libxslt1-dev zlib1g-dev libfreetype-dev python3-opencv ruby libtar-dev libprotoc-dev protobuf-compiler imagemagick libtinyxml2-dev python3-virtualenv libffi-dev uwsgi-plugin-python3 python3-pip cimg-dev libgnuplot-iostream-dev jupyter-notebook xvfb
Clone the
user-scriptsrepository. This repository includes some helper scripts to ease the installation.Use the clone-all-repos script from user-scripts to clone all necessary repos at once. The $HBP variable need to be set for this script to work successfully!
Empty the
PYTHONPATHenv variable. AddPYTHONPATH=to the end of your$HOME/.bashrcSet up your environment automatically by adding the following two lines at the Bottom of your
$HOME/.bashrcNOTE: Generally, if you want to change any of the variables for any reason, then override the variables in your
$HOME/.bashrcand do not alter thenrp_variablesfile.Then source your bashrc. You will get some expected errors after sourcing the
$HOME/.bashrcif you’re doing a fresh install. This is due to some missing files that will be instantiated during the installation process.
2. Install ROS¶
NOTE: if you already installed ROS for your Ubuntu from apt-get, then you can skip this section.
Add GPG key of ROS to apt
Add apt repository for ROS
Update repositories
Install ROS Noetic.
sudo apt-get install ros-noetic-desktop-full sudo apt-get install ros-noetic-control-toolbox ros-noetic-controller-manager ros-noetic-transmission-interface ros-noetic-joint-limits-interface ros-noetic-rosauth ros-noetic-smach-ros ros-noetic-effort-controllers ros-noetic-async-web-server-cpp ros-noetic-web-video-server python3-rospkg python3-rosdep python3-bson python3-osrf-pycommon python3-catkin-tools
Initialize ROS
3. Gazebo prerequisites¶
If you have Gazebo 11 already installed, remove it first. (Remove any other version of Gazebo that you would have installed by yourself)
Test that
roscorecommand is still functioning. If not, consider reinstalling ROS by first removing it withapt-get remove --purge ros-noetic*and following the above paragraph again.Add GPG key of Gazebo to apt
Add apt repository for Gazebo
Update repositories
Install build dependencies
Install bullet from apt
Install Gazebo dependencies
You may require additional libraries to compile gazebo with all its options:
WARNING: Check that
$HOME/.local/lib/x86_64-linux-gnu/cmake/gazebois in your$CMAKE_PREFIX_PATH. If not, you might have forgotten to addnrp_variablesin your$HOME/.bashrc.
Further, make sure that$HOME/.local/lib/x86_64-linux-gnu/pkgconfigis in your$PKG_CONFIG_PATH. Otherwise, you will see errors that later builds will claim they did not find the HBP Gazebo features.WARNING: When you will build the whole NRP later, if gazebo build fails because you miss a number of libs (see end summary from cmake output), just apt-get the required ones, from the BUILD_ERRORS in the cmake step.
NOTE: Check that
$GAZEBO_MODEL_PATHfor example exists. If not, you might have forgotten to addnrp_variablesin your$HOME/.bashrc
4. NEST prerequisites¶
Remove any previous system level installations of PyNN
Install the GSL developer package
Install Yacc (for the MPI layer)
5. Gzweb prerequisites¶
First make sure that build dependencies are installed.
Install nvm (Node Version Manager) and nodejs v8
Install nvm (steps below taken from https://github.com/creationix/nvm)
Install node
Install bower
6. NRP prerequisites¶
Configure NRP
Go to
user-scriptsand run the configure scripts. This will set up Makefiles and default config files.NOTE: if you get errors, like missing directories or files, this is fine, they will be fixed later in the process. Just ignore them and proceed.
Install dependencies
7. Install Nginx and haproxy¶
Nginx is a web server, just like apache, that is very modular and in our case serves the Frontend app and backend UWSGI app, adding an authentication layer. It also serves assets on 8090 and routes the rosbridge and gzbridge websockets.
Haproxy provides a high availability load balancer and reverse proxy for TCP and HTTP-based applications. It acts as a port forwarder, dispatching traffic to frontend app, proxy and nrp-services.
list existing nginx packages (
apt list --installed | grep nginx) and remove if anylist existing haproxy packages (
apt list --installed | grep haproxy) and remove if anyInstall nginx-extras and lua-cjson and haproxy
Your setup should be finished with this step. The configuration of nginx is done automatically in a later step of the 100% install. Though, if you experience issues after you finish all the steps, go to the troubleshooting section below.
Stop haproxy and nginx services
Install luarocks and lua-resty-http for advanced requests processing
8. Frontend prerequisites¶
If you run into problems, see the Troubleshooting section at the end of the page.
Install dependencies:
Install grunt:
9. Build NRP¶
Open a fresh terminal to be certain to have the proper environment and run the configure_nrp script in user-scripts
This script copies the configuration files of nginx, haproxy, ExDFrontend, CLE as well as the gzserver & gzbridge scripts to the correct locations. It also modifies the raw config files to include the correct paths and usernames.
Build and reconfigure the Platform:
This will take time since all the python dependencies will be downloaded and numpy takes a while to build. If the script does not fail, then you are done. If the build fails, go to the troubleshooting sections in the relevant sections below.
Virtual machines ONLY: if you are installing on a virtual machine, or your GPU is not supported for any reason, you may use CPU rendering, which is slower, but always works. Just execute:
To switch back to GPU rendering, execute:
10. Install a SpiNNaker board (optional)¶
The SpiNNaker support software can be installed executing the following script:
To check that installation has been successful:
Ignore the error message about the config file.
Then update the $HOME/.spynnaker.cfg file that should have been created during the previous step. Set the 2 variables in the file as follows:
If you have a SpiNNaker-5, instead use:
Then configure the network interface connected to your SpiNNaker board with:
Under Ubuntu, you would plug the board in, open the network manager and set up the newly detected interface with a static IPv4 setting and the addresses here up.
The configuration described here is taken from the official SpiNNaker documentation at: http://spinnakermanchester.github.io/spynnaker/5.0.0/PyNNOnSpinnakerInstall.html#Configuration.
11. Install the fluid simulation (optional)¶
To install the optional fluid simulation you can follow the instructions provided here: