macOS

Версия 2.0.0 для macOS 13 Ventura и новее: семь программ с теми же окнами, меню и панелями, что в версии для Windows 5.0. Счётные ядра собраны из того же кода, файлы заданий и результатов те же. Образ универсальный: в одном файле код для Apple Silicon и Intel.

Код: github.com/klimov-kn/TMC_Suite_MacOS.

Что входит

Программа Пакет Назначение
PlanarRT H PlanarRT_H.app счётное ядро, H-поляризация
PlanarRT X PlanarRT_X.app счётное ядро, X-мода, подмагниченная плазма
TMCGROUT TMCGROUT.app характеристики матрицы рассеяния
TMC_DN TMC_DN.app диаграммы направленности
TMCROS TMCROS.app сигналы во времени
FieldView FieldView.app поле и топология, слежение за расчётом
TPL Designer TplDesigner.app редактор заданий .tpl, импорт моделей STEP, STL и OBJ

Поставляется двумя файлами с одинаковым содержимым: все программы, образцы заданий и руководство пользователя на русском и английском.

Файл Для чего
TMC_Suite-2.0.0-macos-universal.dmg образ: открыть и перетащить программы в «Программы»
TMC_Suite-2.0.0-macos-universal.zip тот же состав архивом, если образ не открывается

Установка

Пошаговая установка — на странице «Установка». Пакеты не подписаны у Apple, поэтому первый запуск нужно разрешить.

Особенности интерфейса

Интерфейс такой же, как в версии для Windows: тёмная тема, шрифты Inter и JetBrains Mono, значки программ и панелей, индикаторы на кнопках, русский и английский языки.

Отличается только то, что относится к системе:

Что На macOS
Меню в общей полосе вверху экрана. «О программе» и «Выход» — в меню программы, остальное на тех же местах, что в Windows
Сочетания клавиш вместо Ctrl действует Cmd
Значки программ файлы .icns по сетке Apple: плитка с полем и тенью, все размеры от 16 до 1024 точек, для экранов Retina свой рисунок каждого размера
Значки панелей векторные, на экранах Retina рисуются в двойном разрешении
Двойной щелчок в Finder .tpl открывает PlanarRT_H, .s, .soc — TMCGROUT, .t, .tos, .toc — TMCROS, .dop — TMC_DN, файлы поля — FieldView
Ключи командной строки -Arb, -Ar, -d, -Time, -GPU, -GPU:n, -CPU. Косая черта (/Arb) понимается, если файла с таким именем нет
Настройки программ ~/.config/TMC_Suite/<программа>.conf
Общие настройки ~/.config/TMC_Suite_Qt/ (Common.ini — язык, Compute.ini — видеокарта, ColorPicker.ini — цвета)
Вывод FieldView Qt RHI через Metal; ключ --rhi opengl выбирает OpenGL
Внешний редактор TextEdit

Счёт без окон: исполняемый файл лежит внутри пакета.

/Applications/PlanarRT_H.app/Contents/MacOS/PlanarRT_H ~/calc/horn.tpl -Arb -Time
echo $?

Коды завершения: 0 — все шаги посчитаны, 1 — ошибка задания, 2 — ошибка расчёта, 3 — расчёт остановлен.

Видеокарта

Ядра считают на видеокарте через OpenCL 1.2 с двойной точностью. OpenCL входит в macOS, ставить ничего не нужно, драйверы обновляются вместе с системой.

Возможность счёта зависит от компьютера:

Компьютер Расчёт
Apple Silicon (M1 и новее) на процессоре: OpenCL видеокарты Apple не поддерживает двойную точность
Intel и AMD Radeon на видеокарте, если драйвер объявляет cl_khr_fp64 и карта проходит самотест
Intel со встроенной графикой на процессоре: двойной точности нет

Окно «Настройки → Вычисления» показывает карты и причину, по которой счёт идёт на процессоре. Ключи те же, что на других системах:

Ключ Что делает
-GPU считать на первой подходящей карте
-GPU:n считать на карте с номером n (с 0)
-CPU считать на процессоре; сильнее -GPU и настройки

Небольшие задания остаются на процессоре, на них карта не быстрее: порог 150 тысяч узлов у H-ядра и 60 тысяч у X-ядра. Подробно — глава «Расчёт на видеокарте» руководства, метод — раздел «Устройство кода».

На настоящей видеокарте под macOS версия 2.0.0 не проверялась. Код счёта на карте совпадает с версиями для Windows и Linux, где результат на карте равен результату на процессоре.

Файлы

Файлы заданий и результатов те же, что в Windows: задание, посчитанное на одной системе, открывается на другой, окончания строк CRLF сохраняются. Регистр в именах файлов задания не важен, разделитель \ внутри заданий понимается.

Слежение FieldView за расчётом хранит признак «кадр прочитан» в расширенном атрибуте файла com.tmc.read_stamp. Ядро пишет выходной файл на каждом такте, поэтому задания держите на локальном диске: на сетевом расчёт заметно медленнее.

При первом обращении к папкам «Рабочий стол», «Документы», «Загрузки» macOS спрашивает разрешение. Пока на вопрос не ответили, программа ждёт.

