Install OpenCilk
System requirements
OpenCilk 2.0 runs on Intel x86 64-bit processors (Haswell and newer), AMD x86 64-bit processors (Excavator and newer), and Apple M1 and other 64-bit ARM processors. It has been tested on the following operating systems:
- Ubuntu (18.04, 20.04, 22.04), including via WSL2 (Windows Subsystem for Linux 2)
- FreeBSD (13)
- Fedora (34, 36)
- macOS (10.15, 11.6, 12.4)
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.0 can be installed in several ways:
- Using a shell archive (
.sh
) built for the target hardware and operating system. - Using a tarball (
.tar.gz
) built for the target hardware and operating system. - Using a docker image.
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.0 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:
- OpenCilk-2.0.0-x86_64-Linux-Ubuntu-20.04.sh (764 MB)
- OpenCilk-2.0.0-x86_64-Linux-Ubuntu-22.04.sh (782 MB)
macOS:
- OpenCilk-2.0.0-arm64-Apple-Darwin.sh (695 MB)
- OpenCilk-2.0.0-x86_64-Apple-Darwin.sh (767 MB)
Install
Execute the shell script to extract OpenCilk 2.0 into the current directory. For example:
$ sh OpenCilk-2.0.0-x86_64-Linux-Ubuntu-20.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 20.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.0.0-x86_64-Linux-Ubuntu-20.04.sh --prefix=/opt/opencilk --exclude-subdir
OpenCilk Installer Version: 2.0.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
andclang++
to point to the OpenCilk C and C++ compilers. This can be achieved in numerous ways, such as by setting yourPATH
environment variable to look in/opt/opencilk/bin/
or by installing system-wide symbolic links.
Installing using a tarball
To install OpenCilk 2.0 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:
- OpenCilk-2.0.0-x86_64-Linux-Ubuntu-20.04.tar.gz (764 MB)
- OpenCilk-2.0.0-x86_64-Linux-Ubuntu-22.04.tar.gz (782 MB)
macOS:
- OpenCilk-2.0.0-arm64-Apple-Darwin.tar.gz (695 MB)
- OpenCilk-2.0.0-x86_64-Apple-Darwin.tar.gz (767 MB)
Install
Extract OpenCilk 2.0 from the downloaded tarball. For example:
$ tar xvzf OpenCilk-2.0.0-x86_64-Linux-Ubuntu-20.04.tar.gz
will extract the OpenCilk installation into a subdirectory
OpenCilk-2.0.0-x86_64-Linux-Ubuntu-20.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.0 is also available as a docker image based on Ubuntu 20.04. You can download the docker image here:
- docker-opencilk-v2.0.tar.gz (1.05 GB)
The OpenCilk C and C++ compilers are available as clang
and clang++
in the
image. To use the OpenCilk 2.0 Docker image, download the
docker-opencilk-v2.0.tar.gz
file, load the image, and run a container. For
example:
$ docker load -i docker-opencilk-v2.0.tar.gz
$ docker run -it opencilk:v2.0 /bin/bash
Next steps
The OpenCilk 2.0 installation includes LLVM 14 with the following OpenCilk components:
- OpenCilk compiler (with the
clang
andclang++
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.