Chiara compilation strategies

From Tekkotsu Wiki

Jump to: navigation, search

There are two ways to compile code for the Chiara: on-board and off-board.

On-Board Compilation

Advantages: simplest approach; self-contained; works well when traveling.

Disadvantages: must back up your code manually; compilation is slower than on a workstation.

  • To compile on board, keep /usr/local/Tekkotsu and ~/project current by periodically doing cvs updates.
  • User applications should be edited and compiled in ~/project.

Off-Board Compilation

Advantages: keeps user code on a workstation where it will be backed up with the rest of their files; faster compilation, especially on multicore machines; can run the same binary in "simulator mode" directly on the workstation.

Disadvantages: requires a workstation running Ubuntu 9.10 so binaries will be compatible with the Chiara. Might also work with Ubuntu 9.04 or recent Fedora releases; try it and see.

  • If you compile on a workstation, you will need to keep that copy of Tekkotsu up to date; the copy on the robot is unimportant. In fact, it is necessary to remove libtekkotsu.so from its usual place so it does not supplant the updated copy you'll be uploading from the workstation:
sudo rm /usr/local/Tekkotsu/build/PLATFORM_LOCAL/TGT_CHIARA/libtekkotsu.so
  • If ever you want to restore libtekkotsu.so on the robot just cd to /usr/local/Tekkotsu/project and type "make".
  • Once you've compiled your program on the workstation and produced a tekkotsu-CHIARA executable file, there are two ways to install it on the robot. The easiest is to use the sendmycode workstation script to scp the file to /home/student/project on the robot. If you have set up ssh authentication then you can do this without even typing a password. The other method is to use the getmycode robot script to scp the file onto the robot from the workstation; you will be prompted for the password for your workstation account.
  • Whenever you update Tekkotsu on the workstation, you will need to copy over a new version of libtekkotsu.so to the /home/student/lib directory on the robot. The sendtekkotsu or gettekkotsu scripts are used to accomplish that.