Compiling Factor on the Intel Mac
Thursday, November 23, 2006
To compile Factor for Mac you will need:
- Installation DVDs that came with your Mac (for X11)
- darwin-ports
-
Run the installation disk that came with your Mac in order to install X11. Since Apple does not offer X11 as a download for OS X 10.4 for Intel computers, you have to install from the DVD.
-
Download the darcs binary and place it in /usr/local/bin
-
Open terminal (Finder->Applications->Utilities->Terminal) and go to your home directory. To get the Factor source code, run:
darcs get http://factorcode.org/repos
-
To compile, move into the directory darcs created with cd repos/Factor and run the command make macosx-x86
-
Download the boot image at http://factorcode.org/images/latest/boot.image.pentium4
-
./f boot.image.pentium4
-
make macosx.app
-
(Optional) Create a shell script to start Factor in your terminal window. I called mine go.
#!/bin/sh DIR=~/repos/Factor/Factor.app/Contents $DIR/MacOS/Factor $@ Save the file and run chmod a+x go
-
(Optional) You can instead run open Factor.app and use Console.app to view runtime output.
To start the UI, run ./go or open Factor.app; run ./f to start Factor in the shell. If you run Factor in the terminal, I suggest using rlwrap, which adds a history buffer
Now you can code anything!