Recent

Author Topic: How to create a 64-bit program on MacOSX El Capitan  (Read 5021 times)

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
How to create a 64-bit program on MacOSX El Capitan
« on: February 28, 2018, 11:59:10 am »
I am exploring the option of making a 64-bit app on Mac OSx El Capitan with Lazars


How do i start?
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

mischi

  • Full Member
  • ***
  • Posts: 170
Re: How to create a 64-bit program on MacOSX El Capitan
« Reply #1 on: February 28, 2018, 01:18:20 pm »
Hi

The first step is the 64bit compiler of fpc. If not using fink, then you need to download the compiler AND its sources. The following command creates the 64 bit compiler:

make clean all OPT="-ap" CPU_TARGET=x86_64 OS_TARGET=darwin

after a successful build

"sudo make install" should install it.

As you may know the carbon based lcl will not work, since it is 32 bit only. These are your choices using Lazarus:

1) cocoa-lcl
It may not have all components, but is closest to "native" look and feel.
2) qt-lcl
More components than cocoa-lcl, still fairly close to "native" look and feel. Needs the installation of qt4.
3) gtk2-lcl
Probably the largest number of components, but could be further from a "native" look. Needs the installation of all the gtk libs.

I prepared package description for fink, the Debian like package manager. Installing fink is some work, but once that is done, choosing and switching between the three options above is easy. Fink takes care of all dependencies, i.e. fpc and lazarus as required, qt and/of gtk2 libraries and so on.

If you do not want to use Lazarus and the lcl, then you can go really "native" using Xcode for the design of the UI and plugin your pascal code. Phil is the expert on this.

I hope this gives you a rough idea and directions about your options.

MiSchi

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: How to create a 64-bit program on MacOSX El Capitan
« Reply #2 on: February 28, 2018, 04:05:12 pm »
i am a total nitt-witt....
so where, aka what directory, should i make the 'Make'-command?
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: How to create a 64-bit program on MacOSX El Capitan
« Reply #3 on: February 28, 2018, 04:07:56 pm »
i am a total nitt-witt....
so where, aka what directory, should i make the 'Make'-command?

Here are some notes from last summer that might help you:

https://macpgmr.github.io/MacXPlatform/UsingCocoaFromTrunk.html

Enter make at top level of Laz SVN checkout.

Trenatos

  • Hero Member
  • *****
  • Posts: 535
    • MarcusFernstrom.com
Re: How to create a 64-bit program on MacOSX El Capitan
« Reply #4 on: February 28, 2018, 04:16:15 pm »
Just use fpcupdeluxe, super easy to install various versions as well as cross compilers and cross architecture compilers: https://github.com/newpascal/fpcupdeluxe/releases

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: How to create a 64-bit program on MacOSX El Capitan
« Reply #5 on: March 04, 2018, 10:28:30 am »
You would not need a 64 bit IDE to compile 64 bit applications.


You would however need to set your Target in the IDE.


Go to the "Project" menu and click "Project Options".
Under the "Compiler options", choose "Config and Target" and set the "Target CPU family" to "x86_64".


Since 64 bit application do not like Carbon, you'll have to switch to Cocoa;
At the bottom you'll see "Current LCL widgetset" where you can click "Select anther LCL widgetset" - click this, which will bring you to the "additions and overrrides" section where you can click "Set LCLWidgetType".
Choose "value "Cocoa"" and click OK.


Your project will now be compiled in 64bit with the appropriate Cocoa widgetset.


Please keep in mind that Cocoa is still under development. If you run into issues, report them in the Lazarus Bug Tracker.
hope this is what you're looking for.

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
Re: How to create a 64-bit program on MacOSX El Capitan
« Reply #6 on: March 07, 2018, 10:28:39 pm »
i have a old macbook pro from early 2008 and thats an i386.
can this work then?

You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

Josh

  • Hero Member
  • *****
  • Posts: 1271
Re: How to create a 64-bit program on MacOSX El Capitan
« Reply #7 on: March 07, 2018, 10:48:41 pm »
From what I remember anything after Moutain Lion is 64Bit OS that can run 32bit code, with the upcoming updates to Hi Sierra the 32bit compatibilty is being phased out and then removed, so any new applications you create you will need to test for the 64bit using the cocoa widgetset.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: How to create a 64-bit program on MacOSX El Capitan
« Reply #8 on: March 07, 2018, 10:50:37 pm »
i have a old macbook pro from early 2008 and thats an i386.
can this work then?
Uh, you're running El Capitain. That's a x86-64 Platform. See https://en.wikipedia.org/wiki/OS_X_El_Capitan
So your machine should be 64 bit.

See here: https://everymac.com/systems/apple/macbook_pro/specs/macbook-pro-core-2-duo-2.4-15-early-2008-penryn-specs.html

Although you won't be able to upgrade to Sierra (mid 2010 needed) or High Sierra (also mid 2010 needed) you should be able to run 64 bit applications. Cocoa is still knows to be unstable but you could try it.

I'm not familiar with the current state of development of the widgetsets for Lazarus but you have Carbon (soon to be extinct), Cocoa (still unstable?), qt and qt5 (gtk's not mentioned on purpose).

Also read https://forum.lazarus.freepascal.org/index.php/topic,37574.0.html

Going with Cocoa and reporting any bugs and supporting the development seems like the best choice.
« Last Edit: March 07, 2018, 10:53:47 pm by rvk »

madref

  • Hero Member
  • *****
  • Posts: 949
  • ..... A day not Laughed is a day wasted !!
    • Nursing With Humour
You treat a disease, you win, you lose.
You treat a person and I guarantee you, you win, no matter the outcome.

Lazarus 3.99 (rev main_3_99-649-ge13451a5ab) FPC 3.3.1 x86_64-darwin-cocoa
Mac OS X Monterey

 

TinyPortal © 2005-2018