Wiki

Clone wiki

sketch-frontend / Installation

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:

http://people.csail.mit.edu/asolar/sketch-1.6.4.tar.gz

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 source, 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

Building

  • 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
./configure
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 \
      -Dexec.args="$*"
}

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.

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.