Recent

Author Topic: [SOLVED] Config and target setting for MacOS 64 bit App  (Read 763 times)

wittbo

  • New member
  • *
  • Posts: 46
[SOLVED] Config and target setting for MacOS 64 bit App
« on: March 06, 2019, 07:56:14 pm »
I'm just working with Lazarus on MacOS 10.14.3 Mojave and want to ensure, that I create a real 64 bit application. I found the necessary settings in project/settings/compiler/config and target. Actually all three fields contain <default>. As one can see, there is also possible:
OS            Darwin
CPU           X86_64
Processor   ATHLON64

What are really the correct settings?
And which settings are needed when compiling a 64bit application with Lazarus on MacOS 10.13 or earlier?

BTW:  What does it mean, when the option "Win32 GUI application is checked (default setting)?
« Last Edit: May 15, 2019, 02:57:56 pm by wittbo »
-wittbo-
Lazarus 2.0.0  with FPC 3.0.4
MacOS 10.14.3 MacOS 10.13

Trenatos

  • Sr. Member
  • ****
  • Posts: 496
  • Software developer - Open source contributor
    • MarcusFernstrom.com
Re: Config and target setting for MacOS 64 bit App
« Reply #1 on: March 11, 2019, 02:32:50 pm »
Those are the right settings to create x64 applications.

You probably also want to make sure it's set to Cocoa or Carbon (Depend on your target. I do everything against Cocoa)

lucamar

  • Hero Member
  • *****
  • Posts: 1485
Re: Config and target setting for MacOS 64 bit App
« Reply #2 on: March 11, 2019, 02:39:38 pm »
BTW:  What does it mean, when the option "Win32 GUI application is checked (default setting)?

It is intended to compile an application as a GUI program vs. a console one and is only relevant when compiling a Windows application. In all other platforms it's ignored.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4 & 2.0.2 w/FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8063
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Config and target setting for MacOS 64 bit App
« Reply #3 on: March 12, 2019, 02:54:44 pm »
It is intended to compile an application as a GUI program vs. a console one and is only relevant when compiling a Windows application. In all other platforms it's ignored.
But will still trigger compiler warning. In case you don't like, protect it between {$ifdef windows} ... {$endif} block. Well, that is if you use {$apptype gui} instead of -WG.

han

  • New member
  • *
  • Posts: 39
Re: Config and target setting for MacOS 64 bit App
« Reply #4 on: May 11, 2019, 05:08:26 pm »
To create MacOS 64 executables, I also had to do the following:

Go to
TOOLS, OPTIONS, Compiler executable (eg FPC):

old
/usr/bin/ppc386

and change that to:
/usr/bin/fpc

wittbo

  • New member
  • *
  • Posts: 46
Re: Config and target setting for MacOS 64 bit App
« Reply #5 on: May 15, 2019, 02:57:28 pm »
Thank you, han, for this important hint.
I myself found it some days ago. If you don't change the compiler executable, the application remains 32bit, whatever you may have set in the project settings.

I switched from 
old:   /usr/bin/ppc386   to
new: /usr/bin/ppcx64

and the application is really 64bit, checked by the MacOS process Manager.
-wittbo-
Lazarus 2.0.0  with FPC 3.0.4
MacOS 10.14.3 MacOS 10.13