Factor/GIT repository

Building Factor from source is the recommended way to get Factor if you want to track development, because it saves bandwidth over downloading a binary every few days. It is also a requirement for contributors who wish to push patches to the Factor repository. New users and casual dabblers should use binaries if possible instead, to save time and effort.

In particular, setting up the GNU tool chain on Windows can take some effort, so Windows users are encouraged to use Factor binaries instead.

Browse repository

You can browse the GIT repository online at http://github.com/slavapestov/factor/ or http://gitweb.factorcode.org/.


If you are using Linux, you may need to install development packages (gcc, libc headers, xorg and pango development libraries, ...) before compiling Factor. If you are using Windows, see Setting up a Windows compilation environment.. On Mac OS X, you will need Apple's developer tools.

You will also need git on all platforms.

Cloning a repository

Once you have installed git, you can clone a copy of the Factor repository:

git clone git://factorcode.org/git/factor.git

Cloning from behind a restrictive corporate firewall:

git clone http://factorcode.org/git/factor.git

Once you have a clone of the repository, there are two ways to build Factor; you can build a clean branch, or the bleeding-edge sources.

Building and updating Factor the easy way

Once you have a GIT checkout of the Factor source tree, you can use the build-support/factor.sh utility to check for updates, and build Factor:

./build-support/factor.sh update

This utility automatically updates your repository, rebuilds the Factor VM, downloads the latest boot image, and bootstraps Factor.

Building and updating Factor the hard way

If you don't want to use the factor.sh script, you will need to build Factor in three steps:

  • compile the Factor VM
  • download a boot image
  • bootstrap Factor

If you did a git pull to update the sources, don't forget to recompile your VM and get a new boot image too.

Boot images

Factor is partially self-hosting; all of the code in core is packaged into a boot image by the bootstrap process. You will need to download a boot image before building Factor; once you have built Factor, you can generate a new boot image if you choose. Boot images are CPU-specific, and sometimes OS-specific:

  • boot.86.32.image - all 32-bit operating systems
  • boot.unix-86.64.image - 64-bit Mac OS X, Linux, BSD
  • boot.winnt-86.64.image - 64-bit Windows
  • boot.macosx-ppc.image - 32-bit PowerPC Mac OS X

You will need to download either a clean boot image, or the latest boot image, depending on whether you're building from a clean branch or the latest branch. See below for details.

Building from a clean branch

Clean branches should be tracked by users who do not wish to use the binary packages, but nevertheless require a high degree of confidence that the source will compile and work. See Build farm for details of the process used to create clean branches.

The currently available clean branches are:

  • clean-linux-x86-32
  • clean-linux-x86-64
  • clean-winnt-x86-32
  • clean-macosx-x86-32
  • clean-macosx-x86-64
  • clean-macosx-ppc
  • clean-freebsd-x86-32
  • clean-freebsd-x86-64
  • clean-netbsd-x86-32
  • clean-netbsd-x86-64
  • clean-openbsd-x86-32
  • clean-openbsd-x86-64

Step 1: To track a clean branch, you will need to clone a repository first, then issue the following two commands to stay up to date:

git checkout -b clean-os-cpu origin/clean-os-cpu
git pull git://factorcode.org/git/factor.git clean-os-cpu

Step 2: Download the latest clean boot image for your architecture from http://factorcode.org/images/clean/. Place the boot image in the Factor directory. If there are two images in the directory, choose the one which says unix-x86.64.

Step 3: Compile the Factor VM by running make (gmake on BSD).

Step 4: Bootstrap Factor by issuing a command like the following, where arch is one of x86.32, unix-x86.64, winnt-x86.64, or macosx-ppc:

./factor -i=boot.arch.image

Building from bleeding-edge sources

Instead of tracking a clean branch, you can also track the latest sources. Keep in mind that these might not always build or work correctly, so pay attention to the Concatenative IRC channel and Mailing list if you plan on doing this.

Step 1: To pull the latest patches, issue the following command in a cloned repository:

git pull origin master

Step 2: Download the latest boot image for your architecture from http://factorcode.org/images/latest/. Place the boot image in the Factor directory.

Step 3: Compile the Factor VM by running make (gmake on BSD).

Step 4: Bootstrap Factor by issuing a command like the following, where arch is one of x86.32, unix-x86.64, winnt-x86.64, or macosx-ppc:

./factor -i=boot.arch.image

Running Factor

Once you've built Factor, you can run it. See Getting started.

This revision created on Fri, 9 Oct 2009 08:28:59 by slava