Thursday, November 23, 2006

Compiling Factor on the Intel Mac

To compile Factor for Mac you will need:
  • Installation DVDs that came with your Mac (for X11)
  • darwin-ports
  1. 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.
  2. Download the darcs binary and place it in /usr/local/bin
  3. 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
  4. To compile, move into the directory darcs created with cd repos/Factor and run the command make macosx-x86
  5. Download the boot image at http://factorcode.org/images/latest/boot.image.pentium4
  6. ./f boot.image.pentium4
  7. make macosx.app
  8. (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
  9. (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!

4 comments:

Benjamin said...

A couple of things:

1. The proper way to open a .app is via /usr/bin/open, in which case your go script becomes simply "open Factor.app". This will also take care to avoid launching multiple Factor GUIs, which you almost certainly want anyway.

2. Recommending that people install darcs via DarwinPorts is needlessly time-consuming and offers no benefit. The statically linked binary is small, runs perfectly fine, and installs in about two minutes.

The second change cuts down your instructions from "several hours and patience" to "about ten minutes" That's a pretty substantial difference.

Shawn the Rock said...

Hello,Doug~Thanks for share your expeirence about Factor here.But I got some error when I compiled today.Sorry Im a newbie so I need you help me out this problem.

Here is error informatiom:

make f CONFIG=vm/Config.windows
make[1]: Entering directory `/c/repos/factor'
gcc -c -Wall -O3 -ffast-math -std=gnu99 -DWINDOWS -o vm/debug.o vm/debug.c
vm/debug.c: In function `factorbug':
vm/debug.c:258: unable to find a register to spill in class `SIREG'
vm/debug.c:258: this is the insn:
(insn:QI 358 357 359 (parallel[
(set (reg:CC 17 flags)
(compare:CC (mem:BLK (reg/f:SI 1 edx [102]) [0 A8])
(mem:BLK (reg/f:SI 0 eax [103]) [0 A8])))
(use (reg:SI 2 ecx [104]))
(use (const_int 1 [0x1]))
(use (reg:SI 19 dirflag))
(clobber (reg/f:SI 1 edx [102]))
(clobber (reg/f:SI 0 eax [103]))
(clobber (reg:SI 2 ecx [104]))
] ) 607 {cmpstrqi_nz_1} (insn_list 352 (insn_list 354 (insn_list 356 (insn_list 357 (nil)))))
(expr_list:REG_DEAD (reg:SI 19 dirflag)
(expr_list:REG_DEAD (reg:SI 2 ecx [104])
(expr_list:REG_DEAD (reg/f:SI 1 edx [102])
(expr_list:REG_DEAD (reg/f:SI 0 eax [103])
(expr_list:REG_UNUSED (reg/f:SI 1 edx [102])
(expr_list:REG_UNUSED (reg/f:SI 0 eax [103])
(expr_list:REG_UNUSED (reg:SI 2 ecx [104])
(nil)))))))))
vm/debug.c:258: confused by earlier errors, bailing out
make[1]: *** [vm/debug.o] Error 1
make[1]: Leaving directory `/c/repos/factor'
make: *** [windows] Error 2

Shawn the Rock said...

Thanks Mr.Coleman~this problem was figure it out.Cause of I was using the old version of MinGW that cant compiling at all files with MSYS.Im sorry about disturb your comment here.^_^

God be with you!

FactorYourInvoices said...

Raising Capital- If You Want To Raise Cash, Try Factoring

The business landscape is littered with small business owners who've stumbled in their search for capital. Many requests are denied. Those who are able to secure more traditional forms of funding, frequently have unacceptable strings attached. Some financial deals come back to bite the business owner in the form of substantial debt, insufficient revenue share or worse.

Raising money is difficult and time consuming, and most small businesses fail because they run out of cash. Getting additional capital in smaller chunks will get you the cash your business needs without risking a loss of equity or ownership.

Factoring may be the answer to many business cash flow issues. Gaining in popularity, factoring (also known as Invoice Factoring or Accounts Receivable Financing) is the practice of selling your accounts receivable (invoices) at a discount to a specialized financial services company like Charter Capital. You get the money from Charter Capital and we help you collect on the invoices.

The reason many businesses make this move is to ensure the continuous flow of cash to the business without sacrificing equity or incurring debt. Essentially, businesses that use factoring are focusing on having most of the money now rather than all of it later. It can take time to collect on an invoice, so when a company finances its accounts receivable, they are getting their money faster and without the hassle of the collection process.

With small to mid-sized businesses, freeing up working capital through factoring can prove to be vital. The money can be invested into new equipment, used to pay bills, or used toward payroll. Of course, the alternative is to chase the customer for the invoice payment and defer everything else while the money is tied up in the collection process.

The lesson here is: Working capital in-hand today is better than dashed dreams tomorrow.

Charter Capital - Factoring Made Simple