on aeb032a help sign in
Idris-dev/INSTALL.md
125 lines 4.5 kB history raw
1# Idris Installation Guide
3Copyright (C) 2015, The Idris Community
5## Installing Idris from Hackage
7This repository represents the latest development version of the
8language, and may contain bugs that are being actively worked on. For
9those who wish to use a more stable version of Idris please consider
10installing the latest version that has been released on Hackage.
11Installation instructions for various platforms can be
12[found on the Idris Wiki](https://github.com/idris-lang/Idris-dev/wiki/Installation-Instructions).
14## Installing Development Versions
16If you like to work against the latest development version, please
17consider using Cabal Sandboxes to minimise disruption to your local
18Haskell setup. Instructions for installing Idris HEAD within a cabal
19sandbox are
20[available on the Idris Wiki](https://github.com/idris-lang/Idris-dev/wiki/Installing-an-Idris-Development-version-in-a-sandbox).
22To configure, edit config.mk. The default values should work for most
23people.
25Idris is built using a Makefile common targets include:
27* `make` This will install everything using cabal and typecheck the
28 libraries.
29* `make test` This target execute the test suite.
30* `make relib` This target will typecheck and recompile the standard
31 library.
33Idris has an optional dependency on the `C` library `libffi`. If you
34would like to use the features that it enables, make sure that it is
35compiled for the same architecture as your Haskell compiler (e.g. 64
36bit libraries for 64 bit ghc). By default, Idris builds without it. To
37build with it, pass the flag `-f FFI`.
39A secondary optional dependency is on `libGMP`, this allows better
40support for numeric operations. As with `libFFI` Idris builds with out
41it, to enable `GMP` support use the flag `-f GMP`
43To build with `libffi` and `libGMP` by default, create a `custom.mk`
44file and add the following line to it:
46`CABALFLAGS += -f FFI -f GMP`
48The file `custom.mk-alldeps` is a suitable example.
50The continuous integration builds on travis-ci.org are built using the
51ghc-flag -Werror. To enable this behaviour locally also, please
52compile using `make CI=true` or adding the following line into
53`custom.mk`:
55`CI = true`
57If you are only compiling for installing the most current version, you
58can omit the CI flag, but please make sure you use it if you want to
59contribute.
61## Experimental Support for Building with Stack
63[Stack](https://github.com/commercialhaskell/stack) is a new
64cross-platform program for developing Haskell projects, that enhances
65the functionality provided by Cabal. There is experimental support for
66building Idris from source with stack.
68This installation has been tested on Ubuntu 16.04.1 LTS, and the current
69NixOS unstable.
71*Important* Stack will not install any external dependencies required
72to build Idris. Before you try stack please ensure you have the
73correct depenencies.
75To build Idris with stack use the following command:
77* `stack build`
79To install Idris:
81* `stack install`
83Stack will install Idris (and related executables) into `$HOME/.local/bin/`
84on Unix based systems and an appropriate place on Windows.
86Of note: If you haven't used stack before commands will also setup the
87related infrastructure. For more information about Stack please visit
88the [Stack website](https://github.com/commercialhaskell/stack).
90On NixOS, please use the following command instead, to make sure
91the required libraries and header files are available:
93* `stack build --nix`
95### before rebuilding new pulls
96the default build will currently just reuse `.ibc` files which can result
97in build-failures in the `Building libraries...` phase.
99A safer way to do this is therefore to recursively delete all the `*.ibc`
100files from the `libs/` folder.
102On Linux(or similar) you can do this with
104 find . -name "*.ibc" -exec rm -rf {} \;
106### System GHC
108The flag `--system-ghc` can be added to enforce use of your system's
109version of GHC.
111### `libGMP` and `libFFI`
113By default the stack configuration in `stack.yaml` will build with
114support for `libGMP` and `libFFI`. To turn this support off, the
115option flags needs to be fully commented out.
117There have been reports in the past over building Idris on Mac OS X,
118using stack, and linking to a HomeBrew installation of `libFFI`. The
119build has failed to find the correct `libFFI` installation. If you
120encounter this then the fix is to augment the `PKG_CONFIG_PATH` for
121`libFFI`. For example:
123```
124PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig stack build
125```