Code Monkey home page Code Monkey logo

futhark's Introduction

Futhark

Futhark is a purely functional data-parallel programming language. Its optimising compiler is able to compile it to typically very performant GPU code. The language and compiler is developed as part of the HIPERFIT project at DIKU. The project is still research-quality, and the focus has mostly been on ensuring high runtime-performance, so the source language still lacks many niceties for manual programming - it is fairly usable as a target for high-level code generation, however.

For more information, see the website.

The incomplete documentation is here.

Installation

You are strongly recommended to use Stack for building the Futhark compiler from scratch. It avoids many of the problems usually associated with the older Haskell build tool, cabal-install. This section describes how to use Stack.

To get all the prerequisites for building the Futhark compiler (including, if necessary, the appropriate version of the Haskell compiler), run:

stack setup

Note that this will not install anything system-wide and will have no effect outside the Futhark build directory. Now you can run the following command to build the Futhark compiler, including all dependencies:

stack build

The Futhark compiler and its tools will now be built. You can install it to your $HOME/.local/bin by running:

stack install

Make sure this directory is in your $PATH. Alternatively, just copy the binaries where you need them.

Installation with cabal-install

Using Stack, as described in the previous section, is strongly recommended.

You will need GHC 7.8 or newer and a recent version of Alex to compile Futhark.

Just run cabal install and executables by the names of futhark, futhark-c, futhark-opencl and futharki will be installed in your Cabal bin directory, most likely $HOME/.cabal/bin.

Otherwise, just run cabal configure, followed by cabal build, and the executable can be found in dist/build/futhark/futhark.

You can get a sufficiently new version of Alex by running cabal install alex if $HOME/.cabal/bin is in your $PATH. If you accidentally try (and fail) to install Futhark with an older version of Alex, you will need to run cabal clean to ensure that the broken build artifacts will not interfere with the new build.

Make sure that you have a recent Cabal to go with your GHC. A common mistake is to only upgrade GHC, but use an old Cabal (i.e. older than 1.20; check with cabal --version). If you compile some of the dependencies with an old Cabal by mistake, and then fail later in the process, you will have to delete your ~/.ghc directory to remove the broken libraries.

Usage

To compile a Futhark program to sequential C:

futhark-c prog.fut -o prog

Or maybe OpenCL:

futhark-opencl prog.fut -o prog

And then run it:

./prog < prog.input

To interpret a Futhark program:

futharki prog.fut < prog.input

Hacking

We try to make use of Github issues for organising our work.

For every commit, Futhark is automatically built and tested on Travis.

Build Status

Testing

Run the data/runtests.sh script to check how well we're doing. Use data/runtests.sh -t if you're in a hurry and only want the test suite to do type checking.

futhark's People

Contributors

athas avatar brunsgaard avatar coancea avatar jberthold avatar maccam912 avatar melsman avatar nqpz avatar oleks avatar rasmuswl avatar svip avatar tayacan avatar waffle-iron avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.