Clang UPC2C Translator
Installing Clang UPC to C Translator
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.
The UPC2C translator works on all the platforms where Clang UPC is supported.