Wiki

Clone wiki

docs / Downloads

Installation Instructions

Getting help

If you need any help or find a problem, please email Ishan Bhargava

Ubuntu and other Debian-based Linux distributions

  • Download the package and install it.

         > wget https://c0.cs.cmu.edu/downloads/cc0-debian.deb
         > sudo apt install ./cc0-debian.deb
    
    where > is your local terminal prompt.

  • To uninstall, run

         > sudo apt remove cc0
    

MacOS

Apple Silicon/ARM Macs

In the instructions below, replace <your_username> with your actual username on your Mac.

  • Install a Universal version of libgmp using MacPorts:
    sudo port install gmp +universal
    
  • Download two versions of MLTon:
    • Darwin amd64 with statically-linked GMP
    • Source code
  • Compile the MLTon source code, using the amd64 statically-linked version of mlton from mlton.org:
    cd /Users/<your_username>/Downloads/mlton-src
    env PATH=/Users/<your_username>/tmp/mlton-amd64/bin:$PATH LIBRARY_PATH=/opt/local/lib/ C_INCLUDE_PATH=/opt/local/include/ make WITH_GMP_DIR=/opt/local
    
  • Install the CC0 dependencies using Homebrew
    brew install autoconf automake libpng pkg-config gnu-getopt
    
  • Now we can download and compile CC0 by passing the appropriate location to libgmp and the version of MLTon we compiled from scratch:
    git clone https://bitbucket.org/c0-lang/c0.git
    cd c0/cc0/
    ./configure
    env PATH=/Users/<your_username>/tmp/mlton/mlton/build/bin:$PATH LIBRARY_PATH=/opt/local/lib/ C_INCLUDE_PATH=/opt/local/include/  make -j
    
  • Then bin/cc0 and bin/coin can be used normally. You can create links to these files from some directory on your $PATH

Intel/x86 Macs

  • Run

         > brew tap cmu/cc0 https://bitbucket.org/c0-lang/downloads.git
         > brew install cc0
    
    where > is your local terminal prompt.

  • To test the installation:

         > brew test cc0
    

  • To uninstall, run

         > brew uninstall cc0
    

Windows

On Windows, we recommend installing Windows Subsystem for Linux v2 and then following the directions for Ubuntu/Debian above

Installing from source

C0 depends on libpng and libncurses. If you have those installed (e.g. via a package manager), you should be able to compile from scratch:

     > git clone https://bitbucket.org/c0-lang/c0.git
     > cd c0/cc0
     > ./configure
     > make -j
     > make install PREFIX=<your prefix>

Other Systems are Supported via Docker

  • Download Docker for your OS from https://docs.docker.com/get-docker/ and install it by following the instructions at https://docs.docker.com/get-started/ (you don't need to go to the next tutorial; you just need "hello world" to work).

  • Download the Dockerfile and do the one-time setup by running

         > wget https://c0.cs.cmu.edu/downloads/Dockerfile
         > docker build -t c0 .
    
    where > is your local terminal prompt (the second command may take a while).

  • On your first invocation of docker, run

         > docker run --name=c0_container -v <PATH_TO_C0_FILES>:/my_c0_dir -w /my_c0_dir -it c0
    
    where <PATH_TO_C0_FILES> is where the files you are trying to run are. Once in docker, run cc0 or coin as you would on any Linux system. Once you are done, enter
         # exit
    
    to exit docker (where # is the docker prompt).

  • On subsequent invocations, run

         > docker start -i c0_container
    

  • You can remove the container c0_container by running

         > docker container ls -a | grep c0
         > docker container rm [container_id]
    
    where [container_id] is the first field of the first command

Older versions

We provide older versions only as 64-bit Linux binaries.

Updated