Difference between revisions of "Installing Lazarus on macOS/es"

From Lazarus wiki
Jump to navigationJump to search
(Created page with "{{Installing Lazarus on macOS}} Instalar Lazarus en una Mac no es particularmente difícil pero es crítico que se haga en el orden correcto. Omitir pasos terminará con cert...")
 
Line 1: Line 1:
{{Installing Lazarus on macOS}}
+
{{Instalar Lazarus en MacOS}}
  
 
Instalar Lazarus en una Mac no es particularmente difícil pero es crítico que se haga en el orden correcto. Omitir pasos terminará con certeza en llanto. Al grano, aquí está lo que necesita hacer:
 
Instalar Lazarus en una Mac no es particularmente difícil pero es crítico que se haga en el orden correcto. Omitir pasos terminará con certeza en llanto. Al grano, aquí está lo que necesita hacer:
Line 15: Line 15:
 
== Instalación ==
 
== Instalación ==
  
Las instrucciones detalladas asumen una reciente versión de MacOS en su Mac, una versión reciente de Xcode y/o herramientas de comando en línea para Xcode de Apple y una versión reciente de Lazarus.  En la página [[#Legacy_Information|Legacy Information]], verá información anterior que pueda ser relevante si está usando componentes antiguos.  Puede asistir reemplazando la información desactualizada, tanto borrándola, o, si puede ayudar a alguien que trabaje con un proyecto legado, moverlo a la página  [[Legacy_Information:_Installing_Lazarus_on_Mac|legacy information]].
+
Las instrucciones detalladas asumen una reciente versión de MacOS en su Mac, una versión reciente de Xcode y/o herramientas de comandos en línea para Xcode de Apple y una versión reciente de Lazarus.  En la página [[#Legacy_Information|Legacy Information]], verá información anterior que pueda ser relevante si está usando componentes antiguos.  Puede asistir reemplazando la información desactualizada, tanto borrándola, o, si puede ayudar a alguien que trabaje con un proyecto legado, moverlo a la página  [[Legacy_Information:_Installing_Lazarus_on_Mac|legacy information]].
  
 
En general, esto es acerca de usar los Widget Set '''Carbon''' y ‘’’Cocoa’’’.  Mientras que Carbon se vio alguna vez como más estable, con el lanzamiento de Lazarus 2.0.8 el Widget Set Cocoa ha sobrepasado a Carbon y debería considerarse seriamente para cualquier proyecto nuevo.  Carbon se limitó intencionalmente a 32 bit por Apple y deberá estar consciente de que Carbon y la habilidad de ejecutar programas de 32 bits ha sido removido completamente de MacOS 10.15 Catalina y posteriores versiones las que sólo soportan ejecutables de 64 bits que usan Cocoa.
 
En general, esto es acerca de usar los Widget Set '''Carbon''' y ‘’’Cocoa’’’.  Mientras que Carbon se vio alguna vez como más estable, con el lanzamiento de Lazarus 2.0.8 el Widget Set Cocoa ha sobrepasado a Carbon y debería considerarse seriamente para cualquier proyecto nuevo.  Carbon se limitó intencionalmente a 32 bit por Apple y deberá estar consciente de que Carbon y la habilidad de ejecutar programas de 32 bits ha sido removido completamente de MacOS 10.15 Catalina y posteriores versiones las que sólo soportan ejecutables de 64 bits que usan Cocoa.
Line 29: Line 29:
 
Xcode 11.3.1 para usarse en MacOS 10.14 Mojave debe instalarse descargándolo desde (ADC) [http://developer.apple.com/ Apple Developer Connection], el cual es de registro gratuito.  Xcode 12.4.x para uso en MacOS 10.15 Catalina y posteriores versiones pueden instalarse desde [https://apps.apple.com/us/genre/mac-developer-tools/id12002?mt=12 Mac App store].  
 
Xcode 11.3.1 para usarse en MacOS 10.14 Mojave debe instalarse descargándolo desde (ADC) [http://developer.apple.com/ Apple Developer Connection], el cual es de registro gratuito.  Xcode 12.4.x para uso en MacOS 10.15 Catalina y posteriores versiones pueden instalarse desde [https://apps.apple.com/us/genre/mac-developer-tools/id12002?mt=12 Mac App store].  
  
Note que debe primero eliminar cualquier versión anterior de Xcode de la carpeta Aplicaciones o renombre Xcode app (p.e. Xcode.app a Xcode_1014.app).  Puede entonces seleccionar la versión de Xcode a usarse con la utilidad de comando en línea <tt>xcode-select</tt>.  Abrir una terminal Applications > Utilities > Terminal y teclear <tt>man xcode-select</tt> para el manual de utilidad.
+
Note que debe primero eliminar cualquier versión anterior de Xcode de la carpeta Aplicaciones o renombre Xcode app (p.e. Xcode.app a Xcode_1014.app).  Puede entonces seleccionar la versión de Xcode a usarse con la utilidad de comandos en línea <tt>xcode-select</tt>.  Abrir una terminal Applications > Utilities > Terminal y teclear <tt>man xcode-select</tt> para el manual de utilidad.
  
 
‘’’Sistemas Anteriores:’’’
 
‘’’Sistemas Anteriores:’’’
Line 41: Line 41:
  
  
=== Paso 2: Las Herramientas de Línea de Comando de Xcode ===
+
=== Paso 2: Las Herramientas de comandos en línea de Xcode ===
  
 +
Esto se muestra aquí como un paso aparte porque en serio es un paso aparte.  No confunda estas herramientas independientes de comandos en línea con las herramientas internas de comandos en línea de Xcode, las que le dirá el GUI de Xcode que ya había instalado aunque ya se había instalado el paquete completo de Xcode en el paso 1.  FPC no puede usar esas herramientas de comandos en línea internas sin los cambios de configuración  (ver [[Xcode]] para detalles).
  
This is shown here as a separate step because it really is a separate step. Don't confuse these standalone command line tools with the internal Xcode command line tools that the Xcode GUI will tell you are already installed if you installed the full Xcode package in Step 1. FPC cannot use those Xcode internal command line tools without configuration changes (see [[Xcode]] for details).
+
Haga lo siguiente, es rápido y fácil para todas las versiones de MacOS incluida Catalina 10.15:
  
Do the following, it is quick and easy for all macOS versions up to and including Catalina 10.15:
 
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 53: Line 53:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
For Big Sur 11.x and later, you only need to enter the first of the two commands above unless you have also installed the full Xcode package. If you have only installed the command line tools, you should omit entering the ''xcodebuild'' command.
+
Para Big Sur 11.x y posteriores, sólo necesita entrar el primero de los dos comandos arriba a menos que ya haya instalado el paquete completo de Xcode. Si sólo instaló las herramientas de comandos en línea, debería omitir hacer el comando ''xcodebuild''.
  
If you have problems installing the command line tools using this command line method (eg the installer freezes while "finding Software"), you can also download and install the command line tools package by logging in to the [https://developer.apple.com/download/more/?=for%20Xcode Apple Developer Site] and downloading and installing the ''Command Line Tools for Xcode'' disk image.
+
Si tiene problemas instalando las herramientas de comandos en línea usando este método de comandos en línea (p.e. el instalador se congela mientras que “busca Software”), puede también descargar e instalar el paquete de herramientas de comandos en línea ingresando en el sitio [https://developer.apple.com/download/more/?=for%20Xcode Apple Developer Site] luego descargar e instalar la imagen de disco de las ''Herramientas de comandos en línea para Xcode''.
  
=== Step 3: FPC binaries and FPC source code ===
+
=== Paso 3: binarios FPC código fuente FPC ===
  
{{Note| For Apple Silicon/AArch64/M1 installations, if you are installing FPC 3.2.2 (Lazarus 2.2RCx or 2.2.0 or later) you don't need to compile a native Apple Silicon version of FPC because FPC 3.2.2 for macOS is a universal binary containing both Intel and aarch64 executables. If you are installing a version of FPC earlier than 3.2.2, then please refer to [[macOS_Big_Sur_changes_for_developers#ARM64.2FAArch64.2FApple_Silicon_Support|these instructions]] for building a native Apple Silicon Free Pascal Compiler after installing the 64 bit Intel binary and source packages for FPC.}}
+
{{Note| Para las instalaciones Apple Silicon/AArch64/M1, si está instalando FPC 3.2.2 (Lazarus 2.2RCx or 2.2.0 o posteriores) no necesita compilar una versión nativa de FPC para Apple Silicon porque FPC 3.2.2 para MacOS es un binario universal que contiene ejecutables tanto para Intel como para aarch64. Si está instalando una versión de FPC anterior a la 3.2.2, entonces por favor refiérase a [[macOS_Big_Sur_changes_for_developers#ARM64.2FAArch64.2FApple_Silicon_Support|estas instrucciones]] para construir un Compilador de Free Pascal nativo para Apple Silicon después de instalar el binario de 64 bits de Intel y los paquetes fuente para FCP.}}
  
Download and install the official FPC binaries package and the separate FPC source package from the [https://sourceforge.net/projects/lazarus/files/ Lazarus IDE file area].  
+
Descargue e instale el paquete de binarios oficial de FPC y el paquete fuente de FPC por separado en el sitio [https://sourceforge.net/projects/lazarus/files/ Lazarus IDE file area].  
 +
 
 +
Cuando llegue al área de archivos del IDE de Lazarus:
  
When you arrive at the Lazarus IDE file area:
 
  
 
# Choose the correct version of your operating system. The vast majority of Mac users should now choose the 64 bit packages in the Lazarus macOS x86-64 directory. Every Mac computer since late 2006 has been 64 bit capable. The fact that Apple has completely dropped all 32 bit support from macOS 10.15 Catalina (released in October 2019) is another reason to choose the 64 bit packages.  
 
# Choose the correct version of your operating system. The vast majority of Mac users should now choose the 64 bit packages in the Lazarus macOS x86-64 directory. Every Mac computer since late 2006 has been 64 bit capable. The fact that Apple has completely dropped all 32 bit support from macOS 10.15 Catalina (released in October 2019) is another reason to choose the 64 bit packages.  

Revision as of 22:02, 27 February 2023

Template:Instalar Lazarus en MacOS

Instalar Lazarus en una Mac no es particularmente difícil pero es crítico que se haga en el orden correcto. Omitir pasos terminará con certeza en llanto. Al grano, aquí está lo que necesita hacer:

  1. Descargue e instale Xcode (opcional depende de sus necesidades - ver abajo para detalles).
  2. Instale las herramientas globales para comandos en línea para Xcode.
  3. Descargue e instale el paquete de binarios del Compilador de Free Pascal Compiler (FPC) y el paquete de los fuentes de FPC desde Lazarus IDE file area (Importante hágalo antes de instalar el IDE de Lazarus)
  4. Descargue e instale el IDE de Lazarus desde el área de archivo de Lazarus IDE
  5. Configure LLDB - el depurador que suministra (y firma) Apple desde adentro del IDE de Lazarus.

Estos pasos se explican en más detalle abajo.


Instalación

Las instrucciones detalladas asumen una reciente versión de MacOS en su Mac, una versión reciente de Xcode y/o herramientas de comandos en línea para Xcode de Apple y una versión reciente de Lazarus. En la página Legacy Information, verá información anterior que pueda ser relevante si está usando componentes antiguos. Puede asistir reemplazando la información desactualizada, tanto borrándola, o, si puede ayudar a alguien que trabaje con un proyecto legado, moverlo a la página legacy information.

En general, esto es acerca de usar los Widget Set Carbon y ‘’’Cocoa’’’. Mientras que Carbon se vio alguna vez como más estable, con el lanzamiento de Lazarus 2.0.8 el Widget Set Cocoa ha sobrepasado a Carbon y debería considerarse seriamente para cualquier proyecto nuevo. Carbon se limitó intencionalmente a 32 bit por Apple y deberá estar consciente de que Carbon y la habilidad de ejecutar programas de 32 bits ha sido removido completamente de MacOS 10.15 Catalina y posteriores versiones las que sólo soportan ejecutables de 64 bits que usan Cocoa.

Paso 1: Descargar Xcode (opcional)

Xcode es una descarga de 12GB la cual tomará hasta 16GB de espacio en disco. Sólo necesitará descargar e instalar el ambiente de desarrollo completo de Xcode si necesita:

  • el SDKs para iOS, iPadOS, watchOS y tvOS; ó
  • validar y subir aplicaciones a la Mac App Store; ó
  • para notarise apps para distribución fuera de la Mac App Store.

Xcode 11.3.1 para usarse en MacOS 10.14 Mojave debe instalarse descargándolo desde (ADC) Apple Developer Connection, el cual es de registro gratuito. Xcode 12.4.x para uso en MacOS 10.15 Catalina y posteriores versiones pueden instalarse desde Mac App store.

Note que debe primero eliminar cualquier versión anterior de Xcode de la carpeta Aplicaciones o renombre Xcode app (p.e. Xcode.app a Xcode_1014.app). Puede entonces seleccionar la versión de Xcode a usarse con la utilidad de comandos en línea xcode-select. Abrir una terminal Applications > Utilities > Terminal y teclear man xcode-select para el manual de utilidad.

‘’’Sistemas Anteriores:’’’

Las herramientas para desarrollador de Xcode pueden instalarse desde los discos de instalación originales de MacOS o una nueva copia descargada del sitio (ADC) Apple Developer Connection, el cual requiere de registrarse sin costo. Descargue el archivo Xcode, terminará en su directorio de Descargas como un archivo zip. Abralo. Se desactivará en su directorio de Descargas. Puede que le guste o no. Otros usuarios verán la ruta pero serán incapaces de usarla. Y ahí viene lo confuso. Así que moví el mío y luego escribí xcode-select a donde se movió (en una terminal) -


mv Downloads/Xcode.app /Developer/.
sudo xcode-select -s /Developer/Xcode.app/Contents/Developer


Paso 2: Las Herramientas de comandos en línea de Xcode

Esto se muestra aquí como un paso aparte porque en serio es un paso aparte. No confunda estas herramientas independientes de comandos en línea con las herramientas internas de comandos en línea de Xcode, las que le dirá el GUI de Xcode que ya había instalado aunque ya se había instalado el paquete completo de Xcode en el paso 1. FPC no puede usar esas herramientas de comandos en línea internas sin los cambios de configuración (ver Xcode para detalles).

Haga lo siguiente, es rápido y fácil para todas las versiones de MacOS incluida Catalina 10.15:


sudo xcode-select --install
sudo xcodebuild -license accept

Para Big Sur 11.x y posteriores, sólo necesita entrar el primero de los dos comandos arriba a menos que ya haya instalado el paquete completo de Xcode. Si sólo instaló las herramientas de comandos en línea, debería omitir hacer el comando xcodebuild.

Si tiene problemas instalando las herramientas de comandos en línea usando este método de comandos en línea (p.e. el instalador se congela mientras que “busca Software”), puede también descargar e instalar el paquete de herramientas de comandos en línea ingresando en el sitio Apple Developer Site luego descargar e instalar la imagen de disco de las Herramientas de comandos en línea para Xcode.

Paso 3: binarios FPC código fuente FPC

Light bulb  Nota: Para las instalaciones Apple Silicon/AArch64/M1, si está instalando FPC 3.2.2 (Lazarus 2.2RCx or 2.2.0 o posteriores) no necesita compilar una versión nativa de FPC para Apple Silicon porque FPC 3.2.2 para MacOS es un binario universal que contiene ejecutables tanto para Intel como para aarch64. Si está instalando una versión de FPC anterior a la 3.2.2, entonces por favor refiérase a estas instrucciones para construir un Compilador de Free Pascal nativo para Apple Silicon después de instalar el binario de 64 bits de Intel y los paquetes fuente para FCP.

Descargue e instale el paquete de binarios oficial de FPC y el paquete fuente de FPC por separado en el sitio Lazarus IDE file area.

Cuando llegue al área de archivos del IDE de Lazarus:


  1. Choose the correct version of your operating system. The vast majority of Mac users should now choose the 64 bit packages in the Lazarus macOS x86-64 directory. Every Mac computer since late 2006 has been 64 bit capable. The fact that Apple has completely dropped all 32 bit support from macOS 10.15 Catalina (released in October 2019) is another reason to choose the 64 bit packages.
  2. Choose the version of Lazarus you wish to install and you will be presented with the two FPC binary and source packages to download.

These installation packages are built by the FPC/Lazarus developers and track formal releases. As these installation packages are not approved by Apple, you need to hold down the Control key, click the package and choose Open and confirm you want to install from an Unknown Developer.

You might like to try a simple and quick test of FPC at this stage - Testing FPC installation.

Step 4: Install the Lazarus IDE

It is critical that a compatible Free Pascal Compiler (FPC) and its source must be installed before you install the Lazarus IDE.

Light bulb  Nota: For installation on Apple Silicon/AArch64, please refer to the Lazarus Fixes 2.2 or Lazarus development instructions to build a native Lazarus IDE. Skip to the building instructions and use the Lazarus Fixes 2.2 source / Lazarus development source download as you wish.

Download and install the Lazarus IDE from the Lazarus IDE file area. When you arrive at that file area, choose the correct version of your operating system. The vast majority of Mac users should now choose the 64 bit packages in the Lazarus macOS x86-64 directory. Every Mac computer since late 2006 has been 64 bit capable. The fact that Apple has completely dropped all 32 bit support from macOS 10.15 Catalina (released in October 2019) is another reason to choose the 64 bit packages.

Step 5: Configure the Debugger

In versions of Lazarus 1.8.4 and earlier, you needed to use gdb as a debugger, slow to install and hard to sign. Since Lazarus 2.0.0 you can (and should) use lldb, a debugger provided by Apple, no signing required.

Assuming you have installed what is necessary and started Lazarus, all that remains is configuring the debugger. If you don't do this now, Lazarus will try to use gdb and fail.

  • Lazarus version 2.2.0: First, click Lazarus > Preferences > Debugger - Debugger Backend;
  • Lazarus before version 2.2.0: First, click Tools > Options > Debugger.

Top right of the window now open has a label, "Debugger type and path", you must set both the type and the path. Select the type "LLDB debugger (with fpdebug) (Beta)" and select or type the path /usr/bin/lldb.

Set Debugger2.png

If "LLDB debugger (with fpdebug) (Beta)" is not shown in the selection list, see Installing LazDebuggerFpLLdb below. The XCode command line tools install lldb to the /usr/bin directory. Save those settings and you can now try to compile the almost nothing program that Lazarus has kindly provided for you (click the small green triangle near top left).

Next you see a puzzling question, see image below. Choose a "Debug Format" from one of those offered -

Set Dwarf.png

Martin_fr, the person who has given us this interface between the Lazarus IDE and lldb, suggests you use "dwarf3" . Then, you need to enter your password, a macOS cuteness because one application appears to be interfering with another. In this case, that's fine!

When running the debugger from time to time you will be asked for your password to allow debugging. This is for your own safety.

Extra Information on using lldb

A great deal of information about using lldb appears in this forum thread. Here are a few gems, again, from Martin_fr:

In the unexpected case of problems, it may be worth trying "dwarf with sets" instead of just "dwarf3".

The "debug info" setting only affects the units directly in your project. However, units in packages may have debug info too. This can be:

  • set per package
  • for many, but not all packages in the menu Tools > Configure "Build Lazarus"
  • Project > Project Options > Additions and Overrides

If you change settings for a package, you might want to check which package you expect to step into when debugging. Packages you do not step into, do not need debug info.

If you use a type from a package (such as TForm from LCL) it is enough that your unit (in which you declare the variable / must declare and use a variable to include the type) has debug info. Reducing the number of packages with debug info (including those that default to have debug info), can shorten the debuggers start-up time.

Also it may be worth comparing (it has not been tested) the debuggers start up time for the same settings, only changing the checkbox "use external debug info".

This needs to be only set in your project. If set in your project it will affect all packages. (If set in a package it should have no affect.)

Installing LazDebuggerFpLLdb

If you installed from source and used the bigide parameter to make, then the correct debugger will be installed, as a package, and ready to go. If, however, you installed in another way, it may, or may not be there.

From the main IDE screen, click Packages->Install/UninstallPackages. Shown is two lists of packages, the list on the left is installed, the list on the right is available to install. Look for LazDebuggerFpLldb (exactly that, there are some similar named but less suitable packages). If it is on the right hand side, click it, press "Install Selection" and then "Save and rebuild IDE". This will take a little time, the IDE will shutdown and restart and all should be well. Now jump back up the page and continue configuring the debugger.

Cocoa 64 bit vs Carbon 32 bit

Using the Apple 64 bit Cocoa framework is now undeniably the future on the Mac. The Apple 32 bit Carbon framework, while no longer being developed, works pretty much as expected, but you are advised to try Cocoa first because Apple dropped all support for 32 bit applications and the 32 bit Carbon framework in macOS 10.15 Catalina (October 2019).

It is possible to build a Cocoa version of the Lazarus IDE with v2.0.0 and later. It is also possible to build a Carbon version of the Lazarus IDE (unless you are running macOS 10.15 Catalina or later) and use that to generate Cocoa 64 bit binaries.

To produce Cocoa applications in the Carbon or Cocoa IDE, you need to set the Target to the 64 bit processor and select the Cocoa widgetset:

  • Open your project with Lazarus and from the menu select Project > Project Options
  • In the "Config and Target" panel set the "Target CPU family" to be "x86_64" (Intel) or "aarch64" (Apple M1)
  • In the "Config and Target" panel, if the "Current LCL widgetset" is not set to Cocoa, click "Select another LCL widgetset" which will take you to the "Additions and Overrides" panel where you can click on "Set LCLWidgetType" pulldown and set the value to "Cocoa"
  • Make sure under Tools > Options (Lazarus > Preferences in v2.2.0 and later) that "Compiler Executable" is set to "/usr/local/bin/fpc" to get 64 bit applications.
  • Now compile your project - and please feed back any problems you experience.

FPC + Lazarus Compatibility Matrix

Not every combination of Lazarus and Free Pascal is compatible with every installation of macOS. Please refer to the following table in order to find the correct version for your development environment:

Lazarus Compatibility Matrix
Lazarus 1.8.x Lazarus 2.0.y Lazarus 2.0.8 Lazarus 2.0.10 Lazarus 2.0.12 Lazarus 2.2.y
FPC 3.0.4 FPC 3.2.0 FPC 3.2.2
PPC processors
Mac OS X 10.4 (Tiger) Incompatible Incompatible Incompatible Incompatible Incompatible Incompatible Incompatible
Mac OS X 10.5 (Leopard) Not tested Not tested Incompatible Incompatible Incompatible Incompatible Incompatible
Intel processors
Mac OS X 10.4 (Tiger) Incompatible Incompatible Incompatible Incompatible Incompatible Incompatible Incompatible
Mac OS X 10.5 (Leopard) Not tested Compatible^ Not tested Compatible^** Not tested Not tested Not tested
Mac OS X 10.6 (Snow Leopard) Compatible Compatible^^ Not tested Not tested Not tested Not tested Not tested
Mac OS X 10.7 (Lion) Compatible Not tested Not tested Not tested Not tested Not tested Not tested
OS X 10.8 (Mountain Lion) Compatible^^ Compatible Compatible**# Compatible**# Compatible**# Compatible# Compatible
OS X 10.9 (Mavericks) Compatible^^ Compatible Compatible** Compatible** Not tested Not tested Not tested
OS X 10.10 (Yosemite) Compatible^^ Compatible Compatible** Compatible** Not tested Not tested Not tested
OS X 10.11 (El Capitan) Compatible^^ Compatible Compatible*** Compatible Compatible Compatible Comptaible
macOS 10.12 (Sierra) Compatible^^ Compatible Compatible*** Compatible Compatible Compatible Compatible
macOS 10.13 (High Sierra) Not tested Compatible Compatible*** Compatible Compatible Compatible Comptaible
macOS 10.14 (Mojave) Not tested Compatible Compatible*** Compatible Compatible Compatible Compatible
macOS 10.15 (Catalina) Not tested Compatible Compatible*** Compatible Compatible Compatible Compatible
macOS 11 (Big Sur) Not tested Compatible Compatible*** Compatible Compatible Compatible Compatible
macOS 12 (Monterey) Not tested Not tested Not tested Not tested Not tested Not tested Compatible
macOS 13 (Ventura) Not tested Not tested Not tested Not tested Not tested Not tested Compatible
macOS 14 (Sonoma) Not tested Not tested Not tested Not tested Not tested Not tested Compatible
Apple Silicon M series processors
macOS 11 (Big Sur) Not tested Not tested Not tested Compatible†† Compatible†† Compatible††† Compatible*
macOS 12 (Monterey) Not tested Not tested Not tested Compatible†† Compatible†† Compatible††† Compatible*
macOS 13 (Ventura) Not tested Not tested Not tested Compatible†† Compatible†† Compatible††† Compatible*
macOS 14 (Sonoma) Not tested Not tested Not tested Compatible†† Compatible†† Compatible††† Compatible*

x = 0, 2 or 4; y = 0, 2, 4 or 6

^ Carbon interface compiles - Cocoa does not.

^^ Restrictions apply to debugging with gdb.

* Lazarus 2.2.0 installs universal binaries for FPC 3.2.2, but an Intel Lazarus IDE binary which you can use or recompile the IDE from within itself for a native aarch64 version.

** See Installing Lazarus 2.0.8, 2.0.10 with FPC 3.2.0 for macOS 10.10 and earlier for instructions.

*** See Installing Lazarus 2.0.8 with FPC 3.2.0 for macOS 10.11+ for instructions.

# Cannot run without debugging in the IDE. Can run compiled application outside of the IDE. See Issue #37324. Choose the gdb debugger, change timeout option to false or click through five "timeout" dialogs to run with debugging in the IDE.

Cannot "run without debugging" in the IDE. Can run compiled application outside of the IDE. See Lazarus IDE - Unable to "run without debugging" for workaround. See Issue #36780.

†† You need to compile a native aarch64 version of FPC 3.3.1 (trunk) and Lazarus 2.0.12 from source to support an Apple Silicon M series processor. Refer to these instructions for FPC and these instructions for the Lazarus IDE.

††† After installing FPC 3.2.2, you need to compile a native aarch64 version of Lazarus from source to support an Apple Silicon M series processor. Refer to these instructions for compiling the Lazarus IDE.

See the legacy version of this compatibility matrix for recommended installs on very old versions of macOS.

Installing non-release versions of the Lazarus IDE

Lazarus Fixes 2.2

There are a number of reasons why you may be better off using a non-release version of Lazarus, specifically, fixes_2_2. Particularly:

  • You almost certainly need to target 64 bit Cocoa, macOS 10.15 Catalina and later do not support 32 bit Carbon at all.
  • The Cocoa widget set has steadily improved and the lldb debugger interface has rapidly improved, since even v2.0.0.
  • If your Mac has an Apple M1 Processor, the debugger in fixes_2_2 now works for aarch64.
  • Fixes_2_2 is a safer and more stable option than the development branch, but still gets the new features much faster than the release version.

Pre-compiled binaries based on fixes_2_2 are not available from SourceForge so we download and build from the source code. A little slow initially but very reliable and a great test of your compiler install ! You will need git which is included in all recent versions of the Xcode command line tools which you should have already installed (see Xcode Command Line Tools above).

About svn or git: The Xcode 11.4 command line tools on macOS 10.15 no longer install svn, only git. You can install subversion via fink, ports or brew.


  • When working with an Apple Silicon M1 processor Mac ensure you use the FPC 3.2.2 or later as it provides a universal binary with both a native aarch64 and Intel compiler. If you must use an earlier FPC than 3.2.2 see Apple Silicon Support for how to do this. When building the Lazarus IDE, change the CPU_TARGET in the instructions below from x86_64 (Intel 64 bit) to aarch64 (ARM 64 bit - Apple Silicon M1).

Downloading Lazarus Fixes 2.2 source

Create a directory for Lazarus and download the current fixes version:

cd
mkdir -p bin/lazarus
cd bin/lazarus

Using git:

git clone -b fixes_2_2 https://gitlab.com/freepascal.org/lazarus/lazarus.git laz_fixes

Using svn:

svn checkout https://github.com/fpc/Lazarus/branches/fixes_2_2 laz_fixes

Depending on your internet connection and server congestion this takes a few seconds or a few minutes.

Updating Lazarus Fixes 2.2 source

To keep your fixes_2_2 installation up to date is as easy as:

Using git:

cd ~/bin/lazarus/laz_fixes
git clean -f -d
git pull

Using svn:

cd ~/bin/lazarus/laz_fixes
svn clean --remove-unversioned
svn update

Building Lazarus Fixes 2.2 source

cd laz_fixes
make distclean all LCL_PLATFORM=cocoa CPU_TARGET=x86_64 bigide
//-wait some time...
open startlazarus.app --args "--pcp=~/.laz_fixes"
  • Note I pass a parameter to use a config directory that is based on the name of the actual install directory. It makes some scripting easy.
  • On older macOS versions supporting 32 bit applications, replace the above make line with "make LCL_PLATFORM=carbon CPU_TARGET=i386 bigide " and set up your project as mentioned in the Carbon and Cocoa section below.

You might like to put a small script in your $HOME/bin directory and even set a path to it (very UNIX!)

#!/bin/bash
LAZDIR="laz_fixes"
cd ~/bin/lazarus/"$LAZDIR"
open ~/bin/lazarus/"$LAZDIR"/lazarus.app --args "--pcp=~/.$LAZDIR"

Lazarus development version

Precompiled binaries based on the development version (was known as "trunk" in SVN; now known as "main" in GIT) of the Lazarus IDE are not available from SourceForge, so here's how to download the development version source using svn or git and build the Lazarus IDE. You will need svn (before macOS 10.15 - Catalina) or git (after macOS 10.14 - Mojave) which is included in the standalone Xcode command line tools which you should have already installed (see Xcode Command Line Tools above).


  • When working with an Apple Silicon M1 processor Mac ensure you use the FPC 3.2.2 or later as it provides a universal binary with both a native aarch64 and Intel compiler. If you must use an earlier FPC than 3.2.2 see Apple Silicon Support for how to do this. When building the Lazarus IDE, change the CPU_TARGET in the instructions below from x86_64 (Intel 64 bit) to aarch64 (ARM 64 bit - Apple Silicon M1).

Downloading Lazarus development version source

cd
mkdir -p bin/lazarus
cd bin/lazarus

Using git:

git clone -b main https://gitlab.com/freepascal.org/lazarus/lazarus.git laz_main

Using svn:

svn checkout --depth files https://github.com/fpc/Lazarus/branches all
cd all
svn update --set-depth infinity main

The above svn invocation is more complex due to a bug in many versions of Subversion. This workaround was the work of Alfred (aka Don Alfredo in the Forum) who is the wizard behind fpcupdeluxe.

Updating Lazarus development version source

To update your existing Lazarus development version source.

Using git:

cd ~/bin/lazarus/laz_main
git clean -f -d
git pull

Using svn:

cd ~/bin/lazarus/laz_trunk
svn cleanup --remove-unversioned
svn update

Building Lazarus development version source

make distclean all LCL_PLATFORM=cocoa CPU_TARGET=x86_64 ide

or, or bigger IDE:

make distclean all LCL_PLATFORM=cocoa CPU_TARGET=x86_64 bigide

After one of above commands, wait some time and:

open startlazarus.app --args "--pcp=~/.laz_dev"

What does the bigide make argument do?

The bigide make argument adds a bunch of packages to Lazarus that many find useful and cannot do without. The packages that are added are:

  • cairocanvas
  • chmhelp
  • datetimectrls
  • externhelp
  • fpcunit
  • fpdebug
  • instantfpc
  • jcf2
  • lazcontrols
  • lazdebuggers
  • lclextensions
  • leakview
  • macroscript
  • memds
  • onlinepackagemanager
  • pas2js
  • PascalScript
  • printers
  • projecttemplates
  • rtticontrols
  • sdf
  • sqldb
  • synedit
  • tachart
  • tdbf
  • todolist
  • turbopower_ipro
  • virtualtreeview

The above list is sourced from the [Lazarus source directory]/IDE/Makefile.fpc and may be subject to change.

Note that if you have not compiled your own Lazarus IDE with the bigide argument, you can install any of these packages yourself using the Lazarus IDE Package > Install/Uninstall Packages... dialog.

Installing non-release versions of FPC

Installing from source

There are two current non-release branches of the Free Pascal Compiler: the development (trunk) branch and the Fixes 3.2 branch which includes additional fixes to the released 3.2.2 version. Developers, and those who like living on the bleeding edge and testing new features and fixes, will choose the development version; more normal users, who wish to use a stable branch with some additional fixes since the latest release version, will choose the Fixes branch. The instructions below cover both these branches.

The source code is kept in a version control system called git:

  • macOS 10.5 and higher already contain a command line git client if you have installed the Xcode command line utilities.
  • You also need the latest released Free Pascal Compiler version (3.2.2 as of March 2022) installed in order to be able to successfully compile the development (trunk) version.
Light bulb  Nota: When building a native aarch64 Free Pascal Compiler (ppca64) for an Apple Silicon M1 processor Mac, change the CPU_TARGET in the instructions below from x86_64 (Intel 64 bit) to aarch64 (ARM 64 bit - Apple Silicon M1) and change any reference to ppcx64 to ppca64

FPC development version

Note that since the development version of FPC (was known as "trunk" in SVN; now known as "main" in GIT) is by definition still under development, some of the features may still change before they end up in a release version.

Create a directory where you would like to put the source (eg fpc_main in your home directory). You don't need to be root to do this. Any normal user can do this. Open an Applications > Utilities > Terminal and do the following:

 []$ git clone -b main https://gitlab.com/freepascal.org/fpc/source.git fpc_main

This will create a directory called fpc_main and download the FPC main source to it.

To subsequently update your local source repository with the latest source changes you can simply do:

 []$ cd
 []$ cd fpc_main
 []$ git clean -f -d
 []$ git pull

To build and install FPC (the highlighted text should be all on one line):

 []$ cd
 []$ cd fpc_main
 []$ 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/"
 []$ sudo make install FPC=$PWD/compiler/ppcx64 OS_TARGET=darwin CPU_TARGET=x86_64

You will also need to update the links for the compiler in /usr/local/bin which will be pointing to the previous FPC version. For example:

 []$ cd /usr/local/bin
 []$ sudo rm ppc386
 []$ sudo rm ppcx64
 []$ sudo ln -s /usr/local/lib/fpc/3.3.1/ppc386
 []$ sudo ln -s /usr/local/lib/fpc/3.3.1/ppcx64

Note that you will need to build a new ppc386 compiler if you want to continue to compile 32 bit applications by replacing these lines (this is not be possible after Xcode 11.3.1 and macOS 10.14.6 Mojave because of Apple's removal of the 32 bit frameworks):

 []$ make clean 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/"
 []$ sudo make install FPC=$PWD/compiler/ppcx64 OS_TARGET=darwin CPU_TARGET=x86_64

with these two lines:

 []$ make clean all FPC=/usr/local/lib/fpc/3.2.2/ppc386 OS_TARGET=darwin CPU_TARGET=i386 OPT="-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"
 []$ sudo make install FPC=$PWD/compiler/ppc386 OS_TARGET=darwin CPU_TARGET=i386

FPC Fixes 3.2

Create a directory where you would like to put the source (eg fpc_fixes32 in your home directory). You don't need to be root to do this. Any normal user can do this. Open an Applications > Utilities > Terminal and do the following:

 []$ git clone -b fixes_3_2 https://gitlab.com/freepascal.org/fpc/source.git fpc_fixes32

This will create a directory called fpc_fixes32 and download the FPC source to it.

To subsequently update your local copy of the repository source with the latest source changes you can simply do:

 []$ cd fpc_fixes32
 []$ git clean -f -d
 []$ git pull

To build and install FPC (the highlighted text should be all on one line):

 []$ cd
 []$ cd fpc_fixes32
 []$ 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/"
 []$ sudo make install FPC=$PWD/compiler/ppcx64 OS_TARGET=darwin CPU_TARGET=x86_64

You will also need to update the links for the compiler in /usr/local/bin which will be pointing to the previous FPC version. For example:

 []$ cd /usr/local/bin
 []$ sudo rm ppc386
 []$ sudo rm ppcx64
 []$ sudo ln -s /usr/local/lib/fpc/fixes-3.2/ppc386
 []$ sudo ln -s /usr/local/lib/fpc/fixes-3.2/ppcx64

Note that you will need to build a new ppc386 compiler if you want to continue to compile 32 bit applications by replacing these lines (this may not be possible after Xcode 11.3.1 and macOS 10.14.6 Mojave because of Apple's removal of the 32 bit frameworks):

 []$ make clean all FPC=/usr/local/lib/fpc/3.2.2/ppc386 OS_TARGET=darwin CPU_TARGET=i386 OPT="-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"
 []$ sudo make install FPC=$PWD/compiler/ppc386 OS_TARGET=darwin CPU_TARGET=i386

Known issues and solutions

Lazarus IDE v2.2.0 - rebuilding issue

Any attempt to rebuild the Lazarus IDE from within itself fails with permission errors because the files and directories are owned by a user with the id of 503 whereas most users will find that their id is 501. The solution is to open an Applications > Utilities> Terminal and:

cd /Applications
sudo chown -R your_username Lazarus

The following rebuilding errors do not happen on Intel computers

The next error that occurs is that the resource compiler "fpcres" is not found. The solution is to create a .fpc.cfg (note the initial dot) file in your home directory and add these lines to it:

#include /etc/fpc.cfg
-FD/usr/local/bin

so that "fpcres" can be found where it was installed.

The next error complains of an unsupported target architecture -Paarch64, with the advice to invoke the "fpc" compiler driver instead - except that is what we are doing already. The solution is to go to Lazarus > Preferences > Compiler executable which is set to /usr/local/bin/fpc and change that to /usr/local/lib/fpc/3.2.2/ppca64 instead.

The IDE will now be successfully rebuilt but will not restart automatically. Trying to then start Lazarus from either the startlazarus.app icon or the lazarus.app icon in /Applications/Lazarus still results in the original Intel lazarus binary being launched. The correct aarch64 binary can be found in ~/.lazarus/bin/aarch64-darwin/lazarus. So the final solution is to open an Application > Utilities > Terminal and:

mv /Applications/Lazarus/lazarus /Applications/Lazarus/lazarus.old
mv  ~/.lazarus/bin/aarch64-darwin/lazarus /Applications/Lazarus/

You can then start the IDE with either the startLazarus.app or lazarus.app icons. When you do restart lazarus, it is worth returning to the Lazarus > Preferences > Compiler executable which is set to /usr/local/lib/fpc/3.2.2/ppca64 and changing it back to /usr/local/bin/fpc so that you can compile both aarch64 and Intel binaries to, for example, make a Universal Binary which will run on both Intel and aarch64 machines.

Lazarus IDE - Unable to "run without debugging"

If you are using the Lazarus IDE 2.0.10 and the Run > Run without debugging menu option fails with a dialog similar to:

run dialog fail.png

then you need to patch the Lazarus 2.0.10 source code (Issue #37324 and Issue #36780). Specifically, patch ../ide/main.pp as below (unpatched lines shown first, patched lines shown second):

 7243,7245c7243,7245
 <     if RunAppBundle
 <         and FileExistsUTF8(Process.Executable)
 <     and FileExistsUTF8('/usr/bin/open') then
 ---
 >     if RunAppBundle then
 >     //    and FileExistsUTF8(Process.Executable)
 >     //and FileExistsUTF8('/usr/bin/open') then

and recompile the Lazarus IDE.

Alternatively, you can omit patching the source code and simply recompile Lazarus 2.0.10 with FPC 3.0.4.

A similar patching exercise and recompiling, or simply recompiling with FPC 3.0.4, needs to be done for Lazarus 2.0.8 if it has been compiled with FPC 3.2.0.

Upgrading from Mojave (10.14) to Catalina (10.15)

  • Run sudo xcode-select --install
  • To enable Lazarus to locate the crt1.10.5.o file change in /etc/fpc.cfg the -Fl behind "#ifdef cpux86_64" from
-Fl/Applications/Xcode.app/Contents/Developer/Toolchain...

to

-Fl/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/

Building the FPC compiler from Mojave (10.14) onwards

  • To find the crt1.10.5.o file when building a later Free Pascal Compiler version from source, you need to specify:
 OPT="-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/"

on the make command line because FPC ignores the /etc/fpc.cfg configuration file during builds of itself.

Mac Installation FAQ

  • See the Mac Installation FAQ for solutions to other common problems that may arise during (and after) installation of Lazarus and Free Pascal on macOS.

Uninstalling Lazarus and Free Pascal

Refer to Uninstalling Lazarus on macOS for uninstallation options.

Legacy Information

See Legacy Information for details of:

  • Installing Lazarus on Mac OS X 10.4 (Tiger), Mac OS X 10.5 (Leopard), OS X 10.8 (Mountain Lion)
  • Installing Lazarus 2.0.8, 2.0.10 with FPC 3.2.0 for macOS 10.10 and earlier
  • Installing Lazarus 2.0.8 with FPC 3.2.0 for macOS 10.11+
  • Installing Lazarus on PowerPC-based Macs
  • Old Xcode versions
  • Installing the gdb debugger
  • Compatibility matrix for Lazarus 1.0.0 through 1.6.4 and FPC 2.6.0 through 3.0.2.

See also

External links