Re: DMD support for Apples new silicon

2021-03-02 Thread Guillaume Piolat via Digitalmars-d-learn

On Tuesday, 2 March 2021 at 08:01:41 UTC, tastyminerals wrote:
On Sunday, 10 January 2021 at 14:50:44 UTC, Guillaume Piolat 
wrote:
On Sunday, 10 January 2021 at 14:22:25 UTC, Christian Köstlin 
wrote:

[...]


Hello Christian,

[...]


I see that there is a ldc2-1.25.1-osx-arm64.tar.xz already 
among https://github.com/ldc-developers/ldc/releases


So, one could use this straight away, right?


Yes, it will run faster and you get to avoid the flag to target 
arm64.
On the minus side, you can't target x86_64 with that build IIRC, 
whereas the x86_64 one cross-compile to arm64.


Re: DMD support for Apples new silicon

2021-03-02 Thread tastyminerals via Digitalmars-d-learn
On Sunday, 10 January 2021 at 14:50:44 UTC, Guillaume Piolat 
wrote:
On Sunday, 10 January 2021 at 14:22:25 UTC, Christian Köstlin 
wrote:

[...]


Hello Christian,

[...]


I see that there is a ldc2-1.25.1-osx-arm64.tar.xz already among 
https://github.com/ldc-developers/ldc/releases


So, one could use this straight away, right?


Re: DMD support for Apples new silicon

2021-01-11 Thread Christian Köstlin via Digitalmars-d-learn

On 10.01.21 17:29, Guillaume Piolat wrote:

On Sunday, 10 January 2021 at 16:03:53 UTC, Christian Köstlin wrote:


Good news!
I was hoping for support in ldc, but dmds super fast compile times 
would be very welcome. I guess it's more work to put an ARM backend 
there.


Kind regards,
Christian


It is indeed more work and up to the DMD leadership what should happen.

You can already switch between compilers with:
   dub --compiler dmd
   dub --compiler ldc2

so as to benefit from dmd fast build times, and then release with ldc.

Apple Silicon and Rosetta 2 are really quite fast, so you should 
experience pretty quick build times there anyway.
I do not have new Apple HW, but knowing that dlang is covered is a good 
thing!


thanks a lot!

christian



Re: DMD support for Apples new silicon

2021-01-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 10 January 2021 at 16:03:53 UTC, Christian Köstlin 
wrote:


Good news!
I was hoping for support in ldc, but dmds super fast compile 
times would be very welcome. I guess it's more work to put an 
ARM backend there.


Kind regards,
Christian


It is indeed more work and up to the DMD leadership what should 
happen.


You can already switch between compilers with:
  dub --compiler dmd
  dub --compiler ldc2

so as to benefit from dmd fast build times, and then release with 
ldc.


Apple Silicon and Rosetta 2 are really quite fast, so you should 
experience pretty quick build times there anyway.


Re: DMD support for Apples new silicon

2021-01-10 Thread Christian Köstlin via Digitalmars-d-learn

On 10.01.21 15:50, Guillaume Piolat wrote:

On Sunday, 10 January 2021 at 14:22:25 UTC, Christian Köstlin wrote:

Hi all,

are there any plans on supporting Apples new ARM silicon with DMD or 
would this be something for ldc?


Kind regards,
Christian


Hello Christian,

LDC since 1.24+ support cross-compiling to Apple Silicon.
Here is how to build for it on Big Sur.


1. Download ldc2-1.24.0-osx-x86_64.tar.xz (or later version)
    from this page: https://github.com/ldc-developers/ldc/releases

2. Unzip where you want, and put the bin/ subdirectory in your PATH envvar

    This will give you the ldc2 and dub command in your command-line, 
however they won't work straight away in Catalina/Big Sur because of 
lacking notarization.


3. (optional) In this case, in Finder, right-click + click "Open" on the 
bin/dub and bin/ldc2 binaries since it is not notarized software, and 
macOS will ask for your approval first. Once you've done that, dub and 
ldc2 can be used from your Terminal normally.


4. Type 'ld' in Terminal, this will install the necessary latest 
XCode.app if it isn't already. That is a painful 10 gb download in 
general. You can also install Xcode from the App Store. People target 
Big Sur arm64 from Catalina or Big Sur usually.


5. You can target normal x86_64 (Rosetta 2) with:

   ldc2 
   dub 

6. If you want to target arm64, adapt the SDK path in etc/ldc2.conf with 
your actual Xcode macOS11.0 path, and then use 
-mtriple=arm64-apple-macos to cross-compile.


   ldc2 -mtriple=arm64-apple-macos 
   dub -a arm64-apple-macos 

Debugging and notarization is a whole another topic then.


Good news!
I was hoping for support in ldc, but dmds super fast compile times would 
be very welcome. I guess it's more work to put an ARM backend there.


Kind regards,
Christian


Re: DMD support for Apples new silicon

2021-01-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 10 January 2021 at 14:22:25 UTC, Christian Köstlin 
wrote:

Hi all,

are there any plans on supporting Apples new ARM silicon with 
DMD or would this be something for ldc?


Kind regards,
Christian


Hello Christian,

LDC since 1.24+ support cross-compiling to Apple Silicon.
Here is how to build for it on Big Sur.


1. Download ldc2-1.24.0-osx-x86_64.tar.xz (or later version)
   from this page: https://github.com/ldc-developers/ldc/releases

2. Unzip where you want, and put the bin/ subdirectory in your 
PATH envvar


   This will give you the ldc2 and dub command in your 
command-line, however they won't work straight away in 
Catalina/Big Sur because of lacking notarization.


3. (optional) In this case, in Finder, right-click + click "Open" 
on the bin/dub and bin/ldc2 binaries since it is not notarized 
software, and macOS will ask for your approval first. Once you've 
done that, dub and ldc2 can be used from your Terminal normally.


4. Type 'ld' in Terminal, this will install the necessary latest 
XCode.app if it isn't already. That is a painful 10 gb download 
in general. You can also install Xcode from the App Store. People 
target Big Sur arm64 from Catalina or Big Sur usually.


5. You can target normal x86_64 (Rosetta 2) with:

  ldc2 
  dub 

6. If you want to target arm64, adapt the SDK path in 
etc/ldc2.conf with your actual Xcode macOS11.0 path, and then use 
-mtriple=arm64-apple-macos to cross-compile.


  ldc2 -mtriple=arm64-apple-macos 
  dub -a arm64-apple-macos 

Debugging and notarization is a whole another topic then.