Add a source-2-source compiler example to the documentation
[cloog.git] / examples / README
blob5669346e78d68f57ed70d56c673b853343268b6a
2 #  /**-------------------------------------------------------------------**
3 #   **                              CLooG                                **
4 #   **-------------------------------------------------------------------**
5 #   **                       Library use examples                        **
6 #   **-------------------------------------------------------------------**
7 #   **             First version of this file: july 15th 2003            **
8 #   **-------------------------------------------------------------------**/
12 In this directory are presented various examples of how to use the CLooG
13 library. For each case, you will need to edit the makefile file according to
14 your system, in particular you will have to set where your CLooG library has
15 been installed, and where are the CLooG header files. Don't forget to update
16 your LD_LIBRARY_PATH environment variable to reach the CLooG library. If you
17 performed the default installation of CLooG, the library is in /usr/local/lib
18 thus you need to set LD_LIBRARY_PATH thanks to one of the following command:
19 'setenv LD_LIBRARY_PATH /usr/local/lib' for tcsh-like shells, or
20 'export LD_LIBRARY_PATH=/usr/local/lib' for bash-like shells.
22 For any problem: <cloog-development@googlegroups.com>.
25 #   **-------------------------------------------------------------------**
26 #   **                          I. example                               **
27 #   **-------------------------------------------------------------------**/
30 This directory includes two basic examples:
31 - The first example program creates a simple CLooG-like loop generation
32 program in a few lines. The input problem has to be given on standard input.
33 Users can test it for instance by typing 'more FILE.cloog | ./example' (or
34 example.exe under Cygwin) after compilation.
35 - The second example shows how to build a CLooG input from isl sets,
36 generate the scanning code AST and pretty-printing it to the standard
37 output. Users can test it by typing './example-isl' (or example-isl.exe
38 under Cygwin) after compilation.
41 #   **-------------------------------------------------------------------**
42 #   **                    II. polyhedral_compiler                        **
43 #   **-------------------------------------------------------------------**/
45 This example shows a complete source-to-source polyhedral compiler based on the
46 OpenScop polyhedral representation. It requires both the OpenScop and Clan library
47 to be installed, see:
48 - OpenScop:
49   https://github.com/periscop/openscop
50   http://icps.u-strasbg.fr/~bastoul/development/openscop
51 - Clan:
52   https://github.com/periscop/clan
53   http://icps.u-strasbg.fr/~bastoul/development/clan
54 This compiler takes as input a C file with a SCoP inside, raises that SCoP to the
55 OpenScop representation, and converts that representation back to C. Simply add your
56 optimizing algorithm in the middle and you just have an optimizing compiler in
57 the polyhedral model!