Recent

Author Topic: Why there is no build-in cross compilation support for windows version?  (Read 1560 times)

Handoko

  • Hero Member
  • *****
  • Posts: 5420
  • My goal: build my own game engine using Lazarus
Re: Why there is no build-in cross compilation support for windows version?
« Reply #15 on: April 28, 2025, 04:24:03 am »
I can offer you some simple steps of how to build-in support of cross-compilation for Android in STANDART Lazarus IDE according to the instruction for using LAWM.
This steps in my opinion will save a lot of time for those users who want to compile for Android. And could encrease amount of Android apps build with Lazarus and make IDE more popular for developers using FPC.

That will be very useful. This is a community project, any useful information, tips and tricks are very helpful. I agree and ever thought the same, it would be nice if LAMW is bundled in the default Lazarus installation. Maybe that will happen in the future.

Artyom

  • Guest
Re: Why there is no build-in cross compilation support for windows version?
« Reply #16 on: April 28, 2025, 08:25:00 am »

Quote

That will be very useful. This is a community project, any useful information, tips and tricks are very helpful. I agree and ever thought the same, it would be nice if LAMW is bundled in the default Lazarus installation. Maybe that will happen in the future.


Here is the instruction for LAMW.

https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/readme.md


As far as I understand this instruction was made by the author of LAWM.
Let us see what steps are required for all users.

1. Need actual versions of Android SDK, NDK, Gradle, Ant, JDK.
Versions of them should be corresponded to each other.
To set the path for them in LAWM.
2. Need preliminary to set up Android SDK via SDK manager.
3. Need to install JDK.
4. Need pre-build cross compilators for Android in Lazarus IDE.
5. Need ready to use config file with settings for the project user wants to compile for Android.
This config file user can import via Project Options.
6. Need to install the packages of LAWM in proper sequence.
After these preparation user can run LAWM in Lazarus IDE. User check the path settings and build Android application.

User can do:
Download and install proper JDK.
Install LAWM in proper sequence via Package installer in Lazarus.
Download ready to use SDK, NDK,  Gradle, Ant.
Set the path to them via LAWM.
Download ready to use config file of Project Options.


Other steps could be done by Lazarus Developers.
One time for all users of standart Lazarus IDE.


Ready to use versions of Android SDK, NDK, Gradle, Ant could be placed in special folder inside Lazarus folder on Source Forge.
With proper settings of Android SDK.
Proper JDK installator for user to download could be placed in this special folder as well.

Ready to use config file to import project setting for cross-compilation also could be also placed in this special folder.

This special folder Lazarus developers could update from time to time.



Cross-compilers Lazarus could be already build-in Standart Lazarus IDE by default.
Or user could compile them via LAWM.
Special chapter for Help - Users Guide on how to compile Android application would be helpful.


Of course Lazarus developers could include all preparation and required downloads during installation of standart Lazarus IDE. But it will takes more time to create new version of Lazarus IDE installator.








Seenkao

  • Hero Member
  • *****
  • Posts: 702
    • New ZenGL.
Re: Why there is no build-in cross compilation support for windows version?
« Reply #17 on: April 28, 2025, 09:45:00 am »
LAWM не стабилен от версии к версии и от одной ОС к другой ОС. Боюсь встраивание LAWM только отпугнёт пользователей от использования как FPC/Lazarus, так и самим LAWM.

Человек должен быть готов к тому, что у него может не заработать что-то. А если человек не готов, значит должен быть полностью готовый инструмент. Описание установки и работы с LAWM не делает его полностью рабочим и беспроблемным (что не означает что это плохая библиотека).

Вы сами хотите чтоб взять и установить всё разом и без проблем. Но если вы попробуете автоматизировать то что вы написали, то вы поймёте, что это не так просто, как кажется. Это займёт длительное время. На каждом вашем шаге будут встречаться ошибки, которые вы может и сможете разрешить. Потом вы предоставите готовый продукт на общее обозрение и вам начнут присылать информацию о том, что что-то не работает (а вернее всего не будут присылать, а просто даже пользоваться не будут). Вам надо будет исправлять эти ошибки. Если это будут ошибки на других ОС, отличной от вашей, то надо будет ещё установить подобную ОС, чтоб протестировать и исправить ошибки. И так раз за разом, времени может уйти на это не один год.