Сборка из исходников

На маке нужны инструменты Xcode, CMake 3.22, Ninja, Qt 6.11 и OpenCASCADE:

xcode-select --install
brew install cmake ninja opencascade

Qt 6.11 для macOS ставится с qt.io в ~/Qt, нужен модуль Qt Shader Tools. Сборка всего пакета одной командой из корня проекта:

git clone https://github.com/klimov-kn/TMC_Suite_MacOS.git
cd TMC_Suite_MacOS
OCCT_DIR=$(brew --prefix opencascade)/lib/cmake/opencascade TMC_ARCHS=arm64 build/build_macos.sh

OpenCASCADE из Homebrew собран под одну архитектуру, поэтому здесь TMC_ARCHS=arm64 (на маке с Intel — x86_64). С универсальной сборкой OpenCASCADE переменная не нужна: получатся файлы для обеих архитектур. Другой путь к Qt задаёт переменная QT, число параллельных заданий — TMC_JOBS. Сборка проходит без ошибок и предупреждений компилятора.

Что Папка
Пакеты .app dist/macos
Библиотеки dist/macos/lib
Промежуточные файлы build/obj
Журнал build/build-macos.log

Выпуск собирается на Linux кросс-набором osxcross: build/build_macos.sh --cross делает обе архитектуры по очереди и склеивает файлы. Нужны osxcross с SDK macOS 15.5, Qt 6.11 для macOS, Qt 6.11 для Linux (moc, uic, rcc, qsb) и OpenCASCADE, собранный этим же набором.

Порядок сборки и состав библиотек — в файле BUILD_ORDER.md. Поставку собирает installer/package_macos.sh: вкладывает в пакеты Qt и OpenCASCADE, руководства и лицензии, ставит простую подпись и делает образ с архивом.

Отличия от версии для Windows

Расчётная часть та же, что в версии для Windows: счётные ядра собраны из того же исходного кода, форматы файлов заданий и результатов совпадают. Метод расчёта описан в разделе «Теория метода».

Файлы расчётной части совпадают с версией для Linux 2.0.0, которая сверена с Windows 5.0 на 45 проверочных заданиях. Сборки для Apple Silicon и Intel в редких случаях дают разные последние разряды: это свойство арифметики с плавающей точкой, а не дефект. Сличать с эталоном следует на том процессоре, на котором идёт работа.

На macOS своё только то, чего система не даёт: слой совместимости с MFC и Windows API (src/compat), текстовый режим файлов (CRLF), поиск имени файла без учёта регистра, признак «архивный» — описание слоя.

Версии macOS нумеруются отдельно: 2.0 соответствует Windows 5.0.

Известные ограничения

  • Выпуск 2.0.0 собран кросс-набором и на настоящем маке не запускался: проверены сборка, состав пакетов, подпись и образ. Запуск на маке — в карточке Issues.
  • Пакеты не подписаны у Apple: первый запуск нужно разрешить.
  • На Apple Silicon расчёт идёт только на процессоре.
  • Чтение моделей STEP — OpenCASCADE 7.9.

Дефекты и вопросы — на странице Issues репозитория.

macOS

Version 2.0.0 for macOS 13 Ventura and newer: seven programs with the same windows, menus and toolbars as the Windows edition 5.0. The kernels are built from the same code, the task and result files are the same. The image is universal: one file holds the code for Apple Silicon and Intel.

Code: github.com/klimov-kn/TMC_Suite_MacOS.

What is included

Program Bundle Purpose
PlanarRT H PlanarRT_H.app solver, H-polarization
PlanarRT X PlanarRT_X.app solver, X-mode, magnetized plasma
TMCGROUT TMCGROUT.app scattering-matrix characteristics
TMC_DN TMC_DN.app radiation patterns
TMCROS TMCROS.app time-domain signals
FieldView FieldView.app field and topology, following a calculation
TPL Designer TplDesigner.app .tpl task editor, import of STEP, STL and OBJ models

Two files with the same contents are supplied: all programs, sample tasks and the user manual in Russian and English.

File Purpose
TMC_Suite-2.0.0-macos-universal.dmg disk image: open it and drag the programs into Applications
TMC_Suite-2.0.0-macos-universal.zip the same contents as an archive, in case the image does not open

Installation

Step by step: Installation. The bundles are not signed with Apple, so the first launch has to be allowed.

Interface

The interface is the same as in the Windows edition: dark theme, Inter and JetBrains Mono fonts, program and toolbar icons, indicators on buttons, Russian and English.

Only what belongs to the system differs:

What On macOS
Menus in the common bar at the top of the screen. About and Quit are in the application menu, the rest is where it is on Windows
Keyboard shortcuts Cmd works instead of Ctrl
Program icons .icns files on the Apple grid: a tile with margin and shadow, all sizes from 16 to 1024 points, each size drawn separately for Retina displays
Toolbar icons vector, drawn at double resolution on Retina displays
Double click in Finder .tpl opens PlanarRT_H, .s, .soc open TMCGROUT, .t, .tos, .toc open TMCROS, .dop opens TMC_DN, field files open FieldView
Command-line keys -Arb, -Ar, -d, -Time, -GPU, -GPU:n, -CPU. The slash form (/Arb) is understood if there is no file with that name
Program settings ~/.config/TMC_Suite/<program>.conf
Common settings ~/.config/TMC_Suite_Qt/ (Common.ini — language, Compute.ini — video card, ColorPicker.ini — colors)
FieldView output Qt RHI through Metal; the key --rhi opengl selects OpenGL
External editor TextEdit

