Sheepshaver/BasiliskII development and supported platforms

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Ronald P. Regensburg »

I myself disabled JIT in BasiliskII in the past because of stability issues and I never again enabled it since. On my late 2013 iMac I do not miss it. And in our BasiliskII setup guide we (still) advise to not enable JIT.

I do not know how others feel about removing JIT from BasiliskII for macOS permanently.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Sheepshaver/BasiliskII development and supported platforms

Post by adespoton »

I know some of our recent users have been using it, especially on Raspberry Pi machines (not the target here). If we're looking specifically at macOS 11 and later, I really don't see the use of JIT, as any machine that can run Big Sur is more than beefy enough to run non-JIT BII at full speed.

That said, disabling FPU and just running SoftwareFPU should also work, shouldn't it?

Personally, I've kept JIT disabled on macOS for around 5 years now.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Sheepshaver/BasiliskII development and supported platforms

Post by kanjitalk755 »

adespoton wrote: Tue May 04, 2021 6:03 pm That said, disabling FPU and just running SoftwareFPU should also work, shouldn't it?
It works, but slow.

MacBench FPU scores:
Quadra630: 100%
fpu=false and SoftwareFPU installed (master branch): 62%
fpu=true (update_uae branch): 1173%
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Ronald P. Regensburg »

When BasiliskII works fine natively on arm64 there is no reason for the user to try and run it with Rosetta.
And BasiliskII will run so fast on any arm64 machine that JIT is not needed.

Is it possible to to make it so that a universal build uses different solutions for FPU and JIT for the two architectures?
Last edited by Ronald P. Regensburg on Wed May 05, 2021 9:28 am, edited 1 time in total.
Reason: Accidentally wrote "FPU" instead of "JIT". Corrected now.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Ronald P. Regensburg »

But, frankly, I think that the JIT compiler is not needed on any modern Mac, whether Intel or Apple Silicon.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Sheepshaver/BasiliskII development and supported platforms

Post by emendelson »

BasiliskII is already very fast on Intel machines. It seems best to give it up and focus on FPU instead. But that's only one person's opinion!
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Sheepshaver/BasiliskII development and supported platforms

Post by kanjitalk755 »

I disabled JIT compiler.

I found one problem.
SheepShaver cannot be built if updating uae_cpu.
I thought SheepShaver depended only on kpx_cpu, but it also depended on uae_cpu.

Therefore, the merge into master is still pending.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Sheepshaver/BasiliskII development and supported platforms

Post by kanjitalk755 »

I found only one file refers to uae_cpu.
Copied old file to SheepShaver, now both BII/SS can be built.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Sheepshaver/BasiliskII development and supported platforms

Post by adespoton »

That's great! Using the new uae_cpu where it's called in SS is an added bonus.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Ronald P. Regensburg »

What will be the properties of the resulting builds, SheepShaver and BasiliskII, x86_64 and arm64?

FPU working in all four?

BasiliskII: No JIT compiler in both x86_64 and arm64?

SheepShaver: JIT compiler available in both x86_64 and arm64?

Edit: Do I understand correctly that only BasiliskII changed and nothing changed for SheepShaver?
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Sheepshaver/BasiliskII development and supported platforms

Post by adespoton »

There was one change to SheepShaver where uae_cpu was updated; I don't know if it affects JIT.
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Sheepshaver/BasiliskII development and supported platforms

Post by kanjitalk755 »

I modified to manage two versions of uae_cpu in one Xcode project of BII.
Then I re-enabled the x86_64 JIT compiler.

The summary is as follows.

BasiliskII(x86_64): FPU OK, JIT available
BasiliskII(arm64): FPU OK, non-JIT
SheepShaver(x86_64): FPU OK, JIT available
SheepShaver(arm64): FPU OK, non-JIT

The JIT compiler of SheepShaver(arm64) is under developing by Jagmn.
I am looking forward to the release.
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Cat_7 »

Hi,

I assume this is going on in your update_uae branch, not in master?

Best,
Cat_7
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Ronald P. Regensburg »

As the FPU issue is with BasiliskII only in the current master, would it be OK to post a BasiliskII build with this solution?
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Sheepshaver/BasiliskII development and supported platforms

Post by kanjitalk755 »

Cat_7 wrote: Thu May 06, 2021 5:35 am I assume this is going on in your update_uae branch, not in master?
Yes.
Ronald P. Regensburg wrote: Thu May 06, 2021 7:04 am As the FPU issue is with BasiliskII only in the current master, would it be OK to post a BasiliskII build with this solution?
Yes, but there is one problem.
The arm64 part of BII build requires MPFR library.
If an M1 Mac, you can easily install it with Homebrew.

