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

Building on M1 Mac #1247

Open
jordanrule opened this issue Feb 23, 2023 · 2 comments · May be fixed by #1264
Open

Building on M1 Mac #1247

jordanrule opened this issue Feb 23, 2023 · 2 comments · May be fixed by #1264

Comments

@jordanrule
Copy link

Just wanted to leave a few notes on building the project on an M1 Mac (aarch64) should you decide to support the architecture in the future:

  • The default download of Stack does not work, aarch64 requires ghcup to download a Stack that builds for the appropriate architecture (required for llvm-hs)
  • The default install location of libpng (homebrew) is now /opt/homebrew/include so it requires an additional wildcard check in make
  • Cryptonite does not build on lts-18.23 for M1, (see here) - I tried upgrading to a later version of GHC but I don't know enough about this project or Haskell build in general to fix the dependency chains

Just posting this in case it helps someone else or I missed something, as I would like to return to the project and look for possible contributions once it is working.

@dan-zheng
Copy link
Collaborator

dan-zheng commented Mar 24, 2023

Thanks for the issue! I got a new Apple M1 laptop recently, ran into all the build issues mentioned above.

After a day of debugging, I'm close to getting Dex to build on Apple M1:

Current status: upgrading to GHC 9.2.7 has resulted in some dex-lang compilation errors, probably due to language changes:

$ make
stack --stack-yaml=stack-macos.yaml build --ghc-options="-j +RTS -A256m -n2m -RTS" --extra-include-dirs=/opt/homebrew/include --extra-lib-dirs=/opt/homebrew/lib --fast
...
/Users/danielzheng/dex-lang/src/lib/Name.hs:1302:44: error:
    Bang pattern in expression context: !v
    Did you mean to add a space after the '!'?
     |
1302 |   lookupZipSubstFst v = ZipSubstReaderT $ (!v) <$> fst <$> ask
     |                                            ^^

/Users/danielzheng/dex-lang/src/lib/Name.hs:1303:44: error:
    Bang pattern in expression context: !v
    Did you mean to add a space after the '!'?
     |
1303 |   lookupZipSubstSnd v = ZipSubstReaderT $ (!v) <$> snd <$> ask
     |                                            ^^

I'll plan to follow-up here within a week. If the final fixes aren't too tricky, I should be able to share a pull request with instructions.

@dan-zheng dan-zheng linked a pull request Apr 4, 2023 that will close this issue
4 tasks
@dan-zheng
Copy link
Collaborator

In-progress fix at #1264. Dex builds on Apple M1 and simple examples run!

Requires LLVM 15: brew install llvm@15. Tests aren't all passing yet, working on fixing them next.

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

Successfully merging a pull request may close this issue.

2 participants