Author: h.mohri
I tried Delphi on Amazon Linux.
Amazon Linux is Linux that exists only in the instance of EC2(AWS).
“Free tier eligible” can be used.
[Create an instance.]
Select Amazon Linux from EC 2 and create a new instance.
It is possible to connect with SSH in the initial state.
[Environment building]
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Linux_Application_Development
Install the SDK referring to the above URL.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/compile-software.html
1 2 |
# sudo yum groupinstall "Development Tools" |
It will be OK if “Complete!” Is displayed.
[Setting up PAServer]
PAServer exists in the 10.2 Tokyo directory.
1 2 |
# C:Program Files (x86)EmbarcaderoStudio19.0PAServerLinuxPAServer19.0.tar.gz |
This using the SFTP and put in EC2(Amazon Linux).
Unzip LinuxPAServer19.0.tar.gz.
1 2 |
# tar -zxvf LinuxPAServer19.0.tar.gz |
Allow 64211 port on EC2 security management screen.
1 2 |
# ./PAServer-19.0/paserver |
Connect test to start paserver.
Work on the RAD Studio side. [Tools]→[Options]→[Connection Profile Manager]
Enter the IP address,
Confirm that you succeeded by clicking the “Test Connection” button.
[Options]→[SDK Manager]→[Add New SDK]
Select the “Amazon Linux AMI 2017.03”.
Start SDK import.
After Completed, it runs in a new project.
I get an error.
1 2 3 4 |
/// [DCC Error] E2597 C:Program Files (x86)EmbarcaderoStudio19.0binld-linux.exe: error: cannot find -lgcc_s C:Program Files (x86)EmbarcaderoStudio19.0binld-linux.exe: error: cannot find -lcurl C:Program Files (x86)EmbarcaderoStudio19.0binld-linux.exe: error: cannot find -lz |
Install some missing libraries.
1 2 3 |
# sudo yum install -y gcc gcc-c++ sudo yum install -y openssl-devel |
Import the SDK again.
Since an error occurs, change the name of so file on Windows side.
libgcc_s.so.1 → libgcc_s.so
libcurl.so.4 → libcurl.so
[Execute this code.]
It is a simple http connection program code using TNetHTTPClient.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
///// uses System.SysUtils, System.Net.URLClient, System.Net.HttpClient, System.Net.HttpClientComponent; var netc_: TNetHTTPClient; res_: IHTTPResponse; s_: String; begin try netc_ := TNetHTTPClient.Create(nil); try res_ := netc_.Get('http://mojeld.com/'); s_ := res_.ContentAsString(TEncoding.UTF8); Writeln(s_); finally netc_.DisposeOf; end; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. |
[result]
I was able to run Delphi on Amazon Linux(EC2).
Do you want to try Delphi on Linux? Try the IDE Software, which can help you create apps in Delphi or C++ environments.
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition