Recent

Author Topic: Apple Developer Transition Kit  (Read 31427 times)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Apple Developer Transition Kit
« Reply #90 on: October 07, 2020, 01:50:41 pm »
The "user" as opposed to "global" version is in /Users/<name>/.config/fppkg.cfg ... surely you can create that one?

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #91 on: October 07, 2020, 02:52:06 pm »
By default, it shows path: /etc/fppkg.cfg

When I tried to change path in a combobox to /Users/mac/.config/fppkg.cfg

I immediately got Access violation error in Lazarus and it aborts.

I tried to recreate this configuration - the same Access violation error.

I checked this file - /Users/mac/.config/fppkg.cfg
It exists and seems to be OK on first glance.

Note, that I have a clear new macOS installation, with no old versions of Lazarus or FPC.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple Developer Transition Kit
« Reply #92 on: October 07, 2020, 05:18:42 pm »
Do you mean /etc/fppkg.cfg ?

Yes, and I can't create a new fppkg.cfg file. No rights.
That file gets created by the official FPC 3.2.0 installer. I just checked by removing it and reinstalling FPC 3.2.0 as downloaded from https://www.freepascal.org under Beta 9, and it got recreated.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #93 on: October 08, 2020, 03:53:06 pm »
Jonas,

I tried to reinstall official FPC 3.2.0 installer.

It solved the problem with fppkg.cfg file when I run Lazarus. But now default compiler is for x86-64.

I compiled and installed native AARCH64 compiler according Lazarus wiki, steps 1-5.

Now I have again AARCH64 compiler. But fppkg.cfg error appears again when I run Lazarus.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #94 on: October 29, 2020, 08:41:26 am »
Jonas,

Is it possible to compile native ARM64 code for Apple Silicon on Intel Mac (with Big Sur and Xcode 12)?


Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple Developer Transition Kit
« Reply #95 on: October 30, 2020, 09:48:45 pm »
Is it possible to compile native ARM64 code for Apple Silicon on Intel Mac (with Big Sur and Xcode 12)?
Yes. Execute step 1 of the instructions on an Intel Mac, and you'll have the cross-compiler. Skip steps 2 and 3. Execute step 4, but modified for a cross-installation:
Code: [Select]
sudo make FPC=$PWD/compiler/ppcrossa64 OPT="-ap -FD/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin -XR/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" CROSSINSTALL=1 install
Similar for step 5:
Code: [Select]
sudo mv /usr/local/lib/fpc/3.3.1/ppcrossa64 /usr/local/lib/fpc/3.3.1/ppca64
sudo ln -sf /usr/local/lib/fpc/3.3.1/ppca64 /usr/local/bin

And in step 6, only perform the configuration modifications when targeting AArch64:
Code: [Select]
#include /etc/fpc.cfg
#ifdef cpuaarch64
-FD/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
-XR/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
#endif

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #96 on: October 31, 2020, 09:18:08 pm »
Jonas,

Thanks! I'll try on Monday.

Can I switch a target in lazbuild for x86-64 and AARCH64 to compile two versions?

then I plan to use lipo to create Universal Binary.

Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple Developer Transition Kit
« Reply #97 on: October 31, 2020, 09:19:22 pm »
Probably. I only use Lazarus as a code editor myself, so I can't help with that.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #98 on: November 01, 2020, 03:05:07 pm »
Jonas,

I meant can I switch a target in the Project Options between AARCH64 and x86-64? To build a required version.


Jonas Maebe

  • Hero Member
  • *****
  • Posts: 1058
Re: Apple Developer Transition Kit
« Reply #99 on: November 01, 2020, 03:27:20 pm »
I would expect so. Keep in mind that you'll be using FPC 3.2.0 for Intel and FPC 3.3.1 for AArch64, so watch out that you don't accidentally start relying on 3.3.1-only features or fixes.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #100 on: November 01, 2020, 05:41:38 pm »
Jonas,

Thanks, I've understood now.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #101 on: November 02, 2020, 06:58:16 pm »
Now I have almost fully ready version for ARM in addition to Intel version. The app works very well. Thanks to FPC team for their great work. Special thanks to Jonas for his advices and instructions. I plan to build a final DMG installation soon.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
Re: Apple Developer Transition Kit
« Reply #102 on: November 12, 2020, 02:27:58 pm »
System.GetCPUCount() always returns "1" on Apple Silicon CPU. It should be 4 or maybe 8 cores.

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Apple Developer Transition Kit
« Reply #103 on: November 12, 2020, 02:32:59 pm »
System.GetCPUCount() always returns "1" on Apple Silicon CPU. It should be 4 or maybe 8 cores.

The same here on Linux and Intel i5, always only "1" cpu.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Apple Developer Transition Kit
« Reply #104 on: November 12, 2020, 02:46:34 pm »
System.GetCPUCount() always returns "1" on Apple Silicon CPU. It should be 4 or maybe 8 cores.

The same here on Linux and Intel i5, always only "1" cpu.

But maybe  GetCPUCount() return the number of CPU and not the number of cores inside the CPU.

If so, ok and sorry for the noise.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018