Я думаю, что стоит поблагодарить разработчика LAWM за то что он хотя бы не бросил проект. За то, что существует этот проект и его можно использовать!
Ну и стараться помогать проекту, вполне возможно, со временем получиться сделать установщик, который установит сразу всё и будет работать достаточно стабильно.
-------------------------------------------------


Google translate:
LAWM is not stable from version to version and from one OS to another OS. I'm afraid that embedding LAWM will only scare users away from using both FPC/Lazarus and LAWM itself.

A person should be prepared for the fact that something may not work for him. And if a person is not ready, then there should be a completely ready tool. The description of installation and work with LAWM does not make it fully working and problem-free (which does not mean that it is a bad library).

You yourself want to take and install everything at once and without problems. But if you try to automate what you wrote, then you will understand that it is not as easy as it seems. It will take a long time. At each of your steps, you will encounter errors that you may be able to resolve. Then you will provide the finished product for public review and they will start sending you information that something does not work (or rather, they will not send it, they will simply not even use it). You will need to fix these errors. If these are errors on other OS, different from yours, then you will need to install a similar OS to test and fix the errors. And so on over and over again, it may take more than one year.

I think that it is worth thanking the developer of LAWM for at least not abandoning the project. For the fact that this project exists and can be used!
Well, and try to help the project, it is quite possible that over time it will be possible to make an installer that will install everything at once and will work quite stably.
 :)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Artyom

  • Guest
Re: Why there is no build-in cross compilation support for windows version?
« Reply #18 on: April 28, 2025, 11:11:58 am »
Quote
Вы сами хотите чтоб взять и установить всё разом и без проблем. Но если вы попробуете автоматизировать то что вы написали, то вы поймёте, что это не так просто, как кажется. Это займёт длительное время. На каждом вашем шаге будут встречаться ошибки, которые вы может и сможете разрешить

Хорошо, переходим на русский язык.

Про автоматизацию я написал в конце как вариант дальнейшего развития Лазаря.


То что сначала было написано было рассчитано на ручную установку.

А именно: разработчики настраивают все инструменты для компиляции - sdk, ndk, gradle, ant.

И размещают их в папки на сервере, чтобы юзер скачал их или указал пути к ним на сервере для LAWM.
Эти папки делаются руками. Обновляются тоже руками, если надо.

Разработчики руками в сборку Лазаря добавляют кросс-компиляторы в соответствующую папку.
Или дают возможность юзерам скачать готовые кроссы, чтобы руками кинуть их в нужное место.

Файл конфига тоже делается руками.
В Лазаре делаются настройки проекта, компилятора для Андроида, пути к библиотекам и т.д.

Вот по этой инструкции для начала.
https://wiki.lazarus.freepascal.org/Android_tutorial#Compile_the_demo_%22androidlcl%22

Раздел называется
Compile the demo "androidlcl"


Сохраняется тоже руками по кнопке Export.
Кладется на сервер для скачивания юзерам.

Юзер руками загружает конфиг по кнопке Import.

Юзер загружает и ставит JDK на свою машину тоже руками.

Руками ставит пакет LAMW через Менеджер пакетов. В том порядке как в инструкции автора LAMW.

Папки sdk, ndk, gradle, ant нужны для компиляции в любом случае.
И для любых Андроид-плагинов.

К примеру,
Las4Apk тоже просит пути к этим папкам. Скрин прилагаю.


Если ещё раз перечитать инструкцию, которую я выше указал, то даже в самом Лазаре в разделе Compiler options нужно указать пути к sdk, ndk и т.д.

И в чем проблема?
Что теперь разрабам стало уже сложно настроить и дать доступ к Android sdk, ndk и остального для компиляции?
Или скомпилить и выложить готовые кросс-компиляторы?

Это раньше вообще мог любой админ сделать, даже не программист.



А вот уже после того как будет доступ к sdk, ndk и всего остального, пусть каждый юзер решает что использовать для компиляции в Андроид -
LAMW, LAZ4Apk, другие пакеты

или вообще
Project options Лазаря и батники по вышеприведенной инструкции.


Okay, let's switch to Russian.

I wrote about automation at the end as an option for further development of Lazarus.

What was written at first was intended for manual installation.

Namely: the developers configure all the tools for compilation - sdk, ndk, gradle, ant.

And place them in folders on the server so that the user downloads them or specifies the paths to them on the server for LAWM.

These folders are made manually. They are also updated manually, if necessary.

