Menu

Compiling on the Raspberry Pi

thebeez

How to compile 4tH for the Raspberry Pi

Introduction

Cross-compiling in general is no walk in the park. It has been said it is called "cross compiling", because it makes people cross. The Raspberry Pi is no exception. However, it is quite feasible to compile 4tH on the Raspberry Pi itself.

Procedure

I assume:

  • you're using the default Debian distribution;
  • you're in the "pi" home directory;
  • you do have a working internet connection;
  • you've installed all the latest updates and patches;
  • you don't have an SVN client yet.

If that is all true, enter these commands at the prompt:

 sudo apt-get install subversion
 svn checkout http://svn.code.sf.net/p/forth-4th/code/trunk 4th-read-only
 cd 4th-read-only
 make
 ./4th

Installation

If you're happy with the results, you could install 4tH more permanently. First by installing the executables and second by setting DIR4TH:

 cd ~/4th-read-only
 sudo cp 4th 4tsh pp4th /usr/local/bin

Now let's set DIR4TH. You can also use another editor than vi if you're more comfortable with that:

 cd
 vi .bashrc

Add this line to the end of .bashrc:

 export DIR4TH=/home/pi/4th-read-only/4th.src/

Don't forget the trailing slash!