[fpc-pascal] How to compile Lazarus program using only FPC?

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Fri Sep 25 10:30:10 CEST 2015


Bo Berglund wrote:
> On Thu, 24 Sep 2015 09:48:32 -0400, Bo Berglund
> <bo.berglund at gmail.com> wrote:
> 
>> I want to check my options regarding Lazarus and FPC.
>>
>> If I develop a program on Windows Lazarus, move it to Debian Lazarus
>> (x86) and then finally want to compile on ARM on for example Raspberry
>> Pi but outside of Lazarus, how is that done?
>> Does FPC recognize the Lazarus project file such that paths etc are
>> observed?
>> Or is thare a separate file for FPC I have to prepare in order to set
>> the unit paths?
> 
> I see from some replies that I was not complete in my formulations...
> What I wanted to ask was what steps I need to take in order to do the
> final compilation on a *headless* ARM platform such as RaspBerry Pi2
> where FPC has been installed but nothing else.
> The development itself would be done in Lazarus (on Windows and
> LinuxMint x86) in order to get the IDE help.
> The application itself is a completely GUI-less program (the original
> on Windows is a service application). It only needs the TCP/IP socket
> functionality apart from the built-in processing of the application.
> For this I am sure I also need threads.
> 
> So for clarity:
> - Present code sits in Delphi on Windows
> - I will first port it over to Lazarus/FPC on Windows as a console
> program
> - Then the next move is to go to Linux on the same platform (x86)
> - Finally, when all is working I will need to compile on a headless
> platform that does not have Lazarus installed (RPi2). THe only access
> is SSH using PuTTY.

Does the program use any Lazarus or LCL (Lazarus Class Libraries) 
facilities? if not then you can simply use FPC from the command line, if 
necessary getting library paths etc. using Lazarus's "Show Options" button.

> If absolutely necessary I will have to set up the RPi with a monitor,
> keyboard and mouse and install Lazarus and compile from there. But RPi
> is not as powerful a computer as the PC and it will probably be very
> slow if at all working....

Absolute rubbish. I've not tried logging into an RPi using VNC or 
(remote) X11 (i.e. XDMCP etc.) but it's entirely feasible to tunnel the 
IDE over SSH, or to do a command-line build (lazbuild) over SSH- I do 
this as routine. The only requirement is that the RPi must have enough 
RAM+swap set up if the program is of significant size... you'll know if 
you need it since you'll see messages about being unable to invoke the 
external assembler or linker.

You /do/ appreciate that you can tunnel the X11 user interface across 
SSH, and that most distreaux enable this by default, don't you?

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list