Calculation without windows: the executable file is inside the bundle.

/Applications/PlanarRT_H.app/Contents/MacOS/PlanarRT_H ~/calc/horn.tpl -Arb -Time
echo $?

Exit codes: 0 — all steps calculated, 1 — task error, 2 — calculation error, 3 — calculation stopped.

Video card

The kernels calculate on a video card through OpenCL 1.2 with double precision. OpenCL is part of macOS, nothing has to be installed, the drivers are updated together with the system.

What is possible depends on the computer:

Computer Calculation
Apple Silicon (M1 and newer) on the processor: OpenCL on Apple graphics has no double precision
Intel with AMD Radeon on the video card, if the driver declares cl_khr_fp64 and the card passes the self-test
Intel with integrated graphics on the processor: no double precision

The window Config → Compute (GPU) lists the cards and tells why the calculation stays on the processor. The keys are the same as on the other systems:

Key What it does
-GPU calculate on the first suitable card
-GPU:n calculate on card number n (from 0)
-CPU calculate on the processor; stronger than -GPU and the setting

Small tasks stay on the processor, the card is not faster on them: the threshold is 150 thousand nodes for the H kernel and 60 thousand for the X kernel. Details: the chapter Calculation on a video card of the manual, the method: Inside the code.

Version 2.0.0 has not been checked on a real video card under macOS. The calculation code for the card is the same as in the Windows and Linux editions, where the result on the card equals the result on the processor.

Files

The task and result files are the same as on Windows: a task calculated on one system opens on another, CRLF line endings are kept. The case of file names in a task does not matter, the separator \ inside tasks is understood.

FieldView following a calculation keeps the "frame read" mark in the extended file attribute com.tmc.read_stamp. A kernel writes the output file at every tick, so keep tasks on a local disk: on a network disk the calculation is noticeably slower.

On the first access to Desktop, Documents or Downloads macOS asks for permission. Until the question is answered, the program waits.

Building from source

A Mac needs the Xcode tools, CMake 3.22, Ninja, Qt 6.11 and OpenCASCADE:

xcode-select --install
brew install cmake ninja opencascade

Qt 6.11 for macOS is installed from qt.io into ~/Qt, the Qt Shader Tools module is needed. The whole package is built with one command from the project root:

git clone https://github.com/klimov-kn/TMC_Suite_MacOS.git
cd TMC_Suite_MacOS
OCCT_DIR=$(brew --prefix opencascade)/lib/cmake/opencascade TMC_ARCHS=arm64 build/build_macos.sh

OpenCASCADE from Homebrew is built for one architecture, hence TMC_ARCHS=arm64 (x86_64 on an Intel Mac). With a universal OpenCASCADE the variable is not needed and the files hold both architectures. Another Qt path is set by the variable QT, the number of parallel jobs by TMC_JOBS. The build passes with no compiler errors or warnings.

What Folder
.app bundles dist/macos
Libraries dist/macos/lib
Intermediate files build/obj
Log build/build-macos.log

The release is built on Linux with the osxcross toolchain: build/build_macos.sh --cross builds both architectures in turn and joins the files. It needs osxcross with the macOS 15.5 SDK, Qt 6.11 for macOS, Qt 6.11 for Linux (moc, uic, rcc, qsb) and OpenCASCADE built with the same toolchain.

The build order and the library list are in BUILD_ORDER.md. The package is made by installer/package_macos.sh: it puts Qt, OpenCASCADE, the manuals and licenses into the bundles, sets a simple signature and makes the image and the archive.

Differences from the Windows edition

The computational part is the same as in the Windows edition: the kernels are built from the same source code, the task and result file formats match. The method is described in Theory of the method.

The computational files match the Linux edition 2.0.0, which is checked against Windows 5.0 on 45 test tasks. The Apple Silicon and Intel builds can in rare cases differ in the last digits: this is a property of floating-point arithmetic, not a defect. Compare with a reference on the processor you actually work on.

macOS has its own only what the system does not give: the MFC and Windows API compatibility layer (src/compat), text file mode (CRLF), case-insensitive file name lookup, the "archive" mark — description of the layer.

macOS versions are numbered separately: 2.0 corresponds to Windows 5.0.

Known limitations

  • Release 2.0.0 is built with a cross toolchain and has not been run on a real Mac: the build, the bundle contents, the signature and the image are checked. Running on a Mac is tracked in Issues.
  • The bundles are not signed with Apple: the first launch has to be allowed.
  • On Apple Silicon the calculation runs on the processor only.
  • STEP models are read by OpenCASCADE 7.9.

Defects and questions: the Issues page of the repository.