gtclang is a source-to-source compiler with a high level DSL (Domain-Specifc Language) to execute stencil-like computations on a variety of different parallel architectures. The target applications for gtclang are regional weather models (regular grids) as well as global weather and climate simulations (irregular grids). gtclang is built on top of the LLVM/Clang compiler framework and Dawn and produces highly optimized C++ source code for the gridtools library.
gtclang depends on Dawn as well as Clang (3.8.0), the generated code further requires gridtools and optionally CUDA. The build process requires a C++11 compiler and CMake. To build all these dependencies with a single CMake invocation, it is highly recommended to use the meta repository gtclang-all.
If you wish to directly compile the library, make sure CMake can find Dawn (pass the install directory via DAWN_ROOT
) and Clang (if CMake has trouble finding Clang or LLVM, set LLVM_ROOT
to the correct directory). Note that Ubuntu 16.04 ships with Clang (3.8.0) and a simple
sudo apt-get install llvm-3.8-dev clang-3.8
will install it. An example invocation of CMake may look like
git clone https://github.com/MeteoSwiss-APN/gtclang.git
cd gtclang
mkdir build && cd build
cmake .. -DDAWN_ROOT=<dawn-install-dir>
make -j4
make install
This will install gtclang locally into <gtclang-dir>/install/
. The gtclang
compiler can be found in the bin/
directory.
This project is funded by the PASCHA project and developed by ETH Zurich and MeteoSwiss. Significant contributions were made by Fabian Thuering (Master Thesis), Carlos Osuna and Tobias Wicky.
The full license can be found here.
This project is licensed under the terms of the MIT license.