Delphi Compiles Code to Linux 64-bit Server


If you are on the EMB subscription, you should recently get invitiation email to try the preview build – Delphi 10.2 Tokyo, which now supports 64-bit Linux server native code.

delphi-tokyo-installation-supports-64-bit-linux Delphi Compiles Code to Linux 64-bit Server 64 bit delphi linux linux shell news technology news ubuntu

delphi-tokyo-installation-supports-64-bit-linux

It is still at beta-preview, so it is estimated to come out officially sometime this year e.g. April.

Delphi now supports several major platforms, including 64-bit Linux Server (It used to be called – Kylix, but this feature was dropped).

delphi-supports-several-major-platforms Delphi Compiles Code to Linux 64-bit Server 64 bit delphi linux linux shell news technology news ubuntu

delphi-supports-several-major-platforms

Delphi for Linux Comes Back

Currently, it is just the Delphi language. So it means that you can’t use C++ Builder for Linux code. However, with Delphi for Linux, there comes with some limitations:

Console Application or DLL

Support for Linux native code compilation limits to console applications and DLLs.

Only 64-bit

It does not support 32-bit Linux, but this is not a big problem because Linux 64-bit is preferred and most popular nowadays.

No Windows-related Units

It makes senses that Linux does not know what is “windows.pas” unit. So if you have windows-related code e.g. COM, it won’t compile when targetd Linux.

no-windows-unit Delphi Compiles Code to Linux 64-bit Server 64 bit delphi linux linux shell news technology news ubuntu

no-windows-unit

Also, it does not support GUI stuffs, so no Forms.pas unit etc. It is a set back compared to Kylix long time ago.

Write One Code, Compile to Multiple Platforms

The beauty of Delphi RAD (Rapid Application Development) IDE, is that you can write one code, and compile it to multiple platforms

Sample-Delphi-HelloWorld-For_Linux-Server Delphi Compiles Code to Linux 64-bit Server 64 bit delphi linux linux shell news technology news ubuntu

Sample-Delphi-HelloWorld-For_Linux-Server

e.g. You can write code on windows and compile to native Linux code directly!

delphi-compiles-to-64-bit-linux-server-code-directly Delphi Compiles Code to Linux 64-bit Server 64 bit delphi linux linux shell news technology news ubuntu

delphi-compiles-to-64-bit-linux-server-code-directly

How to SetUp PAServer?

The PAServer is a console application that you need to copy to your Linux server. It is located at Delphi installation folder \PAServer\LinuxPAServer19.0.tar. It is a tar file and you need to extract the contents.

1
tar -xvf LinuxPAServer19.0.tar
tar -xvf LinuxPAServer19.0.tar

Then, run the command ./PAServer

1
2
3
4
5
6
7
8
Platform Assistant Server  Version 10.0.1.18
Copyright (c) 2009-2016 Embarcadero Technologies, Inc.
 
Connection Profile password <press Enter for no password>:
 
Starting Platform Assistant Server on port 64211
 
Type ? for available commands
Platform Assistant Server  Version 10.0.1.18
Copyright (c) 2009-2016 Embarcadero Technologies, Inc.

Connection Profile password <press Enter for no password>:

Starting Platform Assistant Server on port 64211

Type ? for available commands

So, remember your server’s native code (without debugging or running remotely in your Linux server).

What is the Version Number for Delphi 102 Tokyo?

It is 32 or VER320. e.g. VER310 is the Delphi Berlin.

(*
  CompilerVersion is assigned a value by the compiler when
  the system unit is compiled.  It indicates the revision level of the
  compiler features / language syntax, which may advance independently of
  the RTLVersion.  CompilerVersion can be tested in $IF expressions and
  should be used instead of testing for the VERxxx conditional define.
  Always test for greater than or less than a known revision level.
  It's a bad idea to test for a specific revision level.
*)
{$IFDEF VER320}
  Writeln(CompilerVersion : 0: 0);
{$ENDIF}

What is the Compiler Directive for Linux 64 bit?

You could use LINUX or LINUX64:

{IFDEF LINUX}
 // linux
{$ENDIF}

{IFDEF LINUX64}
  // linux 64 bit
{$ENDIF}

And also, the following may be useful:

{$IFNDEF MSWINDOWS}
// Not Windows, e.g. maybe LINUX, MAC, IOS, ANDROID ...
{$ENDIF}

Related Delphi for Linux 64-bit Posts

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
1000 words
Last Post: How to Make Ping Tests to Global Servers using PHP?
Next Post: Cloud VPS are Better Than Traditional VPS Hosting

The Permanent URL is: Delphi Compiles Code to Linux 64-bit Server

One Response

  1. Zoltan

Leave a Reply