Pascal Compilers For Mac
2021年2月10日Download here: http://gg.gg/o9o72
MinGW - Minimalist GNU for Windows. A native Windows port of the GNU Compiler Collection (GCC). GNU Pascal for Mac OS X. Updated: 4/5/03 GNU Pascal for Mac OS X. A free Pascal compiler for the Macintosh, and continually updated! Please note that the port to Mac OS X is in an early state of development. Also note that there are differences between GNU Pascal and traditional Macintosh Pascal compilers. Lazarus is a free cross-platform visual integrated development environment (IDE) for rapid application development (RAD) using the Free Pascal compiler. Its goal is to provide an easy-to-use development environment for programmers developing with the Object Pascal language, which is. The packages and runtime library come under a modified Library GNU Public License to allow the use of static libraries when creating applications. The compiler source itself comes under the GNU General Public License. The sources for both the compiler and runtime library are available; the complete compiler is written in Pascal.
*Pascal Compiler Mac Os X
*Pascal Compiler For Mac
*Free Pascal Compiler For Windows 10
*Pascal Compiler For Mac
*Mac Os X Pascal Compiler
Welcome to the FreePascal on the Macintosh page. Here is information especially for you who want to write a program for the Macintosh. News:2009-02-09:
The download statistics indicate that the snapshots below are still downloaded a lot. Note that all fixes from those snapshots are also in the official release of FPC 2.2.2 (and will be also in later versions, when they become available), which was released in August 2008. Since FPC 2.2.2 also contains many additional fixes, we recommend you to use that version. It is available from the regular download pages. 2007-11-14:
There are some errors in the new linker shipped with Xcode 3.0/Mac OS X 10.5. A detailed overview was posted to the fpc-pascal mailing list. We have worked around most of those issues and created (stable) development snapshots for both PowerPC and Intel. These are intended to be installed on top of the 2.2.0 release version. Future releases will have these fixes incorporated.
One linker bug cannot be completely worked around in the compiler, which is related to the Stabs debugging format. For this reason, we recommend to switch to the Dwarf debugging format on Mac OS X 10.5. On the command line, you can do this by using -gw instead of -g to generate debugging information. In the Xcode projects, add -gw at the end of the FPC_SPECIFIC_OPTIONS project setting for the Debug configuration. 2006-08-27:
Regular snapshots of FPC 2.1.1 (both for PowerPC and for Intel - the latterdenoted as i386) are now generated by and available from the Lazarus team.
If you only need the compiler (to either use it from the command line or from Xcode),you only have to download and install the ’fpc’ package.
2005-12-18:
Version 2.0.2 that was released a few weeks ago has all fixes and improvements of the 2.1.1 snapshot that was here (like Mac Pascal style objects and creationof dynamic libraries). Additionally, it doesn’t suffer from the installationproblems the 2.1.1 snapshot installer had. Get the release here.
2005-07-23:
The 2.1.1 snapshot that was here is no longer available.
If you really need to be up to date with FPC,please consider using Subversion, and build the compiler by your self.
Some changes:
* No more ’_main’ symbol in the system unit (so can link with C main programs)
* Shared library creation support under Mac OS X
* Several bugfixes related to overflow checking on PPC 2005-06-29:
There is now a wiki page covering porting issues, from traditional mac pascals to FPC.
2005-06-21:
A FPC 2.1.1 snapshot is available here (10.8 MB, does not include the PDF documentation). It includes:
* Support for Macintosh Object Pascal in Macpas mode (includes support for mixing in Delphi-style OOP programming in Macpas mode, except that you have to use ’object’ instead of ’class’ everywhere -- all occurrences of ’class’ are simply internally replaced by the _OBJECT compiler token)
* Fixed bug which caused stack corruption in procedures receiving floating point parameters and parameters on the stack (only if the caller side was compiled by FPC)
* Fixed bug in overflow checking of integer operations (some calculations were buggy if overflow checking is turned on, which is the case in the default development building style of Xcode if you use the integration kit)
* Fixed bug in division of unsigned numbers > $7fffffff by a power of 2 Should you desire to do so, you can switch back to 2.0 by simplyinstalling the 2.0 package again.
2005-05-15:
At last !!!!! Free Pascal 2.0 is released for Mac OS X and classic Mac OS,as well as for other targets.
This means Free Pascal for the mac is not considered beta anymore.Get it on one of the mirror download sites.
Targets on the Macintosh:Target / Processor Status Remark Contact
final
For Mac OS X
final
Target Mac OS means classic Mac OS, up to System 9.x. Although it of course also work in the classic environment in Mac OS X
Mac OS on M68K
not planned
If someone is interrested to contribute, there is a possiblity to implement this target. There is support for MC68000 in the FPC source code, although not updated for a while. Mac Pascal dialectThe dialect of Pascal supported by popular Pascals on Macintosh is supported in part. Read more here.
Free Pascal 2.0 for Mac OS X is the current release. It should at least work on Mac OS X 10.1 and higher. It requires that you have installed XCode from Apple, to have assembler, linker and make tools available to fpc. For older versions of Mac OS X you should install Apple Development Tools instead. Both can be downloaded for free from Apple, but requires that you register yourself as a member of Apple Developer Connection. Both are also included in the Mac OS X bundle.
To download, go to the Download page, and choose a mirror site near you (to limit net traffic). The documentation is included, but can also be downloaded separatelly. If you want the source code, it has to be downloaded separatelly.There most recent FPC 2.1.1 snapshot is available here (10.4 MB)with, among others, support for mac style object pascal. See above under NEWS.
Note that the compiler is a unix style program and is run from the Terminal on Mac OS X.
Please report any bugs encountered.Using FPC from XCodeIt is possible to use Free Pascal from within XCode (Mac OS X 10.3 is required).Look at the step-by-step instruction of how to download and install the XCode Integration Kit. Thanks to Rolf Jansen for this contribution.
Free Pascal 2.0 for Mac OS is the current release. It will work on latest classic Mac OS (that is 9.2.2) and below, probably down to 7.1.2 (the first Mac OS for PowerPC), and also in the classic compatibility environment on Mac OS X. However it has only been tested on Mac OS 9 and Mac OS X classic environment.
It requires that you have installed Macinstosh Programmers Workshop (MPW) which can be downloaded for free from Apple.
To download, go to the Download page, and choose a mirror site near you (to limit net traffic). The documentation, as well as the source code (if you need it), has to be downloaded separatelly.
Note that the compiler is an MPW tool.
Please report any bugs encountered.Current status of classic Mac OS
Native FPC compiler (as an MPW tool)
Almost complete
Unit System.pp
Complete
The system unit is implicitly used by every program. Contains basic file and memory handling among others.
Unit Dos.pp
Complete
Contrary to what its name suggests, the DOS unit is cross plattfrom and contains utility routines for file and date handling, beyond that in System.pp. It is reminiscent from Turbo Pascal.
Unit Sysutils.pp
Planned
A moderner alternative to unit DOS, compatible with Delphi.
Unit MacOS
Complete
API to the Macintosh Toolbox
Units strings objpas heaptrc getopts etc
Implemented.
They are target independent.
Other units
Non-existent. Some will be implemented.
Implementation will depend on how important the unit is and if difficulties arise. Debugging
There is some limited possibilities to debug programs in classic Mac OS. See MPW debugging in the wiki.
As an alternative, you might do the main debugging in a Mac OS X/Darwin version of your program.
There are three major Pascal dialects: Turbo Pascal (extended to Delphi, supported by FreePascal, and partially by Gnu Pascal), Extended Pascal (an ISO standard, supported by Gnu Pascal, DEC Pascal, Prospero Pascal), and the dialect originating from Apple (commonly used in the Mac community, supported by MPW Pascal, Metrowerks Pascal and Think Pascal). We call this dialect Mac Pascal and there is a special language mode for it: MacPas.
Mode MacPas is a compatibility mode. It is probably not possible to mimic the Mac Pascal dialect in detail. So the goal is to implement often used constructs, if this doesn’t require too much effort, as well as easy-to-implement constructs.
To use MacPas, add -Mmacpas to the command line or insert the compiler directive {$MODE MACPAS} in the source code.
Note that the mac pascal dialect and mac targets are not interrelated. It is thus possible to write a mac program with the turbo dialect and to write a Windows program with the mac dialect.
The following are supported: Mac compiler directives like $SETC, $IFC, $ELSEC, $ENDC, $J, $Z. Most of the constructs found in interface files, especially Apples Universal Interfaces. Cycle, Leave, Otherwise. More is planned.
More updated info on the Wiki page.
By Olle Raab
For questions and suggestions, we suggest subscribing on our mailing lists , in particular FPC-pascal for questions about using Free Pascal.
Or write to olle.raab@freepascal.orgPascal Compiler Mac Os X
Latest modified 2005-07-28
│English (en) │ 한국어 (ko) │ русский (ru) │
This article applies to macOS only.
See also: Multiplatform Programming Guide
Note: For installation on Apple Silicon/AArch64, please refer to Apple Silicon Support.
Installing Lazarus on a Mac is not particularly difficult but it is critical that you do the install in the correct order. Skipping steps will almost certainly lead to tears. In brief, here is what you need to do:
*Download and install Xcode.
*Install the global command line tools for Xcode.
*Download and install the Free Pascal Compiler (FPC) binaries and the FPC source from the Lazarus IDE file area (Important do this before you install the Lazarus IDE)
*Download and install the Lazarus IDE from the Lazarus IDE file area
*Configure LLDB - the Apple supplied (and signed) debugger from within the Lazarus IDE.
These steps are explained in more detail below.
*1Installation
*1.3Step 3: FPC, FPC Source
*1.3.2Other FPC Options
*1.5Step 5: Configure the Debugger
*4Installing non-release versions of the Lazarus IDE
*5Installing non-release versions of FPC
*6Known issues and solutions
*6.2Installing Lazarus 2.0.8, 2.0.10 with FPC 3.2.0 for macOS 10.10 and earlier
*7Uninstalling Lazarus and Free PascalInstallation
The detailed instructions assume a recent version of macOS on your Mac, a recent version of Xcode from Apple and a recent version of Lazarus. On the Legacy Information page, you will see older information that may be relevant if you are using older components. You can assist by replacing out of date info, either deleting it, or, if it may help someone working with a legacy project, moving it to the bottom of the page.
In general, this is about using both the Carbon and Cocoa Widget Set. While Carbon was once seen as a little more stable, with the release Lazarus 2.0.8 the 64 bit Cocoa Widget Set has now surpassed Carbon and should be considered seriously for any new projects. Carbon was intentionally (by Apple) limited to 32 bits and you should be aware that it has been removed completely from macOS 10.15 Catalina which only supports 64 bit Cocoa. Step 1: Download Xcode
You need the Apple Developer tools, which are a part of the Xcode development environment.
Xcode 11.3.1 for use on macOS 10.14 Mojave must now be installed by downloading it from Apple Developer Connection (ADC), which requires free registration. Xcode 11.4.x for use on macOS 10.15 Catalina can be installed from the Mac App store. Note that you must first move any old Xcode versions from the Applications folder into the trash or rename the Xcode app (eg Xcode.app to Xcode_1014.app). You can select which version of Xcode to use with the command line utility xcode-select.
Older systems:
The developer tools can be installed from the original macOS installation disks or a newer copy downloaded from the Apple Developer Connection (ADC), which requires free registration. Download the Xcode file, it will end up in your Downloads directory as a zip file. Click it. It is unarchived into your Downloads directory. You may be happy with it there but maybe not. Other users will see the path to it but be unable to use it. And it is untidy there. So I moved mine and then told xcode-select where it was moved to (in a terminal) -Step 2: Xcode Command Line Tools
This is shown here as a separate step because it really is a separate step in addition to Step 1. Don’t confuse this with the internal Xcode command line tools that the Xcode GUI will tell you are already installed. Lazarus cannot use those Xcode internal command line tools, so do the following (it is quick and easy)-
If you have problems installing using this command line method (e.g. the installer freezes while ’finding Software’), you can also download and install the package by logging in to the Apple Developer Site and downloading and installing the Command Line Tools for Xcode Disk image.Step 3: FPC, FPC Source
Download and install the Free Pascal Compiler (FPC) binaries and the separate source package. A compatible FPC (and source) must be installed before you install Lazarus. You have a number of options. Source Forge
Download the Free Pascal Compiler (FPC) binaries and FPC source packages 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.
These binary install kits are built by the FPC/Lazarus developers and track formal releases. As these install kits 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 apply a simple and quick test of FPC at this stage - Testing FPC installation.Other FPC Optionsfpcupdeluxe
You could also consider using fpcupdeluxe to install FPC and, perhaps Lazarus.fink
Alternatively, you can use fink, a package manager for macOS to install FPC. Note at the time of writing (Early 2020) fink offers Lazarus 2.0.6. The extra bonus of fink is easy installation as well as clean removal of a huge number of other open source software packages, including Free Pascal crosscompilers for many processors and systems. The choice for Lazarus is between a Carbon or Cocoa look, a gtk2 look, a Qt4-based and a Qt5-based version:
You will be asked, whether to install a number of dependencies, including the Free Pascal Compiler, the Lazarus sources. Simply hit RETURN at the prompt and go for a coffee. It may take quite some time to build all packages, in particular on older Macs.
After installation, Lazarus can be started from the folder /Applications/Fink/. The actual details of FPC and Lazarus are in subdirectories of /sw
With any Lazarus package from fink, these widget sets are supported for your program on macOS:
carbon (Aqua), cocoa, gtk2, qt4 (Aqua), qt5 (Aqua), nogui, win32, win64 and wince.
If you install FPC from fink, you will be fine downloading Lazarus source and compiling as detailed below. However, its possibly not a good idea to mix fink FPC with the Sourceforge binary install of Lazarus.MacPorts
MacPorts has also a package description of the cocoa-64 bit version of lazarus 2.0.6. Install it with:Step 4: Install the Lazarus IDE
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.
First, click Tools > Options > Debugger. Top right of the window now open has a label, ’Debugger type and path’, you must set both. Select ’LLDB debugger (with fpdebug) (Beta)’.
If it 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 the offered -
Martin_fr, the person who has given us this interface between Lazarus 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 in
https://diarynote.indered.space
MinGW - Minimalist GNU for Windows. A native Windows port of the GNU Compiler Collection (GCC). GNU Pascal for Mac OS X. Updated: 4/5/03 GNU Pascal for Mac OS X. A free Pascal compiler for the Macintosh, and continually updated! Please note that the port to Mac OS X is in an early state of development. Also note that there are differences between GNU Pascal and traditional Macintosh Pascal compilers. Lazarus is a free cross-platform visual integrated development environment (IDE) for rapid application development (RAD) using the Free Pascal compiler. Its goal is to provide an easy-to-use development environment for programmers developing with the Object Pascal language, which is. The packages and runtime library come under a modified Library GNU Public License to allow the use of static libraries when creating applications. The compiler source itself comes under the GNU General Public License. The sources for both the compiler and runtime library are available; the complete compiler is written in Pascal.
*Pascal Compiler Mac Os X
*Pascal Compiler For Mac
*Free Pascal Compiler For Windows 10
*Pascal Compiler For Mac
*Mac Os X Pascal Compiler
Welcome to the FreePascal on the Macintosh page. Here is information especially for you who want to write a program for the Macintosh. News:2009-02-09:
The download statistics indicate that the snapshots below are still downloaded a lot. Note that all fixes from those snapshots are also in the official release of FPC 2.2.2 (and will be also in later versions, when they become available), which was released in August 2008. Since FPC 2.2.2 also contains many additional fixes, we recommend you to use that version. It is available from the regular download pages. 2007-11-14:
There are some errors in the new linker shipped with Xcode 3.0/Mac OS X 10.5. A detailed overview was posted to the fpc-pascal mailing list. We have worked around most of those issues and created (stable) development snapshots for both PowerPC and Intel. These are intended to be installed on top of the 2.2.0 release version. Future releases will have these fixes incorporated.
One linker bug cannot be completely worked around in the compiler, which is related to the Stabs debugging format. For this reason, we recommend to switch to the Dwarf debugging format on Mac OS X 10.5. On the command line, you can do this by using -gw instead of -g to generate debugging information. In the Xcode projects, add -gw at the end of the FPC_SPECIFIC_OPTIONS project setting for the Debug configuration. 2006-08-27:
Regular snapshots of FPC 2.1.1 (both for PowerPC and for Intel - the latterdenoted as i386) are now generated by and available from the Lazarus team.
If you only need the compiler (to either use it from the command line or from Xcode),you only have to download and install the ’fpc’ package.
2005-12-18:
Version 2.0.2 that was released a few weeks ago has all fixes and improvements of the 2.1.1 snapshot that was here (like Mac Pascal style objects and creationof dynamic libraries). Additionally, it doesn’t suffer from the installationproblems the 2.1.1 snapshot installer had. Get the release here.
2005-07-23:
The 2.1.1 snapshot that was here is no longer available.
If you really need to be up to date with FPC,please consider using Subversion, and build the compiler by your self.
Some changes:
* No more ’_main’ symbol in the system unit (so can link with C main programs)
* Shared library creation support under Mac OS X
* Several bugfixes related to overflow checking on PPC 2005-06-29:
There is now a wiki page covering porting issues, from traditional mac pascals to FPC.
2005-06-21:
A FPC 2.1.1 snapshot is available here (10.8 MB, does not include the PDF documentation). It includes:
* Support for Macintosh Object Pascal in Macpas mode (includes support for mixing in Delphi-style OOP programming in Macpas mode, except that you have to use ’object’ instead of ’class’ everywhere -- all occurrences of ’class’ are simply internally replaced by the _OBJECT compiler token)
* Fixed bug which caused stack corruption in procedures receiving floating point parameters and parameters on the stack (only if the caller side was compiled by FPC)
* Fixed bug in overflow checking of integer operations (some calculations were buggy if overflow checking is turned on, which is the case in the default development building style of Xcode if you use the integration kit)
* Fixed bug in division of unsigned numbers > $7fffffff by a power of 2 Should you desire to do so, you can switch back to 2.0 by simplyinstalling the 2.0 package again.
2005-05-15:
At last !!!!! Free Pascal 2.0 is released for Mac OS X and classic Mac OS,as well as for other targets.
This means Free Pascal for the mac is not considered beta anymore.Get it on one of the mirror download sites.
Targets on the Macintosh:Target / Processor Status Remark Contact
final
For Mac OS X
final
Target Mac OS means classic Mac OS, up to System 9.x. Although it of course also work in the classic environment in Mac OS X
Mac OS on M68K
not planned
If someone is interrested to contribute, there is a possiblity to implement this target. There is support for MC68000 in the FPC source code, although not updated for a while. Mac Pascal dialectThe dialect of Pascal supported by popular Pascals on Macintosh is supported in part. Read more here.
Free Pascal 2.0 for Mac OS X is the current release. It should at least work on Mac OS X 10.1 and higher. It requires that you have installed XCode from Apple, to have assembler, linker and make tools available to fpc. For older versions of Mac OS X you should install Apple Development Tools instead. Both can be downloaded for free from Apple, but requires that you register yourself as a member of Apple Developer Connection. Both are also included in the Mac OS X bundle.
To download, go to the Download page, and choose a mirror site near you (to limit net traffic). The documentation is included, but can also be downloaded separatelly. If you want the source code, it has to be downloaded separatelly.There most recent FPC 2.1.1 snapshot is available here (10.4 MB)with, among others, support for mac style object pascal. See above under NEWS.
Note that the compiler is a unix style program and is run from the Terminal on Mac OS X.
Please report any bugs encountered.Using FPC from XCodeIt is possible to use Free Pascal from within XCode (Mac OS X 10.3 is required).Look at the step-by-step instruction of how to download and install the XCode Integration Kit. Thanks to Rolf Jansen for this contribution.
Free Pascal 2.0 for Mac OS is the current release. It will work on latest classic Mac OS (that is 9.2.2) and below, probably down to 7.1.2 (the first Mac OS for PowerPC), and also in the classic compatibility environment on Mac OS X. However it has only been tested on Mac OS 9 and Mac OS X classic environment.
It requires that you have installed Macinstosh Programmers Workshop (MPW) which can be downloaded for free from Apple.
To download, go to the Download page, and choose a mirror site near you (to limit net traffic). The documentation, as well as the source code (if you need it), has to be downloaded separatelly.
Note that the compiler is an MPW tool.
Please report any bugs encountered.Current status of classic Mac OS
Native FPC compiler (as an MPW tool)
Almost complete
Unit System.pp
Complete
The system unit is implicitly used by every program. Contains basic file and memory handling among others.
Unit Dos.pp
Complete
Contrary to what its name suggests, the DOS unit is cross plattfrom and contains utility routines for file and date handling, beyond that in System.pp. It is reminiscent from Turbo Pascal.
Unit Sysutils.pp
Planned
A moderner alternative to unit DOS, compatible with Delphi.
Unit MacOS
Complete
API to the Macintosh Toolbox
Units strings objpas heaptrc getopts etc
Implemented.
They are target independent.
Other units
Non-existent. Some will be implemented.
Implementation will depend on how important the unit is and if difficulties arise. Debugging
There is some limited possibilities to debug programs in classic Mac OS. See MPW debugging in the wiki.
As an alternative, you might do the main debugging in a Mac OS X/Darwin version of your program.
There are three major Pascal dialects: Turbo Pascal (extended to Delphi, supported by FreePascal, and partially by Gnu Pascal), Extended Pascal (an ISO standard, supported by Gnu Pascal, DEC Pascal, Prospero Pascal), and the dialect originating from Apple (commonly used in the Mac community, supported by MPW Pascal, Metrowerks Pascal and Think Pascal). We call this dialect Mac Pascal and there is a special language mode for it: MacPas.
Mode MacPas is a compatibility mode. It is probably not possible to mimic the Mac Pascal dialect in detail. So the goal is to implement often used constructs, if this doesn’t require too much effort, as well as easy-to-implement constructs.
To use MacPas, add -Mmacpas to the command line or insert the compiler directive {$MODE MACPAS} in the source code.
Note that the mac pascal dialect and mac targets are not interrelated. It is thus possible to write a mac program with the turbo dialect and to write a Windows program with the mac dialect.
The following are supported: Mac compiler directives like $SETC, $IFC, $ELSEC, $ENDC, $J, $Z. Most of the constructs found in interface files, especially Apples Universal Interfaces. Cycle, Leave, Otherwise. More is planned.
More updated info on the Wiki page.
By Olle Raab
For questions and suggestions, we suggest subscribing on our mailing lists , in particular FPC-pascal for questions about using Free Pascal.
Or write to olle.raab@freepascal.orgPascal Compiler Mac Os X
Latest modified 2005-07-28
│English (en) │ 한국어 (ko) │ русский (ru) │
This article applies to macOS only.
See also: Multiplatform Programming Guide
Note: For installation on Apple Silicon/AArch64, please refer to Apple Silicon Support.
Installing Lazarus on a Mac is not particularly difficult but it is critical that you do the install in the correct order. Skipping steps will almost certainly lead to tears. In brief, here is what you need to do:
*Download and install Xcode.
*Install the global command line tools for Xcode.
*Download and install the Free Pascal Compiler (FPC) binaries and the FPC source from the Lazarus IDE file area (Important do this before you install the Lazarus IDE)
*Download and install the Lazarus IDE from the Lazarus IDE file area
*Configure LLDB - the Apple supplied (and signed) debugger from within the Lazarus IDE.
These steps are explained in more detail below.
*1Installation
*1.3Step 3: FPC, FPC Source
*1.3.2Other FPC Options
*1.5Step 5: Configure the Debugger
*4Installing non-release versions of the Lazarus IDE
*5Installing non-release versions of FPC
*6Known issues and solutions
*6.2Installing Lazarus 2.0.8, 2.0.10 with FPC 3.2.0 for macOS 10.10 and earlier
*7Uninstalling Lazarus and Free PascalInstallation
The detailed instructions assume a recent version of macOS on your Mac, a recent version of Xcode from Apple and a recent version of Lazarus. On the Legacy Information page, you will see older information that may be relevant if you are using older components. You can assist by replacing out of date info, either deleting it, or, if it may help someone working with a legacy project, moving it to the bottom of the page.
In general, this is about using both the Carbon and Cocoa Widget Set. While Carbon was once seen as a little more stable, with the release Lazarus 2.0.8 the 64 bit Cocoa Widget Set has now surpassed Carbon and should be considered seriously for any new projects. Carbon was intentionally (by Apple) limited to 32 bits and you should be aware that it has been removed completely from macOS 10.15 Catalina which only supports 64 bit Cocoa. Step 1: Download Xcode
You need the Apple Developer tools, which are a part of the Xcode development environment.
Xcode 11.3.1 for use on macOS 10.14 Mojave must now be installed by downloading it from Apple Developer Connection (ADC), which requires free registration. Xcode 11.4.x for use on macOS 10.15 Catalina can be installed from the Mac App store. Note that you must first move any old Xcode versions from the Applications folder into the trash or rename the Xcode app (eg Xcode.app to Xcode_1014.app). You can select which version of Xcode to use with the command line utility xcode-select.
Older systems:
The developer tools can be installed from the original macOS installation disks or a newer copy downloaded from the Apple Developer Connection (ADC), which requires free registration. Download the Xcode file, it will end up in your Downloads directory as a zip file. Click it. It is unarchived into your Downloads directory. You may be happy with it there but maybe not. Other users will see the path to it but be unable to use it. And it is untidy there. So I moved mine and then told xcode-select where it was moved to (in a terminal) -Step 2: Xcode Command Line Tools
This is shown here as a separate step because it really is a separate step in addition to Step 1. Don’t confuse this with the internal Xcode command line tools that the Xcode GUI will tell you are already installed. Lazarus cannot use those Xcode internal command line tools, so do the following (it is quick and easy)-
If you have problems installing using this command line method (e.g. the installer freezes while ’finding Software’), you can also download and install the package by logging in to the Apple Developer Site and downloading and installing the Command Line Tools for Xcode Disk image.Step 3: FPC, FPC Source
Download and install the Free Pascal Compiler (FPC) binaries and the separate source package. A compatible FPC (and source) must be installed before you install Lazarus. You have a number of options. Source Forge
Download the Free Pascal Compiler (FPC) binaries and FPC source packages 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.
These binary install kits are built by the FPC/Lazarus developers and track formal releases. As these install kits 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 apply a simple and quick test of FPC at this stage - Testing FPC installation.Other FPC Optionsfpcupdeluxe
You could also consider using fpcupdeluxe to install FPC and, perhaps Lazarus.fink
Alternatively, you can use fink, a package manager for macOS to install FPC. Note at the time of writing (Early 2020) fink offers Lazarus 2.0.6. The extra bonus of fink is easy installation as well as clean removal of a huge number of other open source software packages, including Free Pascal crosscompilers for many processors and systems. The choice for Lazarus is between a Carbon or Cocoa look, a gtk2 look, a Qt4-based and a Qt5-based version:
You will be asked, whether to install a number of dependencies, including the Free Pascal Compiler, the Lazarus sources. Simply hit RETURN at the prompt and go for a coffee. It may take quite some time to build all packages, in particular on older Macs.
After installation, Lazarus can be started from the folder /Applications/Fink/. The actual details of FPC and Lazarus are in subdirectories of /sw
With any Lazarus package from fink, these widget sets are supported for your program on macOS:
carbon (Aqua), cocoa, gtk2, qt4 (Aqua), qt5 (Aqua), nogui, win32, win64 and wince.
If you install FPC from fink, you will be fine downloading Lazarus source and compiling as detailed below. However, its possibly not a good idea to mix fink FPC with the Sourceforge binary install of Lazarus.MacPorts
MacPorts has also a package description of the cocoa-64 bit version of lazarus 2.0.6. Install it with:Step 4: Install the Lazarus IDE
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.
First, click Tools > Options > Debugger. Top right of the window now open has a label, ’Debugger type and path’, you must set both. Select ’LLDB debugger (with fpdebug) (Beta)’.
If it 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 the offered -
Martin_fr, the person who has given us this interface between Lazarus 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 in
https://diarynote.indered.space
コメント