15-745 Spring '03
Using the SUIF Compiler

For homework assignments and term projects in 15-745, you will use the SUIF research compiler. SUIF stands for Stanford University Intermediate Format. You can look into the background of SUIF on the Stanford SUIF home page. Prof. Michael Smith's research group at Harvard has extended SUIF to support work on machine-specific optimizations. The resulting system, called Machine SUIF (machsuif for short), includes all the capabilities of Stanford SUIF (aka base SUIF), but adds facilities to generate and refine machine code for a number of target architectures.

SUIF Documentation

Base SUIF

Machine SUIF

Adjusting Your Environment for Use of Machine SUIF

The preferred machines to for 745 course work are CS facilitated x86 Linux machines. However, Andrew linux workstations (such as linux.andrew.cmu.edu) should also work. To setup your environment to run on these machines you should use the script /afs/cs/academic/class/15745-f03/public/bin/setup-suif-env. You invoke the script as follows:

eval `/afs/cs/academic/class/15745-f03/public/bin/setup-suif-env`
If you like, you can put this command in your shell setup file, e.g., .bashrc. (Note, the script will make its best guess about the shell you are using. You can force it to use the proper type with the optional arguments -sh or -csh.) If your environment is setup correctly, you should be able to use the program c2s to compile C programs to suif code. For example,
c2s hello.c
should produce the file hello.suif.

Creating a Local Directory Structure to Write Your Own Machine SUIF Passes

As the Machine SUIF infrastructure is shared you will only have read access to it. On the other hand, to do the assignments and the project you will need a writable directory. The script /afs/cs/academic/class/15745-f03/public/bin/setup-suif-localtree creates the following directories:
${HOME}/localnci
${HOME}/localnci/bin
${HOME}/localnci/solib
${HOME}/localnci/include
${HOME}/localnci/assignments
Your Machine SUIF passes will be in ${HOME}/localnci/assignments which should have its permissions set appropriately. Also, after creating such directories, you should define LOCAL_BASE in your shell initialization file (e.g. .cshrc for csh). Make sure you define it before setup-suif-env is evaluated.

Example

I ran the /afs/cs/academic/class/15745-f03/public/bin/setup-suif-localtree script once which (somewhat annoyingly) created a localnci directory in my home directory.

I then put these two lines in my .cshrc:

setenv LOCAL_BASE /afs/cs.cmu.edu/user/dkoes/localnci
eval `/afs/cs/academic/class/15745-f03/public/bin/setup-suif-env`

Back to CS745 home page.