13. Annex C: the LOFT Compiler

13. Annex C: the LOFT Compiler

Browsing

Home:
Concurrent Programming with Fair Threads
The LOFT Language

Previous chapter: Annex B: LOFT Reference Manual
Next chapter:


Chapters

1. Introduction
2. The Language LOFT
3. Examples - 1
4. Programming Style
5. Semantics
6. FairThreads in C
7. Implementations
8. Examples - 2
9. Related Work
10. Conclusion
11. Annex A: API of FairThreads
12. Annex B: LOFT Reference Manual
13. Annex C: the LOFT Compiler
  Glossary
  Index

The Loft compiler is a one-pass compiler that translates Loft programs into C code and then compile it with the standard C compiler. It runs under Linux and is called loft. There are 5 main options: Option -ft is the default option. All files containing Loft code should be terminated by .loft or .LOFT. Standard C files can be given to loft and are processed in the standard way. As example, the command loft -direct test.loft produces an executable a.out from the file test.loft. There are others options:
  • -v to trace the actions performed by the compiler.
  • -debug like -v but the actions are not performed.
  • -code to only produce the C code.
  • -c to only produce the .o code (like the standard C compiler).
  • -o to rename the executable (like the standard C compiler).
  • -version to get the current version of the compiler.
For example, loft test.loft -debug produces something which looks like:

/bin/loft/loft2ft test.loft > test.loft.c
gcc -I/include/loft -I/include/ft_v1.0 test.loft.c \
    -L/lib/loft -lloft_ft \
    -L/lib/ft_v1.0 -lfthread -lpthread
and loft -direct test.loft -debug produces:

/bin/loft/loft2c test.loft > test.loft.c
gcc -I/include/loft test.loft.c -L/lib/loft -lloft_c
The loft command actually uses the following processors and libraries:
  • loft2c, loft2ft, loft2sem which are the commands for producing C code corresponding to -direct, to -ft, and to the 3 implementations of the semantics.
  • libloft_c.a, libloft_ft.a, libloft_rewrite.a, libloft_replace.a, libloft_optim.a, and libloft_gba.a which are the various libraries for execution.
Some shell variables can be redefined for the command loft:
  • C_COMPILER to set a different C compiler.
  • LOFT_BINDIR, LOFT_INCLDIR, and LOFT_LIBDIR to change the directories where the executables, include files, and libraries used by loft are placed.
  • FT_INCLDIR and FT_LIBDIR to change the directories where the include file and the library needed by the -loft option are placed.

This page has been generated by Scribe.
Last update Wed Oct 22 18:41:04 2003