Building Idris2 for Apple silicon as of August 2022

This page summarizes the projects mentioned and recommended in the original post on /r/Idris

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • ChezScheme

    Chez Scheme

  • This is an update on building Idris2 for `arm64` Apple silicon. My original guide was posted here a year ago: [Success building native Idris2 on an M1 Mac](https://www.reddit.com/r/Idris/comments/pc5lib/success\_building\_native\_idris2\_on\_an\_m1\_mac/) Some issues I encountered may get fixed, so these notes may best serve as guidance, as others work through this install in the future. I no longer have any Intel Apple machines in use. I am using MacOS Monterey 12.5.1, and a current homebrew installation that includes needed support such as gmp. I have successfully built idris2 on several M1 Mac minis, an M2 Macbook Air, and an M2 Ultra Mac Studio. These directions assume that you have read the install docs for Chez Scheme and Idris. ---- The official Cisco [Chez Scheme](https://github.com/cisco/ChezScheme) is still not `arm64` native. As before, one needs to install Racket's [fork](https://github.com/racket/ChezScheme/), which is `arm64` native and supports Idris2. Cloning the git repository and attempting to build, one encounters the error Source in "zuo" is missing; check out Git submodules using git submodule init git submodule update --depth 1 After these steps, the build is routine using the steps arch=tarm64osx ./configure --pb make ${arch}.bootquick ./configure --threads make sudo make install One can now confirm that `scheme` is `arm64` native using the command file $(which scheme) ---- The Idris 2 build was a delicate puzzle for me, harder than before. I got it to run by hand once, and then lost hours trying to recover what I did right by script. Here is a GitHub Gist for my install script: [Build script for Idris 2 on Apple silicon](https://gist.github.com/Syzygies/15cbaebd5d7a31630650b7a8436a8f1f) Here are the issues I encountered: Seven of the nine case statements involving ta6osx have had t `arm64`osx added, but not the remaining two. This threw me, as I imagined this had to be deliberate, and this was one of several problems that needed fixing. The bootstrap build creates a file `libidris2_support.dylib` but then can't find it later. One needs to attempt the bootstrap build twice, copying this file after the first attempt fails so that the second attempt will succeed. I copied this file everywhere needed, rather than to `/usr/local/lib` (homebrew doesn't like sharing a lane). The executable script itself can fail to find this `.dylib`, but the executable looks in the current working directory, so one could easily miss this during development. I also patch the executable so it changes into the executable's directory before calling it, where one of several identical copies of this `.dylib` can be found. `INSTALL.md` included the curious note **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. The correct way to read this is that the author isn't sure. In fact, following this instruction will create `libidris2_support.dylib` with the wrong architecture, as I verified with a matrix of experiments (this or not, edit last two case statements or not). What is the status of official Apple silicon support for Chez Scheme and Idris 2? Searching Cisco [Chez Scheme](https://github.com/cisco/ChezScheme) issues for `arm64` yields several open issues, including [Pull or Backport ARM64 Support from the Racket Backend Version #545](https://github.com/cisco/ChezScheme/issues/545) proposing to pull the Racket fork support for Apple Silicon. Searching pull requests for `arm64` yields [Apple Silicon support #607](https://github.com/cisco/ChezScheme/pull/607), which doesn't work. The author doesn't explain why they are making this effort, rather than pulling the Racket fork changes. Others note that the author also ignores prior art in their naming conventions. Searching [Idris 2](https://github.com/idris-lang/Idris2) issues for `arm64` yields [Racket cannot find libidris2_support on Mac M1 #1032](https://github.com/idris-lang/Idris2/issues/1032), noting the `.dylib` issue I address, and linking to [Clarify installation instructions on macOS (M1) #2233](https://github.com/idris-lang/Idris2/issues/2233) asking for better Apple silicon directions, which backlinks to my first [reddit post](https://www.reddit.com/r/Idris/comments/pc5lib/success\_building\_native\_idris2\_on\_an\_m1\_mac/). The other backlinks I could find are automated scrapes not of interest. There are no pull requests for `arm64`. I admire the Idris project and I want it to succeed. It needs macOS users. However, I'm unlikely to rely on Idris2 for my own work until parallelism is better supported. I'd love someone to change my mind if I'm misreading the situation.

  • ChezScheme

    Chez Scheme (by racket)

  • This is an update on building Idris2 for `arm64` Apple silicon. My original guide was posted here a year ago: [Success building native Idris2 on an M1 Mac](https://www.reddit.com/r/Idris/comments/pc5lib/success\_building\_native\_idris2\_on\_an\_m1\_mac/) Some issues I encountered may get fixed, so these notes may best serve as guidance, as others work through this install in the future. I no longer have any Intel Apple machines in use. I am using MacOS Monterey 12.5.1, and a current homebrew installation that includes needed support such as gmp. I have successfully built idris2 on several M1 Mac minis, an M2 Macbook Air, and an M2 Ultra Mac Studio. These directions assume that you have read the install docs for Chez Scheme and Idris. ---- The official Cisco [Chez Scheme](https://github.com/cisco/ChezScheme) is still not `arm64` native. As before, one needs to install Racket's [fork](https://github.com/racket/ChezScheme/), which is `arm64` native and supports Idris2. Cloning the git repository and attempting to build, one encounters the error Source in "zuo" is missing; check out Git submodules using git submodule init git submodule update --depth 1 After these steps, the build is routine using the steps arch=tarm64osx ./configure --pb make ${arch}.bootquick ./configure --threads make sudo make install One can now confirm that `scheme` is `arm64` native using the command file $(which scheme) ---- The Idris 2 build was a delicate puzzle for me, harder than before. I got it to run by hand once, and then lost hours trying to recover what I did right by script. Here is a GitHub Gist for my install script: [Build script for Idris 2 on Apple silicon](https://gist.github.com/Syzygies/15cbaebd5d7a31630650b7a8436a8f1f) Here are the issues I encountered: Seven of the nine case statements involving ta6osx have had t `arm64`osx added, but not the remaining two. This threw me, as I imagined this had to be deliberate, and this was one of several problems that needed fixing. The bootstrap build creates a file `libidris2_support.dylib` but then can't find it later. One needs to attempt the bootstrap build twice, copying this file after the first attempt fails so that the second attempt will succeed. I copied this file everywhere needed, rather than to `/usr/local/lib` (homebrew doesn't like sharing a lane). The executable script itself can fail to find this `.dylib`, but the executable looks in the current working directory, so one could easily miss this during development. I also patch the executable so it changes into the executable's directory before calling it, where one of several identical copies of this `.dylib` can be found. `INSTALL.md` included the curious note **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. The correct way to read this is that the author isn't sure. In fact, following this instruction will create `libidris2_support.dylib` with the wrong architecture, as I verified with a matrix of experiments (this or not, edit last two case statements or not). What is the status of official Apple silicon support for Chez Scheme and Idris 2? Searching Cisco [Chez Scheme](https://github.com/cisco/ChezScheme) issues for `arm64` yields several open issues, including [Pull or Backport ARM64 Support from the Racket Backend Version #545](https://github.com/cisco/ChezScheme/issues/545) proposing to pull the Racket fork support for Apple Silicon. Searching pull requests for `arm64` yields [Apple Silicon support #607](https://github.com/cisco/ChezScheme/pull/607), which doesn't work. The author doesn't explain why they are making this effort, rather than pulling the Racket fork changes. Others note that the author also ignores prior art in their naming conventions. Searching [Idris 2](https://github.com/idris-lang/Idris2) issues for `arm64` yields [Racket cannot find libidris2_support on Mac M1 #1032](https://github.com/idris-lang/Idris2/issues/1032), noting the `.dylib` issue I address, and linking to [Clarify installation instructions on macOS (M1) #2233](https://github.com/idris-lang/Idris2/issues/2233) asking for better Apple silicon directions, which backlinks to my first [reddit post](https://www.reddit.com/r/Idris/comments/pc5lib/success\_building\_native\_idris2\_on\_an\_m1\_mac/). The other backlinks I could find are automated scrapes not of interest. There are no pull requests for `arm64`. I admire the Idris project and I want it to succeed. It needs macOS users. However, I'm unlikely to rely on Idris2 for my own work until parallelism is better supported. I'd love someone to change my mind if I'm misreading the situation.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • Idris2

    A purely functional programming language with first class types

  • This is an update on building Idris2 for `arm64` Apple silicon. My original guide was posted here a year ago: [Success building native Idris2 on an M1 Mac](https://www.reddit.com/r/Idris/comments/pc5lib/success\_building\_native\_idris2\_on\_an\_m1\_mac/) Some issues I encountered may get fixed, so these notes may best serve as guidance, as others work through this install in the future. I no longer have any Intel Apple machines in use. I am using MacOS Monterey 12.5.1, and a current homebrew installation that includes needed support such as gmp. I have successfully built idris2 on several M1 Mac minis, an M2 Macbook Air, and an M2 Ultra Mac Studio. These directions assume that you have read the install docs for Chez Scheme and Idris. ---- The official Cisco [Chez Scheme](https://github.com/cisco/ChezScheme) is still not `arm64` native. As before, one needs to install Racket's [fork](https://github.com/racket/ChezScheme/), which is `arm64` native and supports Idris2. Cloning the git repository and attempting to build, one encounters the error Source in "zuo" is missing; check out Git submodules using git submodule init git submodule update --depth 1 After these steps, the build is routine using the steps arch=tarm64osx ./configure --pb make ${arch}.bootquick ./configure --threads make sudo make install One can now confirm that `scheme` is `arm64` native using the command file $(which scheme) ---- The Idris 2 build was a delicate puzzle for me, harder than before. I got it to run by hand once, and then lost hours trying to recover what I did right by script. Here is a GitHub Gist for my install script: [Build script for Idris 2 on Apple silicon](https://gist.github.com/Syzygies/15cbaebd5d7a31630650b7a8436a8f1f) Here are the issues I encountered: Seven of the nine case statements involving ta6osx have had t `arm64`osx added, but not the remaining two. This threw me, as I imagined this had to be deliberate, and this was one of several problems that needed fixing. The bootstrap build creates a file `libidris2_support.dylib` but then can't find it later. One needs to attempt the bootstrap build twice, copying this file after the first attempt fails so that the second attempt will succeed. I copied this file everywhere needed, rather than to `/usr/local/lib` (homebrew doesn't like sharing a lane). The executable script itself can fail to find this `.dylib`, but the executable looks in the current working directory, so one could easily miss this during development. I also patch the executable so it changes into the executable's directory before calling it, where one of several identical copies of this `.dylib` can be found. `INSTALL.md` included the curious note **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. The correct way to read this is that the author isn't sure. In fact, following this instruction will create `libidris2_support.dylib` with the wrong architecture, as I verified with a matrix of experiments (this or not, edit last two case statements or not). What is the status of official Apple silicon support for Chez Scheme and Idris 2? Searching Cisco [Chez Scheme](https://github.com/cisco/ChezScheme) issues for `arm64` yields several open issues, including [Pull or Backport ARM64 Support from the Racket Backend Version #545](https://github.com/cisco/ChezScheme/issues/545) proposing to pull the Racket fork support for Apple Silicon. Searching pull requests for `arm64` yields [Apple Silicon support #607](https://github.com/cisco/ChezScheme/pull/607), which doesn't work. The author doesn't explain why they are making this effort, rather than pulling the Racket fork changes. Others note that the author also ignores prior art in their naming conventions. Searching [Idris 2](https://github.com/idris-lang/Idris2) issues for `arm64` yields [Racket cannot find libidris2_support on Mac M1 #1032](https://github.com/idris-lang/Idris2/issues/1032), noting the `.dylib` issue I address, and linking to [Clarify installation instructions on macOS (M1) #2233](https://github.com/idris-lang/Idris2/issues/2233) asking for better Apple silicon directions, which backlinks to my first [reddit post](https://www.reddit.com/r/Idris/comments/pc5lib/success\_building\_native\_idris2\_on\_an\_m1\_mac/). The other backlinks I could find are automated scrapes not of interest. There are no pull requests for `arm64`. I admire the Idris project and I want it to succeed. It needs macOS users. However, I'm unlikely to rely on Idris2 for my own work until parallelism is better supported. I'd love someone to change my mind if I'm misreading the situation.

  • idris2-pack

  • An alternative installation method is via a new package manager under development called idris2-pack. It should work as-is to install Idris2 (and any packages that you want) after you've installed the racket chez port. The install.bash script has code to check for an M1 mac homebrew repository and set CPATH. I've wiped `~/.pack` and reinstalled it from scratch on my M1 mac a week or two ago.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts