Page 2 of 3

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Tue May 04, 2021 3:46 pm
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.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Tue May 04, 2021 6:03 pm
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.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Wed May 05, 2021 2:20 am
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%

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Wed May 05, 2021 7:41 am
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?

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Wed May 05, 2021 9:31 am
by Ronald P. Regensburg
But, frankly, I think that the JIT compiler is not needed on any modern Mac, whether Intel or Apple Silicon.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Wed May 05, 2021 11:56 am
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!

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Wed May 05, 2021 1:27 pm
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.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Wed May 05, 2021 2:29 pm
by kanjitalk755
I found only one file refers to uae_cpu.
Copied old file to SheepShaver, now both BII/SS can be built.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Wed May 05, 2021 3:40 pm
by adespoton
That's great! Using the new uae_cpu where it's called in SS is an added bonus.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Wed May 05, 2021 3:45 pm
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?

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Wed May 05, 2021 8:59 pm
by adespoton
There was one change to SheepShaver where uae_cpu was updated; I don't know if it affects JIT.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Thu May 06, 2021 1:12 am
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.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Thu May 06, 2021 5:35 am
by Cat_7
Hi,

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

Best,
Cat_7

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Thu May 06, 2021 7:04 am
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?

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Thu May 06, 2021 9:34 am
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?

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Thu May 06, 2021 9:49 am
by Cat_7
Does any of this help? But then obviously the other way around ;-)

viewtopic.php?f=34&t=11085

Best,
Cat_7

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Thu May 06, 2021 10:40 am
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

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Thu May 06, 2021 11:30 am
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.)

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Fri May 07, 2021 1:15 am
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.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Fri May 07, 2021 3:24 am
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....

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Mon May 10, 2021 11:08 am
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?

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Mon May 10, 2021 4:42 pm
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.

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Mon May 10, 2021 5:23 pm
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?

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Mon May 10, 2021 6:08 pm
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

Re: Sheepshaver/BasiliskII development and supported platforms

Posted: Mon May 10, 2021 6:14 pm
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