The developers manually add cross-compilers to the Lazarus assembly in the appropriate folder.
Or they give users the opportunity to download ready-made crosses so that they can manually throw them in the right place.

The config file is also made manually.

In Lazarus, project settings, a compiler for Android, paths to libraries, etc. are made.

Here are the instructions for starting.
https://wiki.lazarus.freepascal.org/Android_tutorial#Compile_the_demo_%22androidlcl%22

The section is called
Compile the demo "androidlcl"

It is also saved manually by pressing the Export button.

The user manually loads the config by pressing the Import button.

The user also manually downloads and installs the JDK on his machine.

Manually installs the LAMW package via the Package Manager. In the order as in the instructions of the LAMW author.

The folders sdk, ndk, gradle, ant are needed for compilation in any case.
And for any Android plugins.

For example,
Las4Apk also asks for paths to these folders. I am attaching a screenshot.

If you reread the instructions I indicated above, then even in Lazar itself, in the Compiler options section, you need to specify the paths to the sdk, ndk, etc.

And what's the problem?
Is it now difficult for developers to configure and provide access to the Android sdk, ndk, and the rest for compilation?
Or compile and publish ready-made cross-compilers?

Any admin could do this before, even a non-programmer.

But after there is access to the sdk, ndk, and everything else, let each user decide what to use for compilation in Android -
LAMW, LAZ4Apk, other packages, or even
Lazar's Project options and batch files according to the instructions above.
« Last Edit: April 28, 2025, 12:35:32 pm by Artyom »

Seenkao

  • Hero Member
  • *****
  • Posts: 702
    • New ZenGL.
Re: Why there is no build-in cross compilation support for windows version?
« Reply #19 on: April 28, 2025, 12:00:51 pm »
Хорошо, переходим на русский язык.
Мы на англоязычном форуме. Старайся хотя бы перевод людям предоставлять.

Всё, что ты описал, уже сделано. Используй FPCUPDeluxe и всё необходимое будет установлено автоматически (зачастую для разработки под Android даже не нужно Android SDK/NDK устанавливать, при установке кросскомпилятора необходимые библиотеки будут загружены).

Но как я писал, от ошибок это не освободит. Я сам лично сталкивался не один раз с ошибками, просто при установке библиотеки LAWM. А это означает, что нельзя просто взять и установить Lazarus + LAWM. Потому что у части пользователей это вызовет ошибку. Кому-то из пользователей надо будет либо что-то переустановить, кому-то что-то исправить.

Люди, которые знают как это всё использовать, уже используют. Надо LAWM отшлифовать, чтоб он не ломал сборки Lazarus и тогда его можно на автомате ставить для кросскомпиляции. Но и только для кросскомпиляции, а не по умолчанию. Моё личное мнение.
-------------------------------------------------


Google translate:
We are on an English-language forum. Try to at least provide people with a translation.

