1. Nicholas Tung
  2. sketch-frontend


Clone wiki

sketch-frontend / Installation


Easy to install tar-ball

The easiest way to install Sketch is to download this tar-ball corresponding to the latest stable release of sketch:


The README inside the file contains the detailed instructions to build and set up the synthesizer. The instructions below are for people who want to build directly from the repository, but they require a bit more setup than building from the standard release.

Install from source

The following programs and packages are required to run and build Sketch from the source code. If you are one of the supported platforms and just want to run Sketch, then we suggest using the binaries or one-click installers.

Dependencies - Linux (OpenSuSE, Ubuntu, Fedora, Debian, Mandrivia)

  • Install Maven. Make sure you have 2.2.1 or later (even 2.2.0 does not work).
    • add Maven's bin folder to your PATH
  • Install C++ compilers and Mercurial. For OpenSuSE, run
sudo zypper install -t pattern "devel_C_C++" "devel_java"
sudo zypper install java-1_6_0-openjdk-devel mercurial
  • For Ubuntu, run
sudo aptitude install build-essential autoconf libtool flex bison mercurial zsh

(You can use bash instead of zsh if you want.)

Dependencies - Windows

  • Install Java, as above.
    • Add a JAVA_HOME variable, with the value of your Java installation directory, e.g. "C:\Program Files (x86)\Java\jdk1.6.0_18". Needed by maven (see below).
    • To add the environment variable, go to Start > "View advanced system settings" > "Environment Variables" > "System variables".
  • Install Maven. Make sure you have 2.2.1 or later (even 2.2.0 does not work).
    • Extract the files to wherever you want them. Add maven bin directory to PATH:
    • Append the path separator (";"), and then the "bin" directory of the extracted .zip to the Path variable.
    • Start the command prompt, and type "mvn -version" to make sure it installed correctly.
  • Start the Cygwin installer, select a mirror (e.g. anl.gov), click "View" so it changes to "Full", then start typing in the search box, and select the following packages: autoconf, automake, libtool, bash, bison, flex, gcc, gcc4, make, perl, zsh . The actual name of the package is in the rightmost column. Also, make sure you don't hit "enter" until after you have selected all the packages, since that will start the install.
  • Install Tortoise Hg (comes with Mercurial).

Dependencies - Mac

Download MacPorts, and install Mercurial with

sudo port -v install mercurial

Another option is Homebrew

brew install mercurial automake autoconf libtool maven


  • Check out the source code by cloning it from the repository. Note that there are two seperate repositories.
hg clone https://bitbucket.org/gatoatigrado/sketch-backend
hg clone https://bitbucket.org/gatoatigrado/sketch-frontend
  • Configure and compile the sketch-backend. Optionally replace the "2" on the last line with the number of cores your machine has. For Windows users, run the commands in the Cygwin shell (not in DOS).
cd sketch-backend
bash autogen.sh
make -j2
  • In some versions of linux you may get an error that says: ./configure: line 2715: syntax error near unexpected token `shared' ./configure: line 2715: `LT_INIT(shared static)' If you are getting this error, comment out the line that says LT_INIT in the ./configure file
  • The frontend will compile when you try to run something. You should be able to run Sketch to synthesize a program. For Windows users, run the following in the Cygwin shell. Try to the following command
cd ../sketch-frontend
make run-local-seq EXEC_ARGS="src/test/sk/seq/miniTest1.sk"

Local system installation

You should be able to install SKETCH by running this command from directory sketch-frontend

cd ../sketch-frontend
make system-install DESTDIR=/usr/bin SUDOINSTALL=1

Once you install, you will be able to use sketch by calling

$ sketch

from the command line

Running without installing

If you want to run without installing, you may want to create an alias for the above, by adding the following to ~/.bashrc or ~/.zshrc,

export SKETCH_HOME=~/<path to sketch-frontend>
function skdev () {
    export MAVEN_OPTS="-XX:MaxPermSize=256m -Xms40m -Xmx600m -ea -server"
    mvn -o -f "${SKETCH_HOME}"/pom.xml -e compile exec:java \
      -Dexec.mainClass=sketch.compiler.main.seq.SequentialSketchMain \

Using the Backend Extensions

Instructions at https://docs.google.com/document/pub?id=1sr_VA922fuHDvs4lHHAW-R1NsSX_1L1bq3NKFtX4Rbg .

Advanced building

Please see the Development Building page for information about how to build packages containing (a) sketch launcher scripts (b) a hybrid Java binary / C++ source, which helps for running SKETCH on servers.