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 Apple Silicon and MacPorts #544

Closed
ghost opened this issue Nov 23, 2020 · 20 comments
Closed

Support for Apple Silicon and MacPorts #544

ghost opened this issue Nov 23, 2020 · 20 comments

Comments

@ghost
Copy link

ghost commented Nov 23, 2020

I'm not sure if this is a bug or a feature request, but is it at all possible to have native support for Apple Silicon Macs via MacPorts? The current version doesn't install due to other extant issues but as it stands, MacPorts shows that only x86-64 is supported and not the native arm64 on the new Macs.

@jltaylor-us
Copy link
Contributor

I'm sure if someone wants to ship @cfrisz a new M1 mac he'd be happy to work on getting Chez running on it natively. 😄
After that, getting it in to MacPorts and other package managers is handled by people more familiar with them (or has been in the past, anyway)... see, e.g., #82

@cjfrisz
Copy link
Contributor

cjfrisz commented Nov 24, 2020

I will happily develop and package Chez Scheme for the price of an M1 Mac Mini. 😁 Short of that, I would like to load a 64-bit ARM Linux distro on my Raspberry Pi 4 and start work on an arm64le port when I have a chance, which would hopefully get us most of that way to arm64osx.

@fweimer
Copy link
Contributor

fweimer commented Nov 24, 2020

The Racket fork of Chez Scheme already contains an AArch64 backend: https://github.com/racket/ChezScheme/blob/master/s/arm64.ss

@haziz
Copy link

haziz commented Dec 19, 2020

The Racket fork of Chez Scheme already contains an AArch64 backend: https://github.com/racket/ChezScheme/blob/master/s/arm64.ss

I did not install on Apple M1, but your notice did allow me to install the Chez Scheme backend version on ARM (Rasbperry Pi 4) aarch64, so than you! It would be good if they can backport/pull request the needed code to the mainline Dybvig/Cisco project.

@BracketMaster
Copy link

I'm sure if someone wants to ship @cfrisz a new M1 mac he'd be happy to work on getting Chez running on it natively. 😄
After that, getting it in to MacPorts and other package managers is handled by people more familiar with them (or has been in the past, anyway)... see, e.g., #82

I'd be happy to provide ssh access for Apple Silicon as well as Power9 Silicon.

@cjfrisz
Copy link
Contributor

cjfrisz commented Aug 27, 2021

I've got my hands on an Apple Silicon machine in the meantime, so the offer is appreciated, but unnecessary (though Power9 could be fun). I have some work on an arm64osx branch, but now I need to make more time for it.

@BracketMaster
Copy link

Excellent. Just let me know.

@Pzixel
Copy link

Pzixel commented Dec 8, 2021

Hi everyone. I've just hit this problem right now and I'm not sure what to do. Any progress on having it running natively on M1?

@cjfrisz
Copy link
Contributor

cjfrisz commented Dec 8, 2021

I'm continuing work on the Apple Silicon support, and should have more time to work on it at the end of the month when I have time off from my day job.

Ideally, I would be able to say that Rosetta 2 support for the a6osx version should work, but @jltaylor-us and I discovered that there seems to be a regression in that support. We should probably open an issue for that as well.

@cjfrisz
Copy link
Contributor

cjfrisz commented Dec 8, 2021

That said, I ran into the Rosetta 2 issue trying to cross-compile, but I think the pre-built a6osx binary and boot files should work on M1. Someone else might have the answer at hand, but I'll check later today and update/open issues as appropriate.

@Pzixel
Copy link

Pzixel commented Dec 8, 2021

That would be absolutely great! Thanks for a quick answer.

I'm here with working MBP 2021 if you need any experimentation on M1 hardware. I'm not that good at mac/nix though since I've never used them before, but I'm willing to help if I can

@cjfrisz
Copy link
Contributor

cjfrisz commented Dec 8, 2021

I appreciate it. I've got an M1 Mac Mini that's my daily driver and Apple Silicon dev machine. I was not making as much time as I hoped I would for the Apple Silicon support for quite a while, so I didn't have work to show. I have made more time recently, so I should push that work to a visible branch soon.

@jltaylor-us
Copy link
Contributor

FWIW, I just ran both make install and the bullyx mats on the current main branch in a fresh workspace in an intel terminal (i.e., a shell spawned via /usr/bin/arch -x86_64 /bin/bash -l) with no problems. Well, no real problems... one configuration of the mats said something "seems to take too long", but I'm not going to count a single failure of a timing-based test under emulation as an error unless it's a consistent failure.

@cjfrisz
Copy link
Contributor

cjfrisz commented Dec 9, 2021

As a follow-up from this morning: in line with what @jltaylor-us reported, I was able to build and test a6osx on my M1 Mac Mini in an x86_64 shell. I tried to reproduce the Rosetta 2 issue we encountered, and I couldn't get it to happen. I'm going to chalk it up to human error until it happens again. This does seem to mean I can do the cross-compile step entirely on the M1 machine, which makes things easier

@joaogui1
Copy link

Any updates here? @cjfrisz

@joaogui1
Copy link

just pinging again @cjfrisz

@cjfrisz
Copy link
Contributor

cjfrisz commented Feb 7, 2022

I've uploaded the current work I have to a draft pull request #607.

@mk12
Copy link

mk12 commented Apr 21, 2022

I managed to build the Racket fork on my M1 Mac in the meantime. It was a bit confusing, so sharing instructions here in case it helps others:

git clone git@github.com:racket/ChezScheme --depth 1
cd ChezScheme
git submodule init
git submodule update --depth 1
./configure --pb
make tarm64osx.bootquick

# Option 1: /usr/local install
./configure --threads --installschemename=chez
make -j10
sudo make install
echo '(+ 1 1)' | chez -q # should print 2

# Option 2: custom prefix
./configure --threads --installschemename=chez --installprefix=testprefix
make -j10
make install
export SCHEMEHEAPDIRS=testprefix/lib/csv%v/%m
echo '(+ 1 1)' | ./testprefix/bin/chez -q # should print 2

I based the configure flags off the Homebrew formula.

Hopefully #607 will be merged at some point and I can go back to using brew install chezscheme.

@sorawee
Copy link
Contributor

sorawee commented Oct 18, 2023

This also can now be closed, I believe.

@chenrui333
Copy link

Can you cut off a new release per this issue close?

relates to Homebrew/homebrew-core#152760

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