Everything you described has already been done. Use FPCUPDeluxe and everything you need will be installed automatically (often, you don't even need to install the Android SDK/NDK to develop for Android; the necessary libraries will be downloaded when installing the cross-compiler).

But as I wrote, this won't free you from errors. I personally have encountered errors more than once, simply when installing the LAWM library. This means that you can't just install Lazarus + LAWM. Because some users will get an error. Some users will need to either reinstall something, or fix something.

People who know how to use all this are already using it. LAWM needs to be polished so that it doesn't break Lazarus builds, and then it can be automatically installed for cross-compilation. But only for cross-compilation, not by default. My personal opinion.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Artyom

  • Guest
Re: Why there is no build-in cross compilation support for windows version?
« Reply #20 on: April 28, 2025, 01:07:09 pm »
В качестве теста успешно загрузил и поставил LAMW через Lazarus package manager.
Готовые кросс-компиляторы взял у разработчиков FPC.

Значит эту часть сможет сделать любой пользователь.


Далее надо в LAMW указать пути к sdk, ndk, gradle...
А вот эту часть любой пользователь уже не сможет легко сделать.

Да еще Android SDK предварительно настроить.


Вы говорите, что LAMW хотите улучшить?
Согласен.

Для этого нужно много пользователей LAMW.
Чтобы найти и исправить ошибки.

Поэтому чем проще будет устанавливать и запускать LAMW, тем больше будет пользователей.


Сейчас установить и запускать LAMW очень трудно.

Я предложил тот вариант, который мне кажется самый прямой и понятный для большинства пользователей.
Поставить LAMW через Менеджер пакетов.
И указать пути на sdk, ndk, которые дадут разработчики Lazarus.
Без использования fpcupdeluxe.  И возможных ошибок при этом.
Вы говорите, что все это уже есть?
Согласен.
Только пользоваться этим трудно.
Поэтому я предложил свой вариант, чтобы проще было пользоваться.
Вариант для администратора Lazarus, даже не разработчика.


Google translate
As a test, I successfully downloaded and installed LAMW via Lazarus package manager.
I took ready-made cross-compilers from FPC developers.

So any user can do this part.

Next, you need to specify the paths to sdk, ndk, gradle in LAMW...
But this part is not easy for any user.

And also pre-configure Android SDK.

You say that you want to improve LAMW?
I agree.

This requires many LAMW users.

To find and fix errors.

Therefore, the easier it is to install and run LAMW, the more users there will be.

Now it is very difficult to install and run LAMW.

I suggested the option that seems to me the most straightforward and understandable for most users.
Install LAMW via Package Manager.
And specify the paths to sdk, ndk, which will be given by Lazarus developers.
Without using fpcupdeluxe. And possible errors in this case.
You say that all this already exists?
I agree.
It's just hard to use.
That's why I offered my own version to make it easier to use.
An option for a Lazarus administrator, not even a developer.




Artyom

  • Guest
Re: Why there is no build-in cross compilation support for windows version?
« Reply #21 on: April 28, 2025, 01:35:22 pm »
Quote
зачастую для разработки под Android даже не нужно Android SDK/NDK устанавливать, при установке кросскомпилятора необходимые библиотеки будут загружены.

Да, согласен.

Если мы говорим о простых приложениях.
В виде исполняемых файлов.

Для запуска через терминал Linux или Android.

Для этого достаточно настроить Project Options в Lazarus для компиляции файла по той же инструкции

https://wiki.lazarus.freepascal.org/Android_tutorial#Compile_the_demo_%22androidlcl%22

Для этого подошел бы готовый файл для импорта настроек.
Для тех, кто не читал вышеуказанную статью.


Google translate

Quote
Often, to develop for Android you don't even need to install the Android SDK/NDK; when you install the cross compiler, the necessary libraries will be downloaded.

Yes, I agree.
If we are talking about simple applications.
In the form of executable files.
To run through the Linux or Android terminal.

To do this, just configure Project Options in Lazarus to compile the file using the same instructions

https://wiki.lazarus.freepascal.org/Android_tutorial#Compile_the_demo_%22androidlcl%22

A ready-made file for importing settings would be suitable for this.
For those who have not read the above article.

Artyom

  • Guest
Re: Why there is no build-in cross compilation support for windows version?
« Reply #22 on: April 28, 2025, 04:44:42 pm »
И в заключение, хочу добавить мое мнение про эту статью в общем и целом.
https://wiki.lazarus.freepascal.org/Android_tutorial#Compile_the_demo_%22androidlcl%22

В статье описан ещё один способ сделать apk-file.
Нужно взять готовый шаблон apk-приложения.
А проект Lazarus скомпилировать в библиотеку с расширением .so.
В примере это файл liblclapp.so

Компиляция выполняется путем настройки Project Options в Lazarus.

Затем можно использовать эту библиотеку в шаблоне apk-приложения.

В данном примере это директория в шаблоне apk-приложения
android\libs\armeabi\liblclapp.so

Затем взять готовый bat-файл.
Немного отредактировать.
Запустить bat-файл и собрать apk-приложение.
Снова нужны Android SDK, NDK и JDK.
Шаблон apk-приложения можно взять из директории, где лежит пример проекта.
laz4android\examples\androidlcl

Только неизвестно, подходит ли этот шаблон для других проектов Lazarus.

Думаю, что скорее всего этот способ подходит для lite-проектов такого же уровня как в примере.
Возможно, у некоторых пользователей Lazarus и найдутся такие lite-проекты.
Так что лично мне статья очень понравилась. Очень подробная инструкция, где и что взять, куда положить и как собрать.

Побольше бы таких инструкций для пользователей Lazarus. На тему how to make, build or cross-compile.

Это ещё один альтернативный вариант - когда разработчики будут чаще писать такие статьи, где и что брать и как пользоваться тем, что они разработали для Lazarus.


Google translate


And finally, I want to add my opinion about this article in general.
https://wiki.lazarus.freepascal.org/Android_tutorial#Compile_the_demo_%22androidlcl%22

The article describes another way to make an apk file.
You need to take a ready-made apk application template.
And compile the Lazarus project into a library with the .so extension.
In the example, this is the liblclapp.so file

Compilation is performed by configuring Project Options in Lazarus.

Then you can use this library in the apk application template.

In this example, this is a directory in the apk application template
android\libs\armeabi\liblclapp.so

Then take the ready-made bat file.
Edit it a little.
Run the bat file and build the apk application.
Again, you need the Android SDK, NDK and JDK.
The apk application template can be taken from the directory where the example project is located.
laz4android\examples\androidlcl

It is just not known whether this template is suitable for other Lazarus projects.

I think that most likely this method is suitable for lite projects of the same level as in the example.
Perhaps some Lazarus users will have such lite projects.
So personally I really liked the article. Very detailed instructions on where and what to get, where to put it and how to assemble it.

There should be more instructions like this for Lazarus users. On the topic of how to make, build or cross-compile.

This is another alternative option - when developers will write more articles like this on where and what to get and how to use what they have developed for Lazarus.

Seenkao

  • Hero Member
  • *****
  • Posts: 702
    • New ZenGL.
Re: Why there is no build-in cross compilation support for windows version?
« Reply #23 on: April 28, 2025, 05:41:52 pm »
Здесь я выкладывал видео по сборке проекта под Android. Для данных сборок кроме кросскомпилятора и Android Studio (SDK, NDK) не нужно больше ни чего делать. Думаешь многие этим пользуются? Хорошо если вообще кто-то пробовал.

Тебе надо взглянуть на это всё с другой стороны. FPC/Lazarus - это открытый проект, и люди улучшают его изо дня в день.
LAWM - это другой проект, которым занимается другой человек (изначально по своему желанию).
FPCUPDeluxe - это третий проект, где так же занимается ещё один человек.

На кого из них ты хочешь взвалить дополнительную поддержку "твоих" хотелок? Я не думаю, что человек убивший множество времени на одни из проектов, захочет ещё дополнительно взять на себя ношу другого проекта. У каждого человека есть свои предпочтения и он выберет то, что  ему больше подходит в данное время. А это зависит от разных факторов.

Твои желания могут исполнится либо по чистой случайности (кто-то захотел то же самое что и ты и реализовал), либо ты можешь сам этим заняться и предоставить решение в общий доступ. Если ты решишься на подобный поступок, то я тебя сразу предупреждаю, что решение "чисто для тебя" маловероятно что взлетит. Если твоё решение сломается у кого-то другого, то вероятнее всего, что тебе об этом даже не сообщат. А если сообщат, то тебе желательно решить эту проблему, чтобы она не возникала у других людей.

Поверь мне, я знаю. Я веду маленький проект, но и на него уходит очень много времени.

Так что, то что ты пишешь, это больше сотрясание воздуха. И не более.  :(
Извиняюсь за откровенность.
-----------------------------------------------------------


Google translate:
HereI posted a video on assembling a project for Android. For these assemblies, apart from the cross-compiler and Android Studio (SDK, NDK), you don't need to do anything else. Do you think many people use this? It's good if anyone has tried it at all.

You need to look at it from a different perspective. FPC/Lazarus is an open source project, and people are improving it day after day.
LAWM is another project, which is being worked on by another person (initially by his own free will).
FPCUPDeluxe is the third project, where another person is also involved.

Which of them do you want to burden with additional support of "your" wishes? I don't think that a person who has spent a lot of time on one of the projects will want to take on the burden of another project. Each person has their own preferences and they will choose what suits them best at the moment. And this depends on various factors.

Your wishes can come true either by pure chance (someone wanted the same thing as you and implemented it), or you can do it yourself and provide the solution for everyone to access. If you decide to do such an act, then I warn you right away that a solution "purely for you" is unlikely to take off. If your solution breaks for someone else, then most likely, you will not even be informed about it. And if they are informed, then it is advisable for you to solve this problem so that it does not arise for other people.

Believe me, I know. I'm running a small project, but it takes a lot of time.

So what you're writing is more like hot air. And nothing more. :(
I apologize for being frank.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

 

TinyPortal © 2005-2018