-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify installation instructions on macOS (M1) #2233
Comments
Okay, Following https://www.reddit.com/r/Idris/comments/pc5lib/success_building_native_idris2_on_an_m1_mac/ I followed these steps for a successful installation: Firstly, install the Racket fork of Chez Scheme, not Cisco Chez Scheme or Racket:
Now install Idris2:
Thanks also to the pointers on Discord. |
By default idris2 will use chezscheme to compile Using the chezscheme code generator & trying to compile the result with racket (by symlinking |
I tried following @ornamentist guides to compile racket/ChezScheme and getting the same error on #1032
|
I have updated my guide for Apple silicon: |
Some of the issues that Syzygies struggled with are fixed post 0.5.1. It's been a year and a lot of stuff has been fixed since then. Perhaps there should be a new release of Idris. For M1 / M2 macs, the bootstrap does work on the latest development version with the special chez scheme described above, but there are no instructions for this in I'll submit a PR to update the |
Note that installing gmp via MacPorts puts it in a different location than what is assumed for homebrew. I made a branch commit in my own fork of Idris2 to address this: https://github.com/c4augustus/Idris2/commit/15a2b7039c72135d11017e93d78b568ed9e780d1 I build for macOS M1 using the Racket fork of ChezScheme and this fix worked for running the idris2 REPL as well as building executables. However, I still get the "'gmp.h' file not found" when trying to build to backend C source using refc, so somehow I need to get those CFLAGS over to its build process. |
Yeah, I needed both of these in the environment to build with the C backend on M1 macs:
The let runcc = escapeCmd $
[cc, "-Werror"] ++ sharedFlag ++ [objectFile,
"-o", outFile,
supportFile,
"-lidris2_refc",
"-L" ++ refcDir
] ++ clibdirs (lib_dirs dirs) ++ [
"-lgmp", "-lm"] |
Thanks a bunch for that effort. The IDRIS2_LIBS has just now fixed my issues with compiling to C. I tried LIB but that didn't work, so it would have taken me a while to figure it out. Now the docs just need to reflect this. |
When following the standard installation instructions there are a few gotchas for installation on macOS with an M1 processor:
Using homebrew
brew install idris2
is currently not working:I understand this is an issue for the Homebrew maintainer of that brew and not one for the official project, although it does have a bearing on what comes next.
Moving to installation from source with Chez scheme, the formula is also currently not working:
Again this is not the responsibility of the Idris2 developers, but it leads to installing from source with Racket.
It's not clear whether minimal racket is enough to build Idris2 so I went with the full racket install. I cloned the Idris2 repository and did a
gmake bootstrap-racket
which now complains about a missinggmp.h
.GMP is installed via Homebrew but the make commands are not finding
gmp.h
so I modified theconfig.mk
file to add-I/opt/homebrew/include
to theCFLAGS
variable. This allowed the build to complete.A
gmake install
installed everything in the local directory and not theconfig.mk
prefix, so I changed thePREFIX
make variable to/Users/stu/.idris2
which did work. This may be because I'm running fish shell and not bash.Finally, when I run the
idris2
script I get aidris2 -o hello hello.idr env: scheme: No such file or directory
error. I'm guessing there's a make variable somewhere that points to a scheme executable which Racket doesn't provide? I tried linking the racket executable toscheme
too:Which looks like idris2 wants the Chez scheme executable even though it was built with Racket?
Should I treat the macos/M1/homebrew/racket combination as unsupported just for now? I suspect the maintainers have enough on their plate already.
The text was updated successfully, but these errors were encountered: