This project translates a program written in UPC (Unified Parallel C) program into the C language program. It is built at the top of the Clang UPC and is compatible with the Berkeley UPC translator.

Installing Clang UPC to C Translator

1.1 Requirements

Clang UPC to C translator (upc2c) requires Clang UPC.

1.2 Build and Install

Get sources for llvm-upc and clang-upc projects:

mkdir [path/to/src]; cd [path/to/src]
git clone https://github.com/Intrepid/llvm-upc.git llvm
cd llvm/tools; git clone https://github.com/Intrepid/clang-upc.git clang

Get sources for upc2c project:

cd clang/tools; git clone https://github.com/Intrepid/upc2c.git upc2c

Note: clang is installed as a llvm's tool, while upc2c is installed as a clang's tool.

Build the translator:

mkdir [path/to/build]; cd [path/to/build]
cmake path/to/llvm [options]

build is a directory that holds the intermediate build products. The build directory needs to be outside the llvm tree, but other than that, it’s arbitrary.

See ClangUPC documentation for additional build options.

Running UPC to C translator

Clang upc2c is invoked by the running the upc2c driver.

upc2c -o out.c program.upc

By default, the output file name has an extension trans.c.

Supported Platforms

The UPC2C translator works on all the platforms where Clang UPC is supported.

More on Clang UPC2C translator