The easiest way to install is via the existing generated Scheme code. The requirements are:
GMP. On Linux, you probably already have these. On macOS and major BSD flavours, you can install them using a package manager: for instance, on macOS, you can install with the
brew install coreutils gmpand on OpenBSD, with the
pkg_add coreutils bash gmake gmpcommand. You specifically need the dev GMP library, which means on some systems the package you need to install will be named something more like
On Windows, it has been reported that installing via
MSYS2. On Windows older than Windows 8, you may need to
set an environment variable
OLD_WIN=1 or modify it in
On Raspberry Pi, you can bootstrap via Racket.
By default, code generation is via Chez Scheme. You can use Racket instead,
by setting the environment variable
IDRIS2_CG=racket before running
If you install Chez Scheme from source files, building it locally,
make sure you run
./configure --threads to build multithreading support in.
NOTE: On FreeBSD, OpenBSD and NetBSD you need to use
gmake command instead
make in the following steps.
NOTE: If you're running macOS on Apple Silicon (arm64) you may need to run
arch -x86_64 make ..." instead of
make in the following steps.
config.mkto the absolute path of your chosen installation destination. The default is to install in
If you have an existing Idris 2, go to Step 3. Otherwise, read on...
Make sure that:
$PREFIX/binis in your
$PREFIX/libis in your
macOS(so that the system knows where to look for library support code)
You can build from pre-built Chez Scheme source, as long as you have Chez Scheme installed (or, alternatively, Racket). To do this, enter one of the following:
make bootstrap SCHEME=chez
chez is the executable name of the Chez Scheme compiler. You may need to
replace this with the executable for Chez Scheme on your system. This could be
chezscheme9.5 or something else, depending on your
system and the Chez Scheme version.
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 build the current repository). It then rebuilds using the result, and runs the tests.
If all is well, to install, type:
If you have the latest released version of Idris 2 (0.4.0 at the time of writing) installed:
make install, type
make install-libdocs to install Idris 2 library documentation. After
that, the index file can be found here:
As a final step, you can rebuild from the newly installed Idris 2 to verify
that everything has worked correctly. Assuming that
idris2 is in your
make clean-- to make sure you're building everything with the new version
make all && make install-- OR
make all IDRIS2_BOOT='idris2 --codegen racket' && make installif using Racket.
make all, type
make test to check everything works. This uses the
If you are working on Idris, incremental compilation means that rebuilds are
much faster, at the cost of runtime performance being slower. To enable
incremental compilation for the Chez back end, set the environment variable
IDRIS2_INC_CGS=chez, or set the
--inc chez flag in
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:
The API will only work if you've completed the self-hosting step (step 5), since
the intermediate code versions need to be consistent throughout. Otherwise, you
will get an
Error in TTC: TTC data is in an older format error.
Idris2 supports tab auto-completion for Bash-like shells.
From within bash, run the following command:
eval "$(idris2 --bash-completion-script idris2)"
You can also add it to your
From within ZSH, run the following commands:
autoload -U +X compinit && compinit autoload -U +X bashcompinit && bashcompinit eval "$(idris2 --bash-completion-script idris2)"
You can also add them to your
If you get the message
variable make-thread-parameter is not bound while
bootstrapping via Chez Scheme, or while running the tests when bootstrapping via
Racket, then your copy of Chez Scheme was built without thread support. Pass
./configure while building Chez Scheme to correct the issue.
If you are Homebrew user you can install Idris 2 together with all the requirements by running the following command:
brew install idris2
If you are a nix user you can install Idris 2 together with all the requirements by running the following command:
nix-env -i idris2
If you are a nix flakes user you can install Idris 2 together with all the requirements by running the following command:
nix profile install github:idris-lang/Idris2
If you are a nix flakes user you can run Idris 2 in emacs by running the following command:
nix run github:idris-lang/Idris2#emacs-with-idris idrisCode.idr