2019-06-24 15:05:19 +03:00
|
|
|
# Installation
|
|
|
|
|
2020-03-05 20:12:58 +03:00
|
|
|
Idris 2 is built using Idris, and provides support for two default code
|
2020-05-02 07:05:36 +03:00
|
|
|
generation targets: Chez Scheme, Racket, and Gambit. To build from source, it requires
|
2020-04-15 23:58:08 +03:00
|
|
|
at least Idris version 1.3.2 (see https://www.idris-lang.org/pages/download.html). You
|
2020-03-05 20:12:58 +03:00
|
|
|
can also build from the generated C.
|
|
|
|
|
|
|
|
## Quick summary:
|
|
|
|
|
|
|
|
You need a C compiler (default is clang) and Chez Scheme, and optionally
|
|
|
|
Idris 1.3.2 to build from source.
|
|
|
|
|
|
|
|
* If you have Idris 1.3.2 installed:
|
|
|
|
|
|
|
|
make install
|
|
|
|
|
|
|
|
* If not, and the generated C is available in `dist`, you can install directly
|
|
|
|
from the generated C:
|
|
|
|
|
|
|
|
make install-fromc
|
|
|
|
|
|
|
|
The generated C is available in source distributions. It will not be available
|
|
|
|
if you have cloned directly from https://github.com/edwinb/Idris2
|
|
|
|
|
|
|
|
The above commands will build the executable, build the libraries, run the
|
|
|
|
tests (if Idris 1 is available), then if all is well, install everything. The
|
|
|
|
default installation directory is `$HOME/.idris2`. You can change this by
|
2020-05-16 19:35:55 +03:00
|
|
|
setting the `PREFIX` variable in `config.mk`.
|
2019-06-24 15:05:19 +03:00
|
|
|
|
2020-03-30 15:06:59 +03:00
|
|
|
Other settings you can change in the `Makefile` are:
|
|
|
|
|
|
|
|
* `OPT` which sets the optimisation level for compiling the generated C. Leave
|
|
|
|
this blank for Idris 2 to build sooner, or set it to `-O2` for a faster
|
|
|
|
Idris 2 compiler. `-O2` takes a few minutes!
|
|
|
|
* `CC` which sets the C compiler to use. `clang` is the default, but `gcc`
|
|
|
|
always works. `clang` generates code faster.
|
|
|
|
|
2019-06-24 15:05:19 +03:00
|
|
|
## Idris
|
|
|
|
|
|
|
|
There are several sets of instructions on how to install Idris from source and
|
|
|
|
binary.
|
|
|
|
|
2019-12-18 23:37:50 +03:00
|
|
|
+ [Official ipkg installer for macOS](https://www.idris-lang.org/pkgs/idris-current.pkg)
|
2019-06-24 15:05:19 +03:00
|
|
|
+ [Source build instructions from the Idris GitHub Wiki](https://github.com/idris-lang/Idris-dev/wiki/Installation-Instructions)
|
|
|
|
+ [Binary installation using Cabal from the Idris Manual](https://idris.readthedocs.io/en/latest/tutorial/starting.html)
|
|
|
|
|
|
|
|
## Code Generation Targets
|
|
|
|
|
|
|
|
Only one of these is absolutely necessary, and you can type check code even
|
|
|
|
with none of them installed. The default code generator targets Chez Scheme.
|
|
|
|
|
|
|
|
### Chez
|
|
|
|
|
|
|
|
Chez Scheme is available to build from source:
|
|
|
|
|
|
|
|
+ https://cisco.github.io/ChezScheme/
|
|
|
|
|
2019-08-21 02:24:23 +03:00
|
|
|
Many popular package managers will provide a binary distribution for Chez. Note
|
|
|
|
that homebrew for Mac OS X provides a version without multithreading support, so
|
|
|
|
Mac OS X users will want to build from source.
|
2019-06-24 15:05:19 +03:00
|
|
|
|
2019-07-10 16:18:45 +03:00
|
|
|
**Note**: If you install ChezScheme from source files, building it locally, make sure
|
|
|
|
you run `./configure --threads` to build multithreading support in.
|
|
|
|
|
2019-06-24 15:05:19 +03:00
|
|
|
### Racket
|
|
|
|
|
|
|
|
Racket is available from:
|
|
|
|
|
|
|
|
+ https://download.racket-lang.org/
|
2020-04-22 18:24:50 +03:00
|
|
|
|
|
|
|
The following packages are required in order to run Idris:
|
|
|
|
|
|
|
|
- base
|
|
|
|
- racket-lib
|
|
|
|
- compiler-lib
|
|
|
|
- r6rs-lib
|
|
|
|
- math-lib
|
|
|
|
|
|
|
|
These can be installed with `raco setup` and `raco pkg install`.
|
2020-05-02 07:05:36 +03:00
|
|
|
|
|
|
|
### Gambit
|
|
|
|
|
|
|
|
Gambit Scheme offers binary releases and source tarballs on
|
|
|
|
http://gambitscheme.org.
|
|
|
|
|
|
|
|
GNU/Linux users can usually find a package on their distribution under one of
|
|
|
|
the following names: `gambit`, `gambit-c` or `gambc`.
|
|
|
|
|
|
|
|
The default backend of Gambit is C, so you are expected to have a C compiler
|
|
|
|
(GCC preferred).
|