2020-05-18 16:45:12 +03:00
|
|
|
Installing
|
|
|
|
==========
|
|
|
|
|
2020-05-28 22:06:35 +03:00
|
|
|
The easiest way to install is via the existing generated Scheme code.
|
|
|
|
The requirements are:
|
2020-05-20 00:56:27 +03:00
|
|
|
|
2020-05-28 22:06:35 +03:00
|
|
|
* A Scheme compiler; either Chez Scheme (default), or Racket.
|
|
|
|
* `bash`, with `realpath`. On Linux, you probably already have this.
|
|
|
|
On a Mac, you can install this with `brew install coreutils`.
|
2020-05-20 00:56:27 +03:00
|
|
|
|
|
|
|
On Windows, it has been reported that installing via `MSYS2` works
|
2020-06-02 05:30:44 +03:00
|
|
|
(https://www.msys2.org/). On Windows older than Windows 8, you may need to
|
|
|
|
set an environment variable `OLD_WIN=1` or modify it in `config.mk`.
|
|
|
|
|
|
|
|
On Raspberry Pi, you can bootstrap via Racket.
|
2020-05-20 00:56:27 +03:00
|
|
|
|
|
|
|
By default, code generation is via Chez Scheme. You can use Racket instead,
|
2020-05-23 20:40:57 +03:00
|
|
|
by setting the environment variable `IDRIS2_CG=racket` before running `make`.
|
2020-05-28 22:06:35 +03:00
|
|
|
If you install Chez Scheme from source files, building it locally,
|
|
|
|
make sure you run `./configure --threads` to build multithreading support in.
|
2020-05-20 00:56:27 +03:00
|
|
|
|
2020-05-20 13:40:01 +03:00
|
|
|
1: Set the PREFIX
|
2020-05-18 23:10:37 +03:00
|
|
|
-----------------
|
2020-05-18 16:43:12 +03:00
|
|
|
|
2020-05-20 12:31:30 +03:00
|
|
|
* Change the `PREFIX` in `config.mk`. The default is to install in
|
2020-05-20 16:17:06 +03:00
|
|
|
`$HOME/.idris2`
|
2020-05-18 16:43:12 +03:00
|
|
|
|
2020-05-20 16:56:48 +03:00
|
|
|
If you have an existing Idris 2, go to the alternative Step 2. Otherwise, read on...
|
2020-05-18 16:43:12 +03:00
|
|
|
|
2020-05-19 18:24:23 +03:00
|
|
|
Make sure that:
|
|
|
|
|
|
|
|
* `$PREFIX/bin` is in your `PATH`
|
2020-05-20 12:31:30 +03:00
|
|
|
* `$PREFIX/lib` is in your `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` if on
|
|
|
|
`macOS` (so that the system knows where to look for library support code)
|
2020-05-19 18:24:23 +03:00
|
|
|
|
2020-05-20 13:40:01 +03:00
|
|
|
2: Installing without an existing Idris 2
|
2020-05-18 16:43:12 +03:00
|
|
|
------------------------------------------
|
|
|
|
|
2020-05-20 16:56:48 +03:00
|
|
|
If you *don't* have [Idris-2-in-Idris-1](https://github.com/edwinb/Idris2-boot) installed, you can build from pre-built
|
2020-05-20 00:56:27 +03:00
|
|
|
Chez Scheme source, as long as you have Chez Scheme installed (or,
|
|
|
|
alternatively, Racket). To do this, enter one of the following:
|
2020-05-18 18:02:30 +03:00
|
|
|
|
2020-05-19 23:05:52 +03:00
|
|
|
* `make bootstrap SCHEME=chez`
|
2020-05-20 00:56:27 +03:00
|
|
|
* `make bootstrap-racket`
|
2020-05-18 16:43:12 +03:00
|
|
|
|
2020-05-19 23:05:52 +03:00
|
|
|
`chez` is the executable name of the Chez Scheme compiler. You may need to
|
2020-05-18 16:43:12 +03:00
|
|
|
replace this with the executable for Chez Scheme on your system. This could be
|
2020-05-19 23:05:52 +03:00
|
|
|
`scheme`, `chezscheme` or `chezscheme9.5` or something else, depending on your
|
|
|
|
system and the Chez Scheme version.
|
2020-05-18 16:43:12 +03:00
|
|
|
|
|
|
|
This builds an Idris 2 compiler from scheme code output from a working Idris 2
|
|
|
|
compiler (which isn't necessarily up to date, but is up to date enough to
|
2020-05-20 12:38:56 +03:00
|
|
|
build the current repository). It then rebuilds using the result, and runs
|
|
|
|
the tests.
|
2020-05-19 01:31:25 +03:00
|
|
|
|
2020-05-20 12:38:56 +03:00
|
|
|
If all is well, to install, type:
|
2020-05-18 20:02:56 +03:00
|
|
|
|
2020-05-18 23:10:37 +03:00
|
|
|
* `make install`
|
2020-05-18 20:02:56 +03:00
|
|
|
|
2020-05-20 13:40:01 +03:00
|
|
|
(Alternative 2: Installing with an existing Idris 2)
|
|
|
|
----------------------------------------------------
|
2020-05-18 16:43:12 +03:00
|
|
|
|
2020-05-20 13:40:01 +03:00
|
|
|
If you have [Idris-2-in-Idris-1](https://github.com/edwinb/Idris2-boot)
|
2020-05-28 22:06:35 +03:00
|
|
|
installed:
|
2020-05-18 16:43:12 +03:00
|
|
|
|
2020-05-20 15:31:04 +03:00
|
|
|
* `make all IDRIS2_BOOT=idris2boot`
|
|
|
|
* `make install IDRIS2_BOOT=idris2boot`
|
|
|
|
|
|
|
|
If you have an earlier version of this Idris 2 installer
|
|
|
|
|
|
|
|
* `make all`
|
|
|
|
* `make install`
|
2020-05-18 16:43:12 +03:00
|
|
|
|
2020-05-20 13:40:01 +03:00
|
|
|
3: (Optional) Self-hosting step
|
|
|
|
-------------------------------
|
2020-05-18 16:43:12 +03:00
|
|
|
|
2020-05-20 13:40:01 +03:00
|
|
|
As a final step, you can rebuild from the newly installed Idris 2 to verify
|
2020-05-20 16:17:06 +03:00
|
|
|
that everything has worked correctly. Assuming that `idris2` is in your
|
2020-05-20 13:40:01 +03:00
|
|
|
`PATH`.
|
2020-05-18 16:43:12 +03:00
|
|
|
|
|
|
|
* `make clean` -- to make sure you're building everything with the new version
|
2020-05-20 15:31:04 +03:00
|
|
|
* `make all && make install`
|
2020-05-18 16:43:12 +03:00
|
|
|
|
2020-05-20 13:40:01 +03:00
|
|
|
4: Running tests
|
|
|
|
----------------
|
2020-05-19 21:52:31 +03:00
|
|
|
|
|
|
|
After `make all`, type `make test` to check everything works. This uses the
|
|
|
|
executable in `./build/exec`.
|
2020-05-20 18:38:46 +03:00
|
|
|
|
|
|
|
5: (Optional) Installing the Idris 2 API
|
|
|
|
----------------------------------------
|
|
|
|
|
|
|
|
You'll only need this if you're developing support tools, such as an external
|
|
|
|
code generator. To do so, once everything is successfully installed, type:
|
|
|
|
|
|
|
|
* `make install-api`
|
|
|
|
|
|
|
|
The API will only work if you've completed the self-hosting step, step 3, since
|
|
|
|
the intermediate code versions need to be consistent throughout.
|