Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
#
#  /**-------------------------------------------------------------------**
#   **                              CLooG                                **
#   **-------------------------------------------------------------------**
#   **                       Library use examples                        **
#   **-------------------------------------------------------------------**
#   **             First version of this file: july 15th 2003            **
#   **-------------------------------------------------------------------**/
#


In this directory are presented various examples of how to use the CLooG
library. For each case, you will need to edit the makefile file according to
your system, in particular you will have to set where your CLooG library has
been installed, and where are the CLooG header files. Don't forget to update
your LD_LIBRARY_PATH environment variable to reach the CLooG library. If you
performed the default installation of CLooG, the library is in /usr/local/lib
thus you need to set LD_LIBRARY_PATH thanks to one of the following command:
'setenv LD_LIBRARY_PATH /usr/local/lib' for tcsh-like shells, or
'export LD_LIBRARY_PATH=/usr/local/lib' for bash-like shells.

For any problem: <cloog-development@googlegroups.com>.


#   **-------------------------------------------------------------------**
#   **                          I. example                               **
#   **-------------------------------------------------------------------**/


This directory includes two basic examples:
- The first example program creates a simple CLooG-like loop generation
program in a few lines. The input problem has to be given on standard input.
Users can test it for instance by typing 'more FILE.cloog | ./example' (or
example.exe under Cygwin) after compilation.
- The second example shows how to build a CLooG input from isl sets,
generate the scanning code AST and pretty-printing it to the standard
output. Users can test it by typing './example-isl' (or example-isl.exe
under Cygwin) after compilation.


#   **-------------------------------------------------------------------**
#   **                    II. polyhedral_compiler                        **
#   **-------------------------------------------------------------------**/

This example shows a complete source-to-source polyhedral compiler based on the
OpenScop polyhedral representation. It requires both the OpenScop and Clan library
to be installed, see:
- OpenScop:
  https://github.com/periscop/openscop
  http://icps.u-strasbg.fr/~bastoul/development/openscop
- Clan:
  https://github.com/periscop/clan
  http://icps.u-strasbg.fr/~bastoul/development/clan
This compiler takes as input a C file with a SCoP inside, raises that SCoP to the
OpenScop representation, and converts that representation back to C. Simply add your
optimizing algorithm in the middle and you just have an optimizing compiler in
the polyhedral model!