Skip to content
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

Support for Mac? #181

Closed
shwestrick opened this issue Mar 5, 2024 · 1 comment
Closed

Support for Mac? #181

shwestrick opened this issue Mar 5, 2024 · 1 comment

Comments

@shwestrick
Copy link
Collaborator

It would be great if we could build locally on modern Macs, including native support for M{1,2,3} chips, etc.

There are some hurdles to figure out. These MLton issues are helpful: MLton/mlton#438, MLton/mlton#424

Taking some notes:

  • Generating amd64 vs arm64 code seems like it will be a pain point (discussed especially here)
  • At some point we started using gcc-ar and gcc-ranlib for MPL...? Can't remember why.
    • This is easy to fix, in Makefile.config: just need to set AR := ar and RANLIB := ranlib
  • MacOS is stuck using old version of make, and this appears to screw up the build system.
    • Seems like using gmake fixes this issue. (Just need to do brew install make to install gmake, which is a newer version of GNU Make.)
    • Using make --debug=v and gmake --debug=v is helpful.
  • Issues with installing GMP on Mac??
    • brew install gmp results in /opt/homebrew/Cellar/gmp/6.3.0/{include,lib}
    • Edit Makefile.config to set WITH_GMP_DIR := /opt/homebrew/Cellar/gmp/6.3.0
  • Compiler errors
    • These should hopefully be easy to fix, just need to walk through them.
    • For example here are a few:
      • gc/init.c:615:3: error: implicit declaration of function 'srand48_r' is invalid in C99
      • gc/termination.c:29:7: error: implicit declaration of function 'pthread_yield' is invalid in C99
      • ...
@shwestrick
Copy link
Collaborator Author

#189 has now been merged (thank you @waterlens!!)

I updated the README to include build instructions for Mac (0efae88).

It's possible there may still be some ARM vs x86 bugs lurking, but nothing major has popped up so far. Let's keep our eyes peeled!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant