Building a toolchain

The toolchain is the set of tools used to prototype or run a Cortexlab experiment.

Actually, there is theorically almost no constraint at all on the toolchain that experimenters could use, since the workflow of execution of an experiment on each node is basically the following:

Thus, users, may pack whatever they want in their task file.

The CorteXlab toolchain

That said, the cortexlab team provides a standard toolchain, which we call the CorteXlab toolchain, which is maintained, supported, configured, includes all necessary drivers, and is well adapted to our platform. This toolchain is made of the following components:

This toolchain is installed on the CorteXlab nodes as well as on the CorteXlab frontend airlock. It is regularly updated and versionned (current version, at the date of this writing is v1.4).

cxlb-build-toolchain

The building of this toolchain is completely automated by the cxlb-build-toolchain script. Users can use this script to build a similar toolchain on their workstation.

The only limitation is that this script is only supported on recent (stable or testing) linux debian 64 bits. Running it in another environment may be possible with some limitations. For example, it's quite straightforward to run it under a recent ubuntu 64 bits, a few package names will need to be adapted. On the other hand, it won't work at all on a 32 bits system or under windows or macos.

The main advantage of the cxlb-build-toolchain is that it takes care of installing everything in a given directory, as a regular user. It then generates and installs two scripts, one that has to be run as root, to configure the dynamic loader and udev to use the toolchain, the other that has to be sourced by the user which will use the toolchain, to configure the environment. Thus:

When building a toolchain on a user's workstation, the user is not forced to build everything. For example, a user willing to experiment only with usrp can avoid installing all picosdr stuff (xilinx ise, digilent hs2 jtag, adp).

Usage

This script has an integrated help. Try running:

$ cxlb-build-toolchain --help

Basically, building a toolchain consists of the following steps:

Once finished, two scripts are generated in install/bin/: cxlb-toolchain-system-conf which needs to be run once as root, to configure the dynamic loader and udev rules, and cxlb-toolchain-user-conf which needs to be sourced to configure the environment in each session where you want to use the toolchain. If you want to always have the toolchain available and configured, you can add sourcing of cxlb-toolchain-user-conf in your ~/.profile.

Also, once finished, two files are generated in install/share/cxlb-build-toolchain:

build.bundle

You can build the exact same toolchain as the one in CorteXlab using the bundle file.

The bundle file of the current CorteXlab toolchain can be found on airlock in /cortexlab/toolchains/current/share/cxlb-build-toolchain/build.bundle. It can be used as input of cxlb-build-toolchain to build on your workstation a toolchain with the exact same versions of everyhting.