C Compiler for SpiNNaker

Follow me on GitHub

To build programs on SpiNNaker, you will primarily need to install a C compiler that is compatible with SpiNNaker. At present, we recommend using gcc for this. Instructions for installing this on your system are below, depending on which platform you are using, as well as instructions for installing Perl, which is used by the development tools to modify the generated binaries to run on SpiNNaker:

Linux

Development Dependencies for Ubuntu

  1. Install the arm-none-eabi toolchain

    sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi
    
  2. Install perl and dependencies

    sudo apt-get install perl perl-tk libterm-readline-gnu-perl
    

Note: as of October 2020, if you have Ubuntu 18 or earlier then you will find that certain binaries will not compile due to overflowing the ITCM limit. You can solve this by either upgrading to Ubuntu 20, or by installing a newer version of the arm-none-eabi-gcc compiler. To do this:

  1. Download from the ARM developer site (choose at least version 9).

  2. Click the link (e.g. “gcc-arm-none-eabi-*-x86_64-linux.tar.bz2”) to download a tarball

  3. Untar this file once it has downloaded (noting the location where you have untarred it) e.g.:

    tar -xjf gcc-arm-none-eabi-*-x86_64-linux.tar.bz2
    
  4. Add location/bin to your PATH in order to use the new binary (make sure the new location comes before any old locations in your PATH variable; to check you are using the correct one, type “which arm-none-eabi-gcc”)

Development Dependencies for 64-bit Fedora

  1. Install the arm-none-eabi toolchain

    sudo dnf install arm-none-eabi-gcc-cs arm-none-eabi-newlib
    
  2. Install perl and dependencies

    sudo dnf install perl perl-Tk perl-Term-ReadLine-Gnu
    

Mac OS X

Development Dependencies for Mac OS X

  1. If you haven’t done so already, install Xcode and all its development tools from here or via the App Store. NOTE: take into account your Mac version if using a direct download.

  2. If you haven’t done so already, sign the Xcode license to enable compilation on your computer.

    sudo xcodebuild -license
    
  3. If you haven’t done so already, install Mac Ports.

  4. Install the arm-none-eabi toolchain.

    sudo port install arm-none-eabi-gcc
    
  5. Install perl and related dependencies.

    sudo port install perl5 p5-tk p5-term-readline-gnu
    

Windows

Development Dependencies for Windows

Users with an up-to-date version of Windows 10 64-bit may want to use the Linux Subsystem for Windows 10. This has been tested with an Ubuntu 14.04 install and seems to work well. For graphics content, you will also need to install and run an X-Windows Server. After installing, you should follow the Ubuntu installation instructions.

All other Windows Users should follow the instructions below.

  1. Download the prepackaged MinGW Environment.
  2. Extract the downloaded archive to the location of your choice
  3. Create a shortcut to MinGW/msys/1.0/msys.bat and add it to your start menu

You can now use the msys.bat to start up an environment from in which you can compile C code for SpiNNaker.