Install OpenCilk

System requirements

OpenCilk 2.1 runs on Intel x86 64-bit processors (Haswell and newer), AMD x86 64-bit processors (Excavator and newer), and various 64-bit ARM processors, including Apple M1 and M2. It has been tested on the following operating systems:

  • Recent versions of Ubuntu, including via the Windows Subsystem for Linux v2 (WSL2) on Windows 10
  • Recent versions of macOS
  • FreeBSD 13
  • Recent versions of Fedora

Prerequisites:

The OpenCilk binaries assume that system header files and system libraries are already installed on the system.

  • On Linux, we recommend installing GCC (or equivalent) to provide these necessary system files.
  • On macOS, you must install XCode or the XCode Command Line Tools to get the necessary system files.

Methods of installation

Precompiled binaries for OpenCilk 2.1 can be installed in several ways:

You can also build OpenCilk from source, which is the recommended approach for Ubuntu 18.04 and other operating systems for which precompiled binaries are not available.

Installing using a shell archive

To install OpenCilk 2.1 using a shell archive, first download the appropriate shell archive for your system, then follow the installation instructions.

Download

Download the appropriate shell archive for your system using one of the following links:

Linux:

macOS:

Install

Execute the shell script to extract OpenCilk 2.1 into the current directory. For example:

$ sh opencilk-2.1.0-x86_64-linux-gnu-ubuntu-22.04.sh

You will be prompted to accept the OpenCilk license and whether or not to append a version-specific subdirectory to the installation prefix (by default the current directory).

Optionally, you can select a different installation directory by passing the option --prefix=/path/to/install/dir to the script. (You will need to make sure that installation directory exists before running the shell archive with --prefix.) To see all options, pass the --help argument to the script.

The OpenCilk C (or C++) compiler can be invoked via bin/clang (or bin/clang++) from within the installation directory. Optionally, you can configure your system so that clang and clang++ point to the OpenCilk C and C++ compilers (e.g., by setting your PATH environment variable or installing system-wide symbolic links).

Example:

The following example shows the process on Ubuntu 22.04 to install OpenCilk into /opt/opencilk without adding a version-specific subdirectory. The installation and setup process is analogous for macOS and other Linux systems.

  • Download the precompiled OpenCilk shell archive for your system.
  • Make directory /opt/opencilk if it does not already exist, and execute the shell script to install OpenCilk into the directory.
$ mkdir -p /opt/opencilk
$ sh opencilk-2.1.0-x86_64-linux-gnu-ubuntu-22.04.sh --prefix=/opt/opencilk --exclude-subdir
OpenCilk Installer Version: 2.1.0, Copyright (c) OpenCilk
This is a self-extracting archive.
The archive will be extracted to: /opt/opencilk 
Using target directory: /opt/opencilk
Extracting, please wait... 
Unpacking finished successfully
  • The OpenCilk C/C++ compiler can now be run as /opt/opencilk/bin/clang or /opt/opencilk/bin/clang++.
  • Optionally, set clang and clang++ to point to the OpenCilk C and C++ compilers. This can be achieved in numerous ways, such as by setting your PATH environment variable to look in /opt/opencilk/bin/ or by installing system-wide symbolic links.

Installing using a tarball

To install OpenCilk 2.1 using a tarball, first download the appropriate tarball for your system, then follow the installation instructions.

Download

Download the appropriate tarball for your system using one of the following links:

Linux:

macOS:

Install

Extract OpenCilk 2.1 from the downloaded tarball. For example:

$ tar xvzf opencilk-2.1.0-x86_64-linux-gnu-ubuntu-22.04.tar.gz

will extract the OpenCilk installation into a subdirectory opencilk-2.1.0-x86_64-linux-gnu-ubuntu-22.04/ within the current working directory.

Note:

Extracting the tarball as above is equivalent to running the corresponding shell archive with options --skip-license --include-subdir. Installing using this method, or by passing --skip-license to the shell archive, implies that you accept OpenCilk's software license.

Docker image

OpenCilk 2.1 is also available as a docker image based on Ubuntu 22.04. You can download the docker image here:

The OpenCilk C and C++ compilers are available as clang and clang++ in the image. To use the OpenCilk 2.1 Docker image, download the docker-opencilk-v2.1.tar.gz file, load the image, and run a container. For example:

$ docker load -i docker-opencilk-v2.1.tar.gz
$ docker run -it opencilk:v2.1 /bin/bash

Next steps

The OpenCilk 2.1 installation includes LLVM 16 with the following OpenCilk components:

  • OpenCilk compiler (with the clang and clang++ front-ends)
  • OpenCilk runtime library
  • Cilksan race detector
  • Cilkscale scalability analyzer and visualization script

See Getting started for steps to verify that your installation is working and to start using OpenCilk.