Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-01

Cross-compile vs native

14 messages · 9 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho
to Brian

I compile native for linux, windows and Mac and cross-compile only for Android.

I use the same project unit for every system except Android.

Felipe Monteiro de Carvalho
Mark Morgan Lloyd
to Brian: A question to those who must maintain a Linux version and a Windows versions application.…
Brian wrote 5 lines
A question to those who must maintain a Linux version and a Windows versions application. Do you tend to cross-compile from Linux or do you compile native (with separate projects) on each OS (Linux and Windows)?

Native where possible, but that's more habit than anything else.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Ewald
to Brian: A question to those who must maintain a Linux version and a Windows versions application.…
Brian wrote 5 lines
A question to those who must maintain a Linux version and a Windows versions application. Do you tend to cross-compile from Linux or do you compile native (with separate projects) on each OS (Linux and Windows)?

Native, because of two reasons:
- Without the target system, the application cannot be tested thoroughly, and if one has the target system, why not build on it?
- Some dependencies (such as autogenerated code) need to be compiled on the target system. It could probably be done on a linux system as well, but same argument as above...

Projects are identical on both platforms though (except for a few ifdefs to access OS-specific functionality).

Ewald
Unknown author
to Brian: A question to those who must maintain a Linux version and a Windows versions application.…

Native on Windows, cross-compile for Linux.

Earlier message 23 lines
-----Original Message----- From: Brian Sent: Tuesday, January 27, 2015 10:56 PM To: Subject: [fpc-pascal] Cross-compile vs native A question to those who must maintain a Linux version and a Windows versions application. Do you tend to cross-compile from Linux or do you compile native (with separate projects) on each OS (Linux and Windows)? Thanks Brian -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Cross-compile-vs-native-tp5720834.html Sent from the Free Pascal - General mailing list fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Graeme Geldenhuys
to Brian: A question to those who must maintain a Linux version and a Windows versions application.…
Brian wrote
Do you tend to cross-compile from Linux or do you compile native (with separate projects) on each OS (Linux and Windows)?

In my experience I found that having various VM's for each target works best. The least amount of hassle, and all VM's sync the source code from the same code repository and all can be compiled with the same command line.

In my case: fpc @extrafpc.cfg <project_name>

The extrafpc.cfg file contains all the settings I need for DEBUG and RELEASE builds.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/
leledumbo
to Brian: A question to those who must maintain a Linux version and a Windows versions application.…
Do you tend to cross-compile from Linux or do you compile native (with

separate projects) on each OS (Linux and Windows)?

Cross compile from Linux. I can use Wine to test Windows compatiblity and I don't have Windows anyway :D

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Cross-compile-vs-native-tp5720834p5720840.html Sent from the Free Pascal - General mailing list .
Michael Schnell
to Ewald: Native, because of two reasons: - Without the target system, the application cannot be…
Ewald wrote
- Without the target system, the application cannot be tested ..

This is true, only because remote debugging is not well supported.

In fact I sometimes to programs to be run on a headless system (e.g. a NAS) Here you can't install Lazarus, because you don't have a GUI.

You easily can install fpc and compile native, though.

So I ended up testing the software on a PC (as far as possible without the hardware) and finally compile it on the target system.

I did not bother to install the cross compiler (the problem here is not fpc itself, but the cross-libraries that are necessary link the project for the target system).

If I would be able to use Lazarus on the development system to remote-debug the target system, the effort to install the complete cross-compile infrastructure would be viable.

-Michael

Mark Morgan Lloyd
to Michael Schnell
Michael Schnell wrote 6 lines
On 01/27/2015 10:27 PM, Ewald wrote: > - Without the target system, the application cannot be tested .. This is true, only because remote debugging is not well supported. In fact I sometimes to programs to be run on a headless system (e.g. a NAS) Here you can't install Lazarus, because you don't have a GUI.

A headless system can still map a GUI to a desktop computer using X, VNC, SSH etc.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Ewald
to Michael Schnell: This is true, only because remote debugging is not well supported. In fact I sometimes to…
Michael Schnell wrote
On 01/27/2015 10:27 PM, Ewald wrote: > - Without the target system, the application cannot be tested .. This is true, only because remote debugging is not well supported.

For remote debugging a target system is needed as well? So even if remote debugging would be easy-peasy, the part you quotes still stands: no target system: no decent testing.

In fact I sometimes to programs to be run on a headless system (e.g. a NAS) Here you can't install Lazarus, because you don't have a GUI.

[this might be an extremely silly proposition, please forgive me] Why don't you run lazarus through ssh? Or use vnc?

Show quoted text 13 lines
You easily can install fpc and compile native, though. So I ended up testing the software on a PC (as far as possible without the hardware) and finally compile it on the target system. I did not bother to install the cross compiler (the problem here is not fpc itself, but the cross-libraries that are necessary link the project for the target system). If I would be able to use Lazarus on the development system to remote-debug the target system, the effort to install the complete cross-compile infrastructure would be viable.

I believe you are saying that you would like to cross-compile and debug the system remotely (which, judging from your other posts, are mostly embedded platforms?), but due to difficulties/roadblocks you are forced to compile it natively and debug it on the target system.

Well, _if_ the cross-compilation works, why not just ssh in to the target system and run gdb there? Please forgive my ignorance as I do not know the exact details of your setup.

Ewald
Michael Schnell
to Ewald
Ewald wrote
[this might be an extremely silly proposition, please forgive me] Why don't you run lazarus through ssh? Or use vnc?

The (small) target system does not have any graphic-related stuff like X, qt or gtk. So VNC, or remote X will not work.

Of course I can access a command line via SSH.

Well, _if_ the cross-compilation works, why not just ssh in to the target system and run gdb there?

Happily, in fact the client system is advanced enough to allow running the full gdb (not just gdb-server).

Of course this does work. And I did just this. But direct manual work on gdb is rather painful. That is why it would be great to use Lazarus for remote debugging.

To do this there are two ways:

1) (this is activated in Lazarus by default) using remote gdb on the server and have same access gdb-server on the client. Here I have not been able to find / compile the appropriate remote gdb / gdb-server pair for the ARM target.

2) (the code to do this is commented out in Lazarus and supposedly not decently working) accessing a full gdb on the client via SSH.

-Michael

fredvs
to Brian: A question to those who must maintain a Linux version and a Windows versions application.…

Hello.

I do main development on Linux 64.

For Windows, i use wine on Linux 64, (fpc.exe 32/64 installed without problem) and compile the source via wine-fpc.exe.

The advantage is that you do not have to copy your source to a virtual machine or a other native Windows.
And you may test your exe too on the same system ;-)

Fred

-----
Many thanks ;-)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Cross-compile-vs-native-tp5720834p5720850.html Sent from the Free Pascal - General mailing list .