Code: Select all

$ brew install mpfr
But I don't know how to install the library for arm64 on an Intel machine using Homebrew.
Does anyone know?
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Cat_7 »

Does any of this help? But then obviously the other way around ;-)

viewtopic.php?f=34&t=11085

Best,
Cat_7
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Ronald P. Regensburg »

At this stage I think it is better not to post new builds yet.

I will add to my latest BasiliskII build the warning to use it on Apple Silicon with

Code: Select all

cpu 3
fpu false
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Ronald P. Regensburg »

I assume that the MPFR library is needed for building.
Cannot MPFR for arm64 simply be copied from an arm64 machine to an Intel machine?

(BTW: In 5 to 6 weeks I expect to receive the M1 iMac I ordered.)
kanjitalk755
Apple Corer
Posts: 239
Joined: Thu Nov 09, 2017 12:06 pm

Re: Sheepshaver/BasiliskII development and supported platforms

Post by kanjitalk755 »

Yes, the libraries are only needed at build time.
And copy is OK. However, you need the headers as well as libgmp.a and libmpfr.a.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Sheepshaver/BasiliskII development and supported platforms

Post by adespoton »

kanjitalk755 wrote: Fri May 07, 2021 1:15 am Yes, the libraries are only needed at build time.
And copy is OK. However, you need the headers as well as libgmp.a and libmpfr.a.
Well, you could just make them a requirement like SDL, and include installation instructions....
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Ronald P. Regensburg »

I understand that this is now merged into the master branch.

While I am still on Intel, I will need to install GMP / MPFR library for arm64 manually if I want to build BasiliskII for arm64.
How do I do that?
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Sheepshaver/BasiliskII development and supported platforms

Post by adespoton »

Ronald P. Regensburg wrote: Mon May 10, 2021 11:08 am I understand that this is now merged into the master branch.

While I am still on Intel, I will need to install GMP / MPFR library for arm64 manually if I want to build BasiliskII for arm64.
How do I do that?
I'm pretty sure Homebrew lets you pull down whatever libraries you want: https://formulae.brew.sh/formula/mpfr and https://formulae.brew.sh/formula/gmp are available, with links to the formula source and pre-bottled copies.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Ronald P. Regensburg »

This is what kanjitalk755 wrote earlier in this thread:
The arm64 part of BII build requires MPFR library.
If an M1 Mac, you can easily install it with Homebrew.

Code: Select all

$ brew install mpfr
But I don't know how to install the library for arm64 on an Intel machine using Homebrew.
Does anyone know?
And this is what he writes in his build instructions:
BasiliskII
macOS
preparation:

Code: Select all

$ brew install mpfr
(for Intel Mac, install GMP / MPFR library for arm64 manually)
So, how do I install the library for arm64 manually on Intel Mac?
And where should it be installed?
User avatar
Cat_7
Expert User
Posts: 6121
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Sheepshaver/BasiliskII development and supported platforms

Post by Cat_7 »

On Intel I guess you first need to install brew for arm? One other build environment to keep track of.

arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... install.sh)"

Find the actual url to use here:
https://brew.sh/

and then install mpfr:
arch -arm64 brew install mpfr

But please don't take my word for it, I could very well be wrong here ;-)

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Sheepshaver/BasiliskII development and supported platforms

Post by adespoton »

Cat_7 wrote: Mon May 10, 2021 6:08 pm On Intel I guess you first need to install brew for arm? One other build environment to keep track of.

arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homeb ... install.sh)"

Find the actual url to use here:
https://brew.sh/

and then install mpfr:
arch -arm64 brew install mpfr

But please don't take my word for it, I could very well be wrong here ;-)

Best,
Cat_7
That was my understanding as well; but once again, I've also never done it for ARM->IA64. I just tested it and got "Unknown architecture: ARM64" -- going to test homebrew to see if it's got any built-in flags. I know MacPorts lets you define the architecture you want to grab; that may be a possibility if Homebrew doesn't deliver.

[edit] https://docs.brew.sh/Bottles
If you really want your bottles to be optimised for something else, you can pass the --bottle-arch= option to build for another architecture; for example, brew install foo --build-bottle --bottle-arch=penryn. Just remember that if you build for a newer architecture some of your users might get binaries they can’t run and that would be sad!
[edit2]

Here you go:
https://ghcr.io/v2/homebrew/core/mpfr/b ... 28cf0598d5
https://ghcr.io/v2/homebrew/core/gmp/bl ... 4ca7593eec
Post Reply