- Mac Installation FAQ
- Contents
- Lazarus doesn’t run project
- Compilation aborts with weird messages
- ld: symbol(s) not found for architecture i386
- Debugger not found
- Form not shown after moving to Mac
- Form not responding to mouse clicks
- fpcsrc not present
- Multiple error messages after upgrading Lazarus and/or FPC
- Unit XY not found
- Fatal: Cannot find [. ] used by [. ], incompatible ppu=[filename], package [package name]
- Error: User defined: only cpu i386 is supported
- Error: ld: framework not found Cocoa
- Error ppc1 not found
- Error: library (X11 or Truetype) not found
- Application does not accept keyboard input
- Warning arm64 function not 4-byte aligned
- Resource compiler «fpcres» not found
- Other questions
- free pascal
- Open source compiler for Pascal and Object Pascal
- General
- Coding
- Tools
- Search
- Free Pascal on the Macintosh
- Installing Lazarus on macOS/ru
- Contents
- Установка
- Шаг 1. Загрузка Xcode.
- Шаг 2. Инструменты командной строки Xcode
- Шаг 3 FPC, исходники FPC
- Source Forge
- Другие параметры FPC
- Установка Lazarus
- Настройка отладчика
- Дополнительная информация по использованию LLDB
- Установка LazDebuggerFpLLdb
- Совместимость
- Carbon и Cocoa
- Загрузка исходников через svn
Mac Installation FAQ
This article applies to macOS only.
This page lists solutions to the most frequent problems that may arise during (and after) installation of Lazarus and Free Pascal on macOS. Please read Installing Lazarus on macOS first and pay special attention to the sections that apply to your versions of macOS, Xcode, Lazarus and Free Pascal.
Contents
Lazarus doesn’t run project
After moving to macOS or after upgrading to a new version of macOS Lazarus is unable to compile and run a project.
Solution: Most likely, this behaviour results from missing command line tools. In newer versions of Xcode they are no longer installed by default. You can install them by running
from the terminal. See also Installing Lazarus on macOS for more details.
Compilation aborts with weird messages
I have correctly installed Lazarus and FPC, but compiling a simple demo program stops with the Free Pascal exit code 256 and the message «Lazarus Panic /bin/sh: clang: command not found».
Solution: This behaviour may arise from a too old Xcode version installed. Generally, you should use the newest Xcode version that is available for your operating system. Lazarus 1.6 requires, e.g., Xcode 3.2.6, or newer. With Xcode 4.3 or newer, you should also install the Xcode command line tools as described above or in the article Installing Lazarus on macOS.
ld: symbol(s) not found for architecture i386
I am trying to compile a blank project on Catalina immediately after installing FPC and Lazarus but I get this error «ld: symbol(s) not found for architecture i386».
Solution: Go to Lazarus > Tools > Options, if your compiler may be set to ppc386 (32 bit), then change it to ppcx64 (64 bit) or fpc (a wrapper that should choose the correct compiler). There is no 32 bit support in Catalina. In the trunk version of Lazarus, the Lazarus > Tools > Options menu has been moved to the Lazarus > Preferences menu
Debugger not found
I have installed the latest version of Lazarus on a new Mac. My program is built fine, but when I try to run it I get a message that the debugger /usr/bin/gdb doesn’t exist or isn’t runnable.
Solution: Since version 5, Xcode does not include the GDB debugger but the LLDB debugger. For recent versions of macOS, go to the Tools > Options | Debugger menu and choose «LLDB debugger (with fpDebug) (Beta)» and set the executable to /usr/bin/lldb.
Solution (legacy): Xcode v5 no longer includes the GDB debugger. See GDB on OS X Mavericks or newer and Xcode 5 or newer for possible solutions unless you are running a recent version of macOS (in which case, see above).
Form not shown after moving to Mac
My application works well on Windows and Linux, but after changing to Mac my forms are invisible. I tried to re-scan the FPC source directory, and I clicked «Create Bundle», but this didn’t solve the problem. Unlike my app, a very simple demo application works well.
Solution: This may result from a wrong position setting of your form(s). Your Windows machine may have a multi-monitor setup, so that the forms are outside the visible area of a single-monitor environment, i.e. if your Mac has only one monitor. You should check and correct the top and left properties of your forms in the object inspector. (Of course, this also applies in the other direction, i.e. if you have a multi-monitor Mac and a single-monitor Windows or Linux machine).
Form not responding to mouse clicks
After starting the program the form is visible, but not responding to interaction via the user interface.
Solution: Programs for macOS-based systems are more complex than programs for Windows or Linux. They require the existence of an application bundle, a special opaque directory structure, which determines the modalities of interaction with the operating system and the GUI. You may create an application bundle in the project settings or alternatively via shell commands. Make sure that the option Use Application Bundle for running and debugging (for Darwin) is checked.
fpcsrc not present
After installing and first running Lazarus, the welcome window complains that the directory «/usr/local/share/fpcsrc» is not found.
Solution: You have to install fpcsrc. This is a Lazarus-specific installer package that comes with your distribution of Lazarus. If you have downloaded Lazarus from SourceForge you find fpcsrc in the same server directory as the Lazarus package.
Multiple error messages after upgrading Lazarus and/or FPC
After upgrading Lazarus and/or Free Pascal to a new major version, trying to compile my code results in multiple error messages.
Solution: This behaviour may have multiple reasons. After every major upgrade you should rescan the FPC source directory. If this doesn’t help it may be useful to delete the file fpcdefines.xml (it is within the
/.lazarus folder). Additionally, you should check your code for incompatibilities that may result from changes in the compiler (although this is quite rare with code that is not too unusual). See Category:FPC User Changes by release for intentional changes to the compiler that may break existing code.
Unit XY not found
I have freshly installed a new version of Lazarus on my machine. Trying to compile an application results in the error message «Error: unit not found: XY». (XY is a place holder for any unit name.)
Solution: Try to re-scan your FPC source directory via the Tools. menu of the IDE.
Fatal: Cannot find [. ] used by [. ], incompatible ppu=[filename], package [package name]
When the compiler gives the message «Cannot find A used by B», Lazarus checks what pas/pp/ppu files are in the search path, and if there is a ppu file it inserts «incompatible ppu=filename, package».
Explanation: FPC cannot use this ppu for one of these reasons:
- it was compiled with another FPC version;
- it was compiled with (depends on) some other ppu files that are not in the search path;
- you misconfigured some search path(s).
Solutions: (1) Check that you have the current Xcode (optional — see here) and Xcode command line tools package (mandatory) installed; (2) Lazarus > Menu > Tools > Configure Build Lazarus — Find and check «Clean all» and then Build. If that doesn’t work, I’d be tempted to delete both FPC + Lazarus and start again. See Uninstalling Lazarus and Free Pascal.
Error: User defined: only cpu i386 is supported
When compiling Lazarus on macOS I receive this error: carbonbars.pp(16,2) Error: User defined: only cpu i386 is supported
Error: ld: framework not found Cocoa
When compiling Lazarus on macOS I receive this error: Error: ld: framework not found Cocoa
Solution: You forgot to install the Xcode command line tools or they’ve since been deleted. See Installing Xcode Command Line Tools to resolve. You may also need to re-install FPC _after_ installing the Xcode command line tools so that it can find the macOS frameworks.
Error ppc1 not found
When compiling the Free Pascal Compiler on macOS I receive this error:
Solution: GNU Make does not handle directory names with spaces in them. Rename «fpc trunk» to «fpc_trunk» or similar and it should work without this error.
Error: library (X11 or Truetype) not found
If you are compiling X11 applications (typically using fpGui) FPC needs to know where to find the libX11.dylib and libfreetype.dylib libraries. If FPC cannot find these libraries, you will receive a library not found error during linking.
Solution: Depending on your version of macOS or XQuartz these may be found in /usr/X11/lib or /opt/X11/lib with a symlink from /usr. The best solution to this is probably to edit /etc/fpc.cfg and add the line «-Fu/usr/X11/lib«
Application does not accept keyboard input
After compiling my application, I cannot enter anything in the edit boxes and the application will not accept any keyboard input.
Solution: You forgot to create an application bundle. Lazarus > Project > Project Options > Application — Create Application Bundle.
Warning arm64 function not 4-byte aligned
When compiling on an Apple Silicon M1 processor, I get a «warning arm64 function not 4-byte aligned» for every function.
Solution: That’s probably a consequence of using -Os. That setting unconditionally sets procalign (jump align) to 1. That’s definitely wrong for AArch64 and a bunch of other architectures. There is no «minimum required alignment» for these settings defined yet anywhere in the compiler, so that will need to be added. In the meantime, do not use -Os to optimize size.
Resource compiler «fpcres» not found
When compiling an application after installing or compiling a new Lazarus version, it fails with the error «Error (9021) Resource compiler «fpcres» not found, switching to external mode«
Solution: Create a file called .fpc.cfg (note the leading dot in the filename) in your home directory and add the lines:
If the file already exists it should contain the first of the lines above, so just add the second line.
Other questions
I didn’t find my issue here.
Solution: You might find a possible solution at the Lazarus and Free Pascal Forum. Otherwise, you might ask your question there.
Источник
free pascal
Open source compiler for Pascal and Object Pascal
General
Coding
Tools
Search
Free Pascal on the Macintosh
Welcome to the FreePascal on the Macintosh page. Here is information especially for you who want to write a program for the Macintosh.
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.
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.
Regular snapshots of FPC 2.1.1 (both for PowerPC and for Intel — the latter denoted 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.
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 creation of dynamic libraries). Additionally, it doesn’t suffer from the installation problems the 2.1.1 snapshot installer had. Get the release here.
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.
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 simply installing the 2.0 package again.
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.
Источник
Installing Lazarus on macOS/ru
Эта статья относится только к macOS.
Установка Lazarus на Mac не особенно сложна, но очень важно выполнить установку в правильном порядке. Пропуск шагов почти наверняка приведет к плачу Ярославны. Вкратце, вот что вы должны сделать —
- Загрузить и установить Xcode.
- Установить глобальные инструменты командной строки для Xcode.
- Установить Free Pascal Compiler и исходники FPC
- Установить Lazarus
- Настроить LLDB — поставляемый (и подписанный) Apple отладчик от Lazarus.
Примечание: если вы устанавливаете версии Lazarus до 2.0.0, вам почти наверняка понадобится gdb, см. раздел Legacy.
Contents
Установка
В подробных инструкциях предполагается, что на вашем Mac установлена последняя версия macOS, последняя версия Xcode от Apple и последняя версия Lazarus. Внизу страницы, под устаревшей документацией, вы увидите более старую информацию, которая может иметь значение, если вы используете старые компоненты. Вы можете помочь, заменив устаревшую информацию, либо удалив ее, либо, если это может помочь кому-то, работающему с унаследованным проектом, переместить ее в конец страницы.
В общем, речь идет об использовании набора виджетов Carbon и Cocoa. Хотя Carbon все еще можно считать немного более стабильным, на момент выпуска 2.0.0 64-битное Cocoa очень близко [к стабильному] и, безусловно, его следует учитывать. Carbon намеренно (Apple) ограничен 32 битами, и мы знаем, что следующая версия MacOSX, вероятно, не будет его поддерживать.
Шаг 1. Загрузка Xcode.
Вам нужны инструменты Apple Developer, которые являются частью среды разработки Xcode. Они могут быть установлены с оригинальных установочных дисков MacOS или более новой копии, загруженной с Apple Developer Connection (ADC), для которой требуется бесплатная регистрация: ссылка. Загрузите файл Xcode, он окажется в вашем каталоге Downloads в виде zip-файла. На сентябрь 2017 года это Xcode_9_beta_6.xip, около 5Гб. Кликните по нему. Он разархивируется в ваш каталог Downloads. Возможно, вы будете довольны этим, а может и нет. Другие пользователи увидят путь к нему, но не смогут его использовать. И это непорядок. Поэтому я переместил мой [экземпляр] и затем сказал xcode — выбери, куда он был перемещен (в терминале) —
Шаг 2. Инструменты командной строки Xcode
Это показано здесь в качестве отдельного шага, потому что на самом деле это отдельный шаг в дополнение к Шагу 1. Не путайте это с внутренними инструментами командной строки Xcode, которые, по словам графического интерфейса Xcode, уже установлены. Lazarus не может использовать эти инструменты внутренней командной строки Xcode, поэтому сделайте следующее (это быстро и легко) —
Начиная с macOS Mojave, вам также необходимо установить заголовочные файлы SDK:
Шаг 3 FPC, исходники FPC
Получите и установите FPC и исходники FPC. Перед установкой Lazarus необходимо установить совместимый fpc (и исходный код), у вас есть несколько вариантов.
Source Forge
Получить версию релиза можно по ссылке https://sourceforge.net/projects/lazarus/files. Эти двоичные установочные комплекты созданы разработчиками FPC/Lazarus и отслеживают формальные выпуски. Так как эти установочные комплекты не одобрены Apple, вам нужно удерживать нажатой клавишу Control, щелкнуть пакет и выбрать Open(Открыть) и подтвердить, что вы хотите установить его от неизвестного разработчика (то есть того, кто не платит Apple откат).
Для получения официальных/более подробных инструкций для FPC перейдите по адресу [1] (прим.перев.: в оригинале битая ссылка)
Вы можете применить простой и быстрый тест fpc на этом этапе: Testing_FPC_installation.
Другие параметры FPC
Вы также можете рассмотреть возможность использования fpcupdeluxe для установки fpc и, возможно, Lazarus, fpcupdeluxe
Кроме того, вы можете использовать fink, менеджер пакетов для macOS для установки fpc. Обратите внимание, что на момент написания (в начале 2019 года) fink предлагает Lazarus 1.8.4, и в целом он согласен с тем, что требуются версии более поздние, чем 2.0.0 (т.е. не выпускаемые), поэтому, вероятно, они не подходят для разработки Cocoa. Дополнительным бонусом fink является простота установки, а также чистое удаление огромного количества других пакетов программного обеспечения с открытым исходным кодом, включая FreePascal crosscompilers для многих процессоров и систем. Выбор для lazarus — Carbon’ный вид lazarus (предпочитаемый большинством), gtk2, Qt4 и Qt5:
Вам будет задан вопрос, устанавливать ли ряд зависимостей, включая компилятор FreePascal, исходные коды lazarus. Просто нажмите Enter и сразу же идите пить кофе. Сборка всех пакетов может занять некоторое время, особенно на старых Mac.
После установки Lazarus можно запустить из папки /Applications/Fink/. Фактические детали fpc и lazarus находятся в подкаталогах /sw
Для любого пакета lazarus от fink эти наборы виджетов поддерживаются для вашей программы в macOS: carbon (Aqua), gtk2, qt4 (Aqua), qt5 (Aqua), nogui, win32, win64 и wince.
Если вы установите fpc из fink, у вас все получится, скачав исходный код Lazarus и скомпилировав его, как описано ниже. Однако, возможно, не стоит смешивать fink fpc с установкой бинарников Lazarus от sourceforge.
Установка Lazarus
На момент написания статьи (начало 2019 года) существует ряд причин, по которым вам может быть лучше использовать еще не выпущенную версию Lazarus, а именно fixes_2_0. Особенности —
- Вам почти наверняка понадобится Cocoa, скорее всего, следующая версия MacOSX не будет поддерживать 32-битный Carbon.
- Вы почти наверняка захотите использовать lldb вместо gdb — гораздо проще установить.
- Cocoa постоянно улучшается, и интерфейс lldb быстро улучшается, начиная с 2.0.0.
- Fixes_2_0 безопаснее и стабильнее, чем trunk, но получает новые вещи намного быстрее, чем release версия.
Предварительно скомпилированные двоичные файлы, основанные на fixes_2_0, недоступны в SourceForge, но их можно получить из fpcupdeluxe. Но здесь мы обсудим загрузку исходного кода и сборку. Немного медленный изначально, но очень надежный и отличный тест установки вашего компилятора! Вам понадобится svn (он не был предварительно установлен на ранних версиях MacOS, используйте brew или fink для установки).
- Примечание. Я передаю параметр для использования каталога конфигурации, основанного на имени фактического каталога установки. Это делает некоторые сценарии легкими.
- В настоящее время также вполне возможно (и, возможно, безопаснее на ощупь) создать 32-битную Carbon Lazarus IDE и использовать ее для создания 64-битных приложений Cocoa. Замените упомянутую выше строку на «make LCL_PLATFORM=carbon CPU_TARGET=i386 bigide » и настройте свой проект, как указано в разделе Carbon и Cocoa ниже.
Возможно, вы захотите поместить небольшой скрипт в каталог $HOME/bin и даже указать путь к нему (очень unix!)
Настройка отладчика
В версиях Lazarus 1.8.4 и более ранних версиях вам нужно было использовать gdb в качестве отладчика, медленно устанавливать и тяжело подписывать. Начиная с Lazarus 2.0.0 вы можете (и должны) использовать LLDB, отладчик, предоставляемый Apple, подпись [для которого] не требуется.
Предполагая, что вы установили все необходимое и запустили Lazarus, остается только настроить отладчик. Если вы не сделаете этого сейчас, Lazarus попытается использовать GDB и потерпит неудачу.
Сначала нажмите Tools(Инструменты)->Options(Параметры)->Debugger(Отладчик). В правом верхнем углу открытого окна есть надпись «Debugger type and path»(Тип и путь отладчика), вы должны задать оба [значения]. Выберите «LLDB debugger (with fpdebug) (Beta)»(Отладчик LLDB (с помощью fpdebug) (Beta)).
Если его нет в списке выбора, см. ниже (Установка LazDebuggerFpLLdb). Обратите внимание, что изображение выше имеет путь к LLDB, который может отличаться от вашего, в зависимости от того, где были установлены инструменты XCode, в моем случае /Library. Сохраните эти настройки, и теперь вы можете попытаться скомпилировать практически пустую программу, которую Lazarus любезно предоставил для вас (щелкните маленький зеленый треугольник в верхнем левом углу).
Далее вы видите загадочный вопрос, см. изображение ниже. Выберите «Debug Format»(формат отладки) из предложенных —
Martin_fr (человек, который дал нам этот интерфейс между Lazarus и LLDB) предлагает вам использовать «dwarf3». Затем вам нужно ввести свой пароль: MacOSX хитроумна, потому что одно приложение мешает другому. В этом случае это хорошо!
Дополнительная информация по использованию LLDB
В этой ветке форума появляется много информации об использовании LLDB. Вот еще несколько самоцветов от Martin_fr:
В случае непредвиденных проблем стоит попробовать «dwarf with sets» взамен используемому «dwarf3».
Параметр «debug info» влияет только на модули непосредственно в вашем проекте. Однако модули в пакетах также могут иметь отладочную информацию. Это может быть
- установка в пакете
- для многих, но не для всех пакетов в меню Tools(Сервис) > Configure build Lazarus(Настройка сборки Lazarus)
- project settings (настройки проекта) >Дополнения и переопределения
Если вы измените настройки для пакета, вы также можете проверить, в какой пакет вы планируете перейти. Пакет, в который вы не входите, не требует отладочной информации. Если вы используете тип из пакета (такой, как TForm из LCL), то достаточно, чтобы ваш модуль (в котором вы объявляли переменную и(или) использовали переменную для включения типа) имел отладочную информацию. Уменьшение количества пакетов с отладочной информацией (в том числе тех, которые по умолчанию имеют отладочную информацию) может сократить время запуска отладчиков.
Также, возможно, стоит сравнить (не проверено) время запуска отладчиков для тех же настроек, только изменив флажок «use external debug info» (использовать внешнюю информацию отладки).
Это должно быть установлено только в вашем проекте. Если установлен в вашем проекте, это повлияет на все пакеты. (Если он установлен в пакете, он ничего не сделает/по крайней мере, не должен . )
Установка LazDebuggerFpLLdb
Если вы установились из исходного кода и [при этом] использовали параметр bigide [утилиты make], то правильный отладчик будет установлен, как пакет, и [сразу будет] готов к работе. Однако, если вы установили другим способом, [отладчика] там может и не оказаться. На главном экране IDE выберите Packages(Пакеты) -> Install/Uninstall Packages (Установить/удалить пакеты). Show — это два списка пакетов, слева — список уже установленных, справа — доступных для установки. Ищите LazDebuggerFpLldb (именно его, есть некоторые схожие названия, но менее подходящие пакеты). Если он справа, щелкните его, нажмите «Install Selection» (Установить выделенное), а затем «Save and rebuild IDE» (Сохранить и пересобрать IDE). Это займет немного времени, IDE выключится и перезапустится, и все должно быть хорошо. Теперь вернитесь на страницу и продолжите настройку отладчика.
Совместимость
Не всякая комбинация [версий] Lazarus и Free Pascal совместима с любой установкой macOS. Пожалуйста, обратитесь к следующей таблице, чтобы найти правильную версию для вашей среды разработки:
Lazarus 1.8.x | Lazarus 2.0.y | Lazarus 2.2.0 RC1 | |||||||
---|---|---|---|---|---|---|---|---|---|
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**# | Not tested | Not tested | Not tested | ||
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## | Not tested | Not tested | ||
macOS 10.12 (Sierra) | Compatible^^ | Compatible | Compatible***† | Compatible† | Compatible† | Compatible† | Not tested | ||
macOS 10.13 (High Sierra) | Not tested | Compatible | Compatible***† | Compatible† | Compatible† | Compatible† | Not tested | ||
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.0 (Big Sur) | Not tested | Compatible | Compatible***† | Compatible† | Compatible† | Compatible† | Compatible | ||
macOS 12.0 (Monterey Beta) | Not tested | Not tested | Not tested | Not tested | Not tested | Not tested | Compatible | ||
Apple Silicon processors | |||||||||
macOS 11.0 (Big Sur) | Not tested | Not tested | Not tested | Compatible†† | Compatible†† | Compatible††† | Compatible* |
x = 0, 2 or 4; y = 0, 2, 4, 6, 8, 10 or 12
^ Carbon interface compiles — Cocoa does not.
^^ Restrictions apply to debugging with gdb.
# Cannot run with/without debugging in the IDE. Can run compiled application outside of the IDE. See Issue #37324
## You need to compile FPC 3.2.0 from source with FPC 3.0.4 which is installed with the Lazarus 2.0.12 packages.
† 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 M1 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 M1 processor. Refer to these instructions for compiling the Lazarus IDE.
* Lazarus 2.2 Release Candidate 1 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. This may change when Lazarus 2.2 is officially released.
Carbon и Cocoa
В настоящее время (начало 2019 года) Lazarus, использующий Cocoa, удовлетворит потребности многих пользователей. Carbon работает почти так же, как и ожидалось, но вам рекомендуется сначала попробовать Cocoa, особенно если учесть, что Apple указала релизы после того, как Mojave не будет поддерживать 32bit Carbon. Альтернативы включают QT и GTK2 +, которые требуют дополнительных библиотек, и GTK2 + на Mac, кажется, привлекают мало внимания в эти дни. У QT на Mac есть несколько сильных сторонников на форуме.
Однако, мы должны предполагать, что Cocoa — это будущее Mac. Возможно собрать версию Lazarus Cocoa на релизе 2.0.0 и выше. Можно также сделать сборку Lazarus для Carbon и использовать ее для создания 64-битных двоичных файлов Cocoa. В Carbon IDE вам нужно установить цель для 64-битного процессора и указать набор виджетов Cocoa:
- Откройте свой проект с помощью Lazarus и нажмите Project/ProjectOptions
- На панели «Config and Target»(Конфигурация и цель) установите для «Target CPU family»(Семейство целевых процессоров) значение «x86_64».
- На панели «Additions and Overrides»(Дополнения и переопределения) нажмите «Set LCLWidgetType»(Задать LCLWidgetType) и установите значение «Cocoa»
- Раньше по какой-то причине Lazarus постоянно устанавливал компилятор в «/usr/local/bin/ppc386», что приводило к [созданию] 32-битных приложений. Убедитесь, что в меню Tools(Сервис)->Options(Параметры) для «Compiler Executable»(Исполняемый файл компилятора) установлено значение «/usr/local/bin/fpc», чтобы получить 64-разрядные приложения.
- Теперь скомпилируйте ваш проект — и, пожалуйста, сообщите о любых проблемах, с которыми вы столкнулись.
Загрузка исходников через svn
Исходники хранятся в системе управления версиями, которая называется subversion, или коротко svn:
- [macOS] 10.5 и выше уже содержат клиентов SVN. Пользователи более ранних версий должны установить SVN для macOS. Вы также можете использовать Fink. Клиенты SVN с графическим интерфейсом пользователя (GUI) доступны на Versiontracker. Довольно удобным клиентом, который интегрируется в Finder, является SCPlugin.
Создайте каталог, куда вы хотели бы поместить исходники. Для этого вам не нужно быть пользователем root. Это может сделать любой обычный пользователь. Сначала создайте каталог для fpc (например, /Users/username/freepascal), затем откройте терминал и выполните следующие действия:
Это создаст каталог с именем ‘fpc’, который впоследствии можно будет использовать в IDE. Подсказка: чтобы загрузить/обновить последние изменения, вы можете просто сделать
Источник