Mac OS X Support

StrategoXT works on Mac OS X. Unfortunately, to compile and use it you need a patched GNU C Compiler. The compilers currently shipped by Apple and the FSF do not implement nested functions correctly, causing programs using them to segfault.

Fortunately, binary distributions of both GCC and StrategoXT are available from this page. You need them both, since Stratego invokes GCC!

These should be unpacked into your root directory. Then you should add the directories /usr/local/pkg/gcc-3.3-nested/bin and /usr/local/pkg/StrategoXT-0.9/bin at the front of your path. You may want to increase the stack size when running Stratego programs (e.g., ulimit -s 8192 in Bash).

There was an additional problem with the way Stratego calls the linker (ld): it passes linker search directories as "-L /foo", while Apple's ld only accepts "-L/foo". The GCC distribution above now contains a linker wrapper script that fixes this.


The performance of StrategoXT at Mac OS X is rather poor.

  • The main reason for this is probably the architecture of the G4, which doesn't play too well with the implementation of choices (based on jmp_buf) in the Stratego compiler. The size of a jmp_buf depends on the architecture of the processor and unfortunately RISC processors need a very large jmp_buf.

  • Another reason might be the performance of nested functions. This will be solved when the Stratego compiler no longer uses nested functions for the implementation of lexical scope of strategies in Stratego.

  • Yet another reason is the performance of forking a process. Forking is much slower at Mac OS X (and Cygwin) then at a Linux system.

GNU/Linux at PowerPC

One of our master students (Dick Eimers) has installed Debian at a PowerMac6,3 and I've tried to build StrategoXT on this machine. At first this wasn't very succesful. I was using FSF's GCC 3.3.4 and this resulted in the usual problems.

However, it works look a charm with GCC 3.4.1! Even more suprising to me is the performance, which is excellent. We used to explain the poor performance of StrategoXT at Mac OS X with the size of the jmp_buf and forking, which is more expensive at Mac OS X. Of course forking does however not influence the performanceo of a single Stratego program, so it seems that the jmp_buf is not a huge factor.

  mbravenboer@mcflurry:~$ uname -a
  Linux mcflurry 2.4.25-powerpc #1 mer avr 14 15:38:38 CEST 2004 ppc GNU/Linux

  mbravenboer@mcflurry:~$ more /proc/cpuinfo
  processor       : 0
  cpu             : 7455, altivec supported
  clock           : 1249MHz
  revision        : 3.3 (pvr 8001 0303)
  bogomips        : 1245.18
  machine         : PowerMac6,3
  motherboard     : PowerMac6,3 MacRISC3 Power Macintosh
  board revision  : 00000001
  detected as     : 287 (Unknown Intrepid-based)
  pmac flags      : 00000000
  L2 cache        : 256K unified
  memory          : 512MB
  pmac-generation : NewWorld

  jmp_buf size: 364

jmp_buf size at my SuSE? 9.0 at Pentium M system is 156.

History and Future

Mac OS X is support with a patched GCC from StrategoXT 0.9.1. This patch has been implemented by Eelco Dolstra.

In StrategoXT 0.12 or 0.13 we hope to remove nested functions in the C sources produced by the Stratego Compiler (See issue STR-119).

CategoryToDo? CategoryInstallation