Tuesday, September 18, 2007
Building Factor on Ubuntu, Part 1
I'm looking to learn the Factor language, so I figured I should build the latest version from source. I'm running Ubuntu 6.10 x86 on my workstation, so here is what I had to do to get it to build, after a fair amount of help from the guys on the #concatenative irc channel on freenode.
First of all, it lives in a darcs repository, so you'll almost certainly have to:
$ sudo apt-get install darcs
Then use darcs to download the latest sourcecode tree:
$ cd <where I want to put it>
$ darcs get http://factorcode.org/repos/
Now you should have the Factor source in <where I want to put it>/repos/Factor
$ cd repos/Factor
Now we have to get a bunch of other build dependencies too!
$ sudo apt-get install gcc build-essentials pkg-config xorg-dev nvidia-glx-dev libfreetype6-dev
I think that was all of the packages that needed to be installed (they pull in a bunch more of them too!)
I have an Nvidia graphics card using their binary drivers, which is why installing nvidia-glx-dev got me some of the libraries I needed to build the gui X-Windows version of Factor and it's nice IDE. If you don't have an Nvidia card, you won't want to install nvidia-glx-dev AT ALL, and will have to install other OpenGL libraries, most likely Mesa emulation ones. See the #concatenative channel on irc.freenode.net for help with that one.
After all of that, we're ready to do a:
$ make linux-x86
If your target isn't linux-x86, just type make from the repos/Factor dir with no arguments to see the other target options.
You will then need to download the bootstrap factor image file from factorcode.org into the Factor directory where you did all this building, and then run (for my architecture):
$ ./factor -i=boot.x86.32.image
That last command is going to take a WHILE to finish!
If all of that went well you should be able to move the factor command and factor.image somewhere in your path and be able to launch it by typeing 'factor' at the bash prompt (SEE UPDATE BELOW)..
Note that your Ubuntu or other linux distro might have come with another command called factor that is for factoring numbers, in which case you will need to make sure the factor you just built is first in your path!
Coming soon, Part 2, getting a no-X11 version built on my Feisty (Ubuntu 7.04) server!
-David Mercer
Tucson, AZ