#1 2021-11-11 16:57:29

wxinix
Member
Registered: 2020-09-07
Posts: 121

Will mORMOT/Delphi work together on Linux?

To use mORMot on Linux, do I have to use FPC?

What is the best option on Linux, Delphi, or FPC?

Offline

#2 2021-11-11 17:11:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Will mORMOT/Delphi work together on Linux?

Currently, we only support FPC. Which is therefore the best option. wink

The main reason is that it works perfectly, and gives pretty good performance and stability.
This is my main development platform these last years: FPC + Lazarus on Debian. And it gives the best optimization attention, because it is what we use for high-demanding servers.
The subsidiary reason is that we don't have any Delphi Linux license, so we can't make any testing.

It may be more easily feasible with mORMot 2 than with mORMot 1, by the way. Almost only mormot.core.os.pas and mormot.net.sockets.posix.inc have specific OS code.
But anyone is welcome providing patches and pull request on GitHub!

Offline

#3 2021-11-11 17:23:46

wxinix
Member
Registered: 2020-09-07
Posts: 121

Re: Will mORMOT/Delphi work together on Linux?

Thank you. Will take you advice

So there will be no problem to run mORMot on Kali linux ( since it is a variant of Debian)?

Offline

#4 2021-11-11 17:52:03

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Will mORMOT/Delphi work together on Linux?

I never tested Kali itself, but we mostly use Debian or Ubuntu on production, so it should be just fine.

Offline

#5 2021-11-11 21:03:44

wxinix
Member
Registered: 2020-09-07
Posts: 121

Re: Will mORMOT/Delphi work together on Linux?

Thank you @ab

Forgive my ignorance. Is FPC based on LLVM (or gcc), or it is by itself?  Since it is your favorite, I guess performance wise, it would generate better optimized binary code than Delphi?

Offline

#6 2021-11-12 07:54:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Will mORMOT/Delphi work together on Linux?

No, FPC is his own full stack compiler.
It can use LLVM https://wiki.freepascal.org/LLVM but it is not the natural way of using it. See the FAQ of this link.

The FPC 3.2 code is generally in pairs with Delphi code, sometimes slower, sometimes faster (e.g. it features branchless cmov operations, or div per mul reciprocal, or has less buggy inlining).
In practice, we optimize the mORMot 2 source code for FPC + Linux X86_64. The mORMot 1 version was somehow more optimized for Delphi 32-bit.

Offline

#7 2021-11-12 15:15:34

wxinix
Member
Registered: 2020-09-07
Posts: 121

Re: Will mORMOT/Delphi work together on Linux?

It seems FPC when using LLVM, would give faster code in some cases. Would you recommend (or against?) using FPC/LLVM for mORMot on Linux x86-64?

Offline

#8 2021-11-12 15:52:17

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Will mORMOT/Delphi work together on Linux?

FPC-LLVM is currently untested on our side.
May work - or most probably may not...

Offline

#9 2021-11-14 20:39:50

wxinix
Member
Registered: 2020-09-07
Posts: 121

Re: Will mORMOT/Delphi work together on Linux?

Thank you @ab again for the advice.  I installed Lazarus on Windows and on Kali Linux,  with the docked layout enabled.   It looks quite similar to Delphi, and very neat.

I am surprised and impressed that Lazarus/FPC has progressed this good.  It is great to be able to directly build applications inside Linux.

Thanks again!  Go mORMot~

Offline

#10 2021-11-15 08:21:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Will mORMOT/Delphi work together on Linux?

Tip: ensure you use fpdebug +gdb as debugger in Lazarus.
It is much more stable and responsive, especially on Windows, but also on Linux. It requires Dwarf 3 debug info format.

It will be the default debugger for the upcoming Lazarus 2.2 - see https://forum.lazarus.freepascal.org/in … 021.0.html

Offline

#11 2021-11-15 15:01:55

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: Will mORMOT/Delphi work together on Linux?

ab wrote:

Tip: ensure you use fpdebug +gdb as debugger in Lazarus.

Can you give more details? I can choose only FpDebug or GDB as backend - how can I choose "fpdebug +gdb"?
4e86e5b39096947cf8a3acc520a550f7.jpeg

Offline

#12 2021-11-15 17:18:18

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Will mORMOT/Delphi work together on Linux?

I guess with the new Lazarus, FpDebug is not shown as "+gdb" but it is using it behind the scene IIRC.

So don't worry, you have the right debugger if you select fpdebugg in the list.

Offline

#13 2021-11-16 12:16:41

trx
Member
Registered: 2015-08-30
Posts: 30

Re: Will mORMOT/Delphi work together on Linux?

FpDebug does not use gdb, it is a dwarf debugger written in pascal.
See https://wiki.freepascal.org/FpDebug for more info.

In any case, it is currently the best debugger backend for Lazarus (it works the best for me that is).

Last edited by trx (2021-11-16 12:18:12)

Offline

#14 2021-11-16 22:35:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: Will mORMOT/Delphi work together on Linux?

@trx
You are right: I was using an old version of FpDebug which still used gdb.
https://wiki.freepascal.org/LazDebuggerFp is much more stable.

Offline

Board footer

Powered by FluxBB