Forum > macOS / Mac OS X

Proposed changes to MacOS installation process documentation

(1/1)

Grahame Grieve:
I've just run through the process documented here (https://wiki.freepascal.org/Installing_Lazarus_on_macOS) on a brand new M1 Max. I also installed trunk FPC and Lazarus (for generics support). I eventually got it all working (yay!)

There's several issue on the page, but I couldn't get through the wiki registration and fix them myself.

1. SDK location for building FPC trunk

The page says to run

    make distclean all FPC=/usr/local/lib/fpc/3.2.2/ppcx64 OS_TARGET=darwin CPU_TARGET=x86_64 OPT="-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"

But in fact, that location is wrong for me. it would be useful for the page to mention (a) that this might differ on your machine and (b) that you find out the location using xcrun --show-sdk-path

On my system, the path is /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

2. Building Lazarus

In order to build Lazarus, I also had to provide the -XR option to the make command as well (like FPC). This is not a documented thing to do.

3. To rebuild Lazarus from within the IDE, I also had to add -XR{path} as an option in the Configure Build Lazarus dialog (the page doesn't talk about this, but it should, given the importance of rebuilding Lazarus)

This isn't an issue with the page, but it's a bit weird that you have to choose lldb during start up, even though the debugger is still configured to be GDB, and then you change the debugger setup later. But the page could usefully mention that the path for LLDB might be /usr/bin/lldb (it is for me, but who knows where Apple move things around to)

One last suggestion for the page... given how everything going M1, it would be good for the page to have the apple silicon commands explicitly shown, not just a note further up the page about to change them to suit M1.

finally, thanks to the community and particularly the maintainers for maintaining that page. There's no way you could install without it.

trev:

--- Quote from: Grahame Grieve on February 09, 2022, 04:44:25 am ---There's several issue on the page, but I couldn't get through the wiki registration and fix them myself.

1. SDK location for building FPC trunk

The page says to run

    make distclean all FPC=/usr/local/lib/fpc/3.2.2/ppcx64 OS_TARGET=darwin CPU_TARGET=x86_64 OPT="-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"

But in fact, that location is wrong for me. it would be useful for the page to mention (a) that this might differ on your machine and (b) that you find out the location using xcrun --show-sdk-path

On my system, the path is /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
--- End quote ---

The Wiki is correct; your location may work but is not recommended. As the Wiki notes, you do not need to install Xcode (which you have obviously done) but you do need to install the command line tools and if you have installed the command line tools, then the Wiki location is correct. Did you install the command line tools? You can use the Xcode tools, but then the fpc.cfg file needs adjusting to find them and is not recommended.


--- Quote ---2. Building Lazarus

In order to build Lazarus, I also had to provide the -XR option to the make command as well (like FPC). This is not a documented thing to do.

3. To rebuild Lazarus from within the IDE, I also had to add -XR{path} as an option in the Configure Build Lazarus dialog (the page doesn't talk about this, but it should, given the importance of rebuilding Lazarus)
--- End quote ---

Maybe this is related to your installation. I recently rebuild Lazarus 2.2.0 from within the IDE on a Mac mini M1 and did not have to add anything. There were other issues which I detailed in https://forum.lazarus.freepascal.org/index.php/topic,58045.0.html and which were confirmed by another user. Your experience is different possibly due to the way you installed.


--- Quote ---This isn't an issue with the page, but it's a bit weird that you have to choose lldb during start up, even though the debugger is still configured to be GDB, and then you change the debugger setup later. But the page could usefully mention that the path for LLDB might be /usr/bin/lldb (it is for me, but who knows where Apple move things around to)
--- End quote ---

Yes, that is mentioned in Step 5 "Configure the Debugger" complete with a picture showing where to enter it in the dialog :-)


--- Quote ---One last suggestion for the page... given how everything going M1, it would be good for the page to have the apple silicon commands explicitly shown, not just a note further up the page about to change them to suit M1.
--- End quote ---

I think that the number of Intel processor Macs currently dwarfs the number of M1-eqipped Macs. But you're right that in time this will be changed.

For every Lazarus and FPC release I run through all the instructions on that page to check that they are still accurate across multiple macOS versions -- OS X 10.8 (Mountain Lion), OS X 10.11 (El Capitan),  macOS 10.12 (Sierra),  macOS 10.13 (High Sierra), macOS 10.14 (Mojave),  macOS 10.15 (Catalina),  macOS 11 (Big Sur), macOS 12 (Monterey) with the last two tested on Intel and aarch64 processors -- and to keep the Wiki FPC + Lazarus Compatibility Matrix up to date.


--- Quote ---finally, thanks to the community and particularly the maintainers for maintaining that page. There's no way you could install without it.

--- End quote ---

You're welcome.

Grahame Grieve:
Well, I had to install XCode for other projects. So yes, I didn't just install the command line tools. (just? I'm not sure now - maybe I installed them before Xcode?) I'm going to guess that I'm not the only one who is in this boat. Still it wouldn't hurt to document xcrun, though of course people can find that out themselves, I know.

I didn't have to do anything extra to get an Apple silicon Lazarus - mine just is. Though it did something I've seen before at start up after rebuilding to install the anchor packages: it hung until I clicked the menu. Only the first time... weird.

Navigation

[0] Message Index

Go to full version