ChezScheme icon indicating copy to clipboard operation
ChezScheme copied to clipboard

Support for Apple Silicon and MacPorts

Open ghost opened this issue 3 years ago • 18 comments

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.

ghost avatar Nov 23 '20 17:11 ghost

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

jltaylor-us avatar Nov 24 '20 01:11 jltaylor-us

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.

cjfrisz avatar Nov 24 '20 03:11 cjfrisz

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

fweimer avatar Nov 24 '20 10:11 fweimer

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.

haziz avatar Dec 19 '20 13:12 haziz

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.

BracketMaster avatar Aug 26 '21 22:08 BracketMaster

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.

cjfrisz avatar Aug 27 '21 12:08 cjfrisz

Excellent. Just let me know.

BracketMaster avatar Aug 27 '21 14:08 BracketMaster

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?

Pzixel avatar Dec 08 '21 12:12 Pzixel

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 avatar Dec 08 '21 13:12 cjfrisz

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.

cjfrisz avatar Dec 08 '21 13:12 cjfrisz

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

Pzixel avatar Dec 08 '21 13:12 Pzixel

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.

cjfrisz avatar Dec 08 '21 14:12 cjfrisz

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.

jltaylor-us avatar Dec 08 '21 14:12 jltaylor-us

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

cjfrisz avatar Dec 09 '21 00:12 cjfrisz

Any updates here? @cjfrisz

joaogui1 avatar Jan 12 '22 02:01 joaogui1

just pinging again @cjfrisz

joaogui1 avatar Jan 20 '22 09:01 joaogui1

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

cjfrisz avatar Feb 07 '22 02:02 cjfrisz

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 [email protected]: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.

mk12 avatar Apr 21 '22 04:04 mk12

This also can now be closed, I believe.

sorawee avatar Oct 18 '23 16:10 sorawee

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

relates to https://github.com/Homebrew/homebrew-core/pull/152760

chenrui333 avatar Oct 30 '23 01:10 chenrui333