OpenCilk / infrastructure

Installation instructions and build scripts for OpenCilk.
21 stars 6 forks source link

OpenCilk infrastructure

This repo contains tools for building the OpenCilk compiler, runtime, and productivity tools. Specifically, it includes scripts for building OpenCilk from source or building a Docker image of OpenCilk.

Supported systems

OpenCilk has been tested on the following processor architectures:

The present version has been tested on the following operating systems:

Summary of OpenCilk features

OpenCilk is largely compatible with Intel's latest release of Cilk Plus. Unsupported features include:

How to get OpenCilk

Precompiled binaries for OpenCilk are available for some systems here: https://github.com/OpenCilk/opencilk-project/releases/. To install, either download and run the appropriate shell archive (i.e., the .sh file) or unpack the appropriate tarball. A Docker image with OpenCilk installed is available from the same page. Some documentation on how to use the Docker image can be found here: docker.

These precompiled binaries require that standard system header files and libraries are already installed. These header files and libraries can be obtained by installing a modern version of GCC (including g++) on Linux or by installing a modern version of Xcode on macOS.

For other systems, we recommend instructions for downloading and building OpenCilk from source can be found here.

Porting Cilk Plus code to OpenCilk

Reducers: OpenCilk version 2.0 and newer does not support the Intel Cilk Plus reducer library and instead features a new syntax and implementation for reducers. The new reducer implementation allows one to change a local or global variable into a reducer by adding cilk_reducer(I,R) to the variable's type, where I and R designate the identity and reduce functions for the reducer. For example, here is how a simple integer-summation reducer can be implemented using the new reducer syntax:

#include <cilk/cilk.h>

void zero(void *v) {
  *(int *)v = 0;
}

void plus(void *l, void *r) {
  *(int *)l += *(int *)r;
}

int foo(int *A, int n) {
  int cilk_reducer(zero, plus) sum = 0;
  cilk_for (int i = 0; i < n; ++i)
    sum += A[i];
  return sum;
}

To port a Cilk Plus program to OpenCilk, once all uses of unsupported features have been updated, make the following changes to your build process:

Useful links

Contact

Bug reports should be posted to the GitHub issue tracker. Other queries and comments should be emailed to contact@opencilk.org.

OpenCilk development team

Previous team members

Acknowledgments

OpenCilk is supported in part by the National Science Foundation, under grant number CCRI-1925609, in part by the Department of Energy, National Nuclear Security Administration under Award Number DE-NA0003965, and in part by the USAF-MIT AI Accelerator, which is sponsored by United States Air Force Research Laboratory under Cooperative Agreement Number FA8750-19-2-1000.

Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and should not be interpreted as representing the official policies or views, either expressed or implied, of the United states Air Force, the U.S. Government, or the National Science Foundation. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein.