Jump to content
Hans♫

Delphi and the new Apple M1 CPU

Recommended Posts

It works with Delphi 🙂

Just received the Mac Mini with the new Apple M1 CPU. After a quick attempt to deploy our FMX app, I can confirm that PAServer runs and I can deploy and run our FMX app without problems.

"Rosetta 2" seems to do the job very well!

  • Like 4

Share this post


Link to post

How is that possible ?

I thought PAServer is a Macos binary, on x86, not a Java thingy ?

At least I can see dylib's in the package content.

Or do you found a new, ARM compatible PAServer somewhere ?

I don't think Apple is emulating x86 assembler code on M1, or do they ?
 

Edited by Rollo62

Share this post


Link to post
4 minutes ago, Markus Kinzler said:

They do. Only a small fraction of apps already got a arm version.

Damn, I missed that fact.

Apple is really the hottest sh...  :classic_biggrin:

 

Does that mean also VmWare Fusion, Win-10 guest and Rx1041 is running as before ?

(No, I cannot believe that, its too much utopia for my,  Apple runs out of the box ....)

Share this post


Link to post

Windows VMs on the M1 ARM seems to a no-go - but that is no surprise.

But - it is a very impressive CPU - Twice the power, and twice the battery time.

Share this post


Link to post
35 minutes ago, Lars Fosdal said:

Windows VMs on the M1 ARM seems to a no-go - but that is no surprise.

But - it is a very impressive CPU - Twice the power, and twice the battery time.

At four times the price 🤣😂🤣

  • Haha 1

Share this post


Link to post
On 11/20/2020 at 2:59 PM, Rollo62 said:

Does that mean also VmWare Fusion, Win-10 guest and Rx1041 is running as before ?

VMware is working on a VMware Fusion version for the M1 processor.
This is not currently available, so no it does not currently work, estimated arrival somewhere 2021.


That first M1 version will -for sure- not offer x86/x64 processor emulation. That is a whole different ballgame and rosetta is not available for virtual machines.
As such you will only be able to run virtual machines that depend on an Arm processor to run.

Having said that, VMware did get an overwhelming demand to also look into processor emulation and they are actively looking into this.
That's about the only thing that the responsible VMware product manager is willing to say about this at the moment.

Edited by Wil van Antwerpen

Share this post


Link to post

Well, unexpectedly Apple-M1 did not so bad in emulation.

I haven't found many reports on compatibility issues yet, so maybe someone knows more about
the Do's and Dont's with this emulator: what can be used, what will crash ?

I think no Hypervisor, OK, but what restrictions have normal apps ?

 

 

Edited by Rollo62

Share this post


Link to post

Now I had time to investigate it a bit further. Looks like debug mode does NOT work on the new M1 CPU.

I can run a MacOS application from Delphi on the M1 Mac, without debugging, but when I run in debug mode I get the error: "unable to create process 'debug kernel timeout'".

The same application runs fine in Debug mode when using an Intel Mac having the same versions of MacOS (Big Sur) and XCode.

 

Before I create an issue on on Quality Portal. Are there any suggestions for things I should try first? - or extra information I can retrieve and include in the issue?

Share this post


Link to post

According to the Roadmap (https://blogs.embarcadero.com/rad-studio-roadmap-november-2020/) in Delphi 10.5  H2 2021  you can expect a better support for the M1 CPU. In the roadmap it's under Platform Enhancements macOS ARM (Delphi).

 

Of course as ever please do not forget this is only planned. There is no legal bound that it will be delivered in the first release of Delphi 10.5. 

A more detail can be found also at https://blogs.embarcadero.com/rad-studio-november-2020-roadmap-pm-commentary/
 

Quote

For 10.5, we plan to introduce a new target platform for Delphi, macOS ARM (based on Apple Silicon CPUs), significant work around IDE HighDPI support, C++ toolchain extensions, and many other additional features and quality enhancements. See below for more details.  

Quote

Marco’s Commentary of 10.5 Plans

Speaking of platforms, we want to add a new target for Delphi applications: a new compiler for the ARM-based version of the macOS operating system with Apple hardware powered by Apple Silicon CPUs. While you can run Intel applications, the goal is to have a native ARM application for the new generation of Macs.

This will be a significant extension of Delphi, including a new compiler, updates to the runtime library and the various high level libraries. We have also plans to expand the Delphi language syntax for all platforms and improve the performance of the math processing code the compiler generates on Windows, making applications faster in numeric processing.

At this moment the best you can do is to wait for the first beta for Delphi 10.5.

Share this post


Link to post
1 hour ago, Lajos Juhász said:

According to the Roadmap (https://blogs.embarcadero.com/rad-studio-roadmap-november-2020/) in Delphi 10.5  H2 2021  you can expect a better support for the M1 CPU. In the roadmap it's under Platform Enhancements macOS ARM (Delphi).

The roadmap refers to ARM M1 as a target platform.

What I am referring to is to be able to debug the Intel target on an ARM M1 CPU. 

I can deploy and run from Delphi on the M1 CPU, but I cannot debug.

It might not be possible to use the CPU view in Delphi, as it would have to work through the Rosetta 2 converter, but limited debug facilities would suffer, e.g. Breakpoints and variable inspection.

Share this post


Link to post

That is good news, that releases of Delphi may run on M1.

I think we still will have x86 Mac's for a while, so still some time until we really need to move to M1 as debug tool.

Hopefully there were no hidden catches in the Rosetta 2, that let us need support more urgently.

Share this post


Link to post

I have no performance numbers, but it "feels" faster. Apps starts faster and feels more responsive, but maybe it is also related to being a new and fresh installation of MacOS, compared to a 3 years old Mac Mini with Intel.

Share this post


Link to post

FWIW, CrossOver for Mac was announced as running on the beta Mac Minis with Apple's CPUs several months ago. NONE of the VMs run on the M1 yet, AFAIK.

 

CrossOver is a minimalist VM that runs WINE to emulate Windows in other environments, eg: MacOS, several Linux variants, and now Android.

 

It's made by the same guys that support WINE.

 

Their technology seems solid, but their business model is rather discouraging. They charge around $50/yr for CrossOver on a given platform, but it's for personal use only. If you want to take your Windows app built in Delphi and stuff it into a CrossOver "bottle" and sell it, they charge a flat $4500 setup and license fee. At that rate, it's cheaper to just buy licenses in bulk from them if you expect low sales volumes (and you'll need to keep them updated as the target platform evolves). Also, I don't know if that fee includes upgrades that you can ship out or not.

 

I built something in Delphi recently and tried it out CrossOver to see how it works in MacOS. It's really quite nice, aside from the fact that the startup time is a bit sluggish.

 

This approach does pose a bit of a challenge, however, if you want your users to be able to work on multiple platforms (eg., move between multiple Win and Mac devices) and you need the app to access common data, like what would commonly be stored in the registry, INI files, or a local DB.

 

Frankly, I'm leaning more towards TMS WebCore and then using Electron to create native apps from them. But WebCore controls aren't quite as nice as what can be found in general for Delphi VCL. CrossOver gives you almost exact mirroring of VCL apps in the platforms it supports.

Edited by David Schwartz

Share this post


Link to post

If you're considering using Electron et al. then perhaps also have a look at freepascal/lazarus?
Last time I looked it was pretty nice, also on macOS.
But too big of a rewrite for me as I am pretty heavily invested in FMX.
If your app is currently mostly using VCL then it is much easier to rewrite and use their LCL approach.

Share this post


Link to post
14 minutes ago, Wil van Antwerpen said:

If you're considering using Electron et al. then perhaps also have a look at freepascal/lazarus?
Last time I looked it was pretty nice, also on macOS.
But too big of a rewrite for me as I am pretty heavily invested in FMX.
If your app is currently mostly using VCL then it is much easier to rewrite and use their LCL approach.

TMS WebCore has electron wrappers that work with their web components. I don't really like FMX, and prefer Raize / Konopka components for routine VCL work.

 

But WebCore has their own plus you can use the TMS FNC components as well. They both have lots of properties added to support the unique needs of running inside a browser DOM, including support for CSS.

Edited by David Schwartz
  • Like 2

Share this post


Link to post

I did a few tests using WINE a while ago and was quite impressed. I have never got the IDE itself to run on it since I've used it over the years. However,  creating some 'hello world' console, VCL and FMX apps I was pleasantly surprised they worked quite well, but had seen some 'glitches' with FMX under 64bit.

Share this post


Link to post
On 12/9/2020 at 12:36 PM, Hans♫ said:

Now I had time to investigate it a bit further. Looks like debug mode does NOT work on the new M1 CPU.

I can run a MacOS application from Delphi on the M1 Mac, without debugging, but when I run in debug mode I get the error: "unable to create process 'debug kernel timeout'".

The same application runs fine in Debug mode when using an Intel Mac having the same versions of MacOS (Big Sur) and XCode.

 

Before I create an issue on on Quality Portal. Are there any suggestions for things I should try first? - or extra information I can retrieve and include in the issue?

did you manage to solve it? I have M1 as well and with same error

Share this post


Link to post

this is a stretch, but ... I upgraded to Big Sur and VirtualBox would not run. It seems Apple changed something in Big Sur (BS?) that makes it really difficult to install kernal extensions (kexts), and it's a problem for anything that runs a VM. Is there any chance that the debugger on the Mac side needs to install a kext to work? (I had to go back to Catalina. I hope they fix that issue or make VM softwares work without requiring kexts.)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×