The recommend way to build and install the development version of Accelerate is to use the
stack build tool. This will automatically pull in other in-development Accelerate packages from GitHub, as well as dependencies from Hackage.
stack can also be used to download and install an appropriate version of GHC. Instructions and downloads for installing
stack are available for several operating systems and distributions on the haskellstack.org website.
Note that you will still need to install necessary external libraries, such as LLVM, as described on the getting started page.
For example, to build the development version of the LLVM backends:
Download the sources for
git clone https://github.com/AccelerateHS/accelerate-llvm.git
We maintain stack configurations for several GHC releases. Change directory to the newly downloaded sources and tell
stack which version of GHC you would like to compile for by creating a symlink to the appropriate file named
stack.yaml. For example, to use GHC-8.0:
cd accelerate-llvm ln -s stack-8.0.yaml stack.yaml
If you wish to make any changes to the build configuration, now is a good time to open the
stack.yaml file in a text editor and make the necessary changes. For example:
If you do not have a CUDA capable GPU, you will not be able to build the
accelerate-llvm-ptx package, in which case it is worthwhile commenting that out from the
You can enable (or disable) building the Accelerate packages with extra debugging information by changing the
flags: stanza at the bottom of the file.
Allow stack to fetch any prerequisites, including an appropriate version of GHC if necessary:
Build the LLVM backends:
If you want to load the sources into
ghci, use the command
stack exec ghci.