Skip to content

pyprogrammer/ctree

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ctree

A C-family AST implementation designed to be an IR for DSL compilers.

See the website or documentation.

Build Status Coverage Status

Quick install

OSX

This installation will not support use of OpenMP.

brew tap homebrew/versions
brew install llvm34 --with-clang --rtti
LLVM_CONFIG_PATH=llvm-config-3.4 pip install git+https://github.com/llvmpy/llvmpy.git@llvm-3.4
pip install git+https://github.com/ucb-sejits/pycl

pip install pygments numpy nose sphinx

# For using our DOT viewers
# brew install graphviz

pip install git+https://github.com/ucb-sejits/ctree

OpenMP Support

After following the quick install steps above, run this.

brew tap ucb-sejits/sejits
brew install --HEAD ucb-sejits/sejits/libomp ucb-sejits/sejits/clang-omp
LLVM_CONFIG_PATH=/usr/local/Cellar/clang-omp/HEAD/bin/llvm-config pip install git+https://github.com/llvmpy/llvmpy.git@llvm-3.4

Then, append to your ~/.ctree.cfg.

[omp]
CC = /usr/local/opt/clang-omp/bin/clang
CFLAGS = -march=native -O3 -fopenmp

To test, try running the OpenMP specializer example.

PYTHONPATH=`pwd` python examples/OmpSpecializer.py

If all goes well, you should see an output containing

...
Hello from thread 0 of 4.
Hello from thread 1 of 4.
Hello from thread 3 of 4.
Hello from thread 2 of 4.
Done.
INFO:ctree:execution statistics: (((
  specialized function call: 1
  specialized function cache miss: 1
)))

About

A C-family AST implementation designed to be an IR for DSL compilers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%