Sign in Join

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

Mailing lists / fpc-devel / 2014-10

Small virtual machine to cross compile FPC

11 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Paul Breneman

I've spent a bit of time during the past 7 years trying to figure out how to simplify things by avoiding cross-compiling. This page has many of the details:
http://turbocontrol.com/monitor.htm

I think there is a way to simplify cross-compiling. Levinux is a small (~20 MB) QEMU download for x86 PCs (Windows, OS X, Linux) that provides a small Tiny Core Linux VM. I'd like to see something similar but with all the files and tools needed to pull the latest source code and cross-compile FPC (also with Debian instead of Tiny Core?). http://mikelev.in/ux/

It seems to me that such a small VM should allow a nice standard method that will make it easy to test and see things work.

I look forward to your thoughts and comments!

Reply by email

Hans-Peter Diettrich
to Paul Breneman
Show quoted text 16 lines
I've spent a bit of time during the past 7 years trying to figure out how to simplify things by avoiding cross-compiling. This page has many of the details: http://turbocontrol.com/monitor.htm I think there is a way to simplify cross-compiling. Levinux is a small (~20 MB) QEMU download for x86 PCs (Windows, OS X, Linux) that provides a small Tiny Core Linux VM. I'd like to see something similar but with all the files and tools needed to pull the latest source code and cross-compile FPC (also with Debian instead of Tiny Core?). http://mikelev.in/ux/ It seems to me that such a small VM should allow a nice standard method that will make it easy to test and see things work. I look forward to your thoughts and comments!

I wonder why you need or use cross-compilation at all?

The biggest part of an cross compiler are the target specific libraries and tools, which allow to create executables for use on a specific target. IMO it will be easier to create a dedicated VM for every target, and install FPC there, instead of adding cross-compilation features for many targets to whatever machine. Mobile devices often require their own emulator, or a physical device, for program development, a single VM is of little use herefore. IMO.

DoDi

Reply by email

Mark Morgan Lloyd
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 28 lines
Paul Breneman schrieb: > I've spent a bit of time during the past 7 years trying to figure out > how to simplify things by avoiding cross-compiling. This page has > many of the details: > http://turbocontrol.com/monitor.htm > > I think there is a way to simplify cross-compiling. Levinux is a > small (~20 MB) QEMU download for x86 PCs (Windows, OS X, Linux) that > provides a small Tiny Core Linux VM. I'd like to see something > similar but with all the files and tools needed to pull the latest > source code and cross-compile FPC (also with Debian instead of Tiny > Core?). > http://mikelev.in/ux/ > > It seems to me that such a small VM should allow a nice standard > method that will make it easy to test and see things work. > > I look forward to your thoughts and comments! I wonder why you need or use cross-compilation at all? The biggest part of an cross compiler are the target specific libraries and tools, which allow to create executables for use on a specific target. IMO it will be easier to create a dedicated VM for every target, and install FPC there, instead of adding cross-compilation features for many targets to whatever machine. Mobile devices often require their own emulator, or a physical device, for program development, a single VM is of little use herefore. IMO.

I've run builds of FPC and (to some extent) Lazarus natively using Qemu etc., and there can be serious speed issues. In particular, a PC used as a cross-development host is likely to have more memory than a target system which will have major implications on (linkage) speed, and it's probably undesirable to thrash a target system if its filesystem is based on Flash.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Paul Breneman
to Paul Breneman: I've spent a bit of time during the past 7 years trying to figure out how to simplify…
Paul Breneman wrote 16 lines
I've spent a bit of time during the past 7 years trying to figure out how to simplify things by avoiding cross-compiling. This page has many of the details: http://turbocontrol.com/monitor.htm I think there is a way to simplify cross-compiling. Levinux is a small (~20 MB) QEMU download for x86 PCs (Windows, OS X, Linux) that provides a small Tiny Core Linux VM. I'd like to see something similar but with all the files and tools needed to pull the latest source code and cross-compile FPC (also with Debian instead of Tiny Core?). http://mikelev.in/ux/ It seems to me that such a small VM should allow a nice standard method that will make it easy to test and see things work. I look forward to your thoughts and comments!

I'm not suggesting a single VM for multiple uses.

How hard would it be to make a small VM (~100 MB with Debian?) that will run on a x86 PC and download FPC and Lazarus source (trunk) and configure Lazarus for Android development?

I think having a small VM (that doesn't depend on anything on the user's PC) that can easily demonstrate things would be very nice.

Reply by email

Michael Van Canneyt
to Paul Breneman
Paul Breneman wrote 23 lines
On 10/27/2014 06:09 PM, Paul Breneman wrote: > I've spent a bit of time during the past 7 years trying to figure out > how to simplify things by avoiding cross-compiling. This page has many > of the details: > http://turbocontrol.com/monitor.htm > > I think there is a way to simplify cross-compiling. Levinux is a small > (~20 MB) QEMU download for x86 PCs (Windows, OS X, Linux) that provides > a small Tiny Core Linux VM. I'd like to see something similar but with > all the files and tools needed to pull the latest source code and > cross-compile FPC (also with Debian instead of Tiny Core?). > http://mikelev.in/ux/ > > It seems to me that such a small VM should allow a nice standard method > that will make it easy to test and see things work. > > I look forward to your thoughts and comments! I'm not suggesting a single VM for multiple uses. How hard would it be to make a small VM (~100 MB with Debian?) that will run on a x86 PC and download FPC and Lazarus source (trunk) and configure Lazarus for Android development?

I think 100Mb is a bit small.
You'll need cross-binutils, X, cross-dev libs and whatnot.

650Mb would be feasable, I guess.

Michael.

Reply by email

Paul Breneman
to Michael Van Canneyt
Michael Van Canneyt wrote 32 lines
On Fri, 31 Oct 2014, Paul Breneman wrote: > On 10/27/2014 06:09 PM, Paul Breneman wrote: >> I've spent a bit of time during the past 7 years trying to figure out >> how to simplify things by avoiding cross-compiling. This page has many >> of the details: >> http://turbocontrol.com/monitor.htm >> >> I think there is a way to simplify cross-compiling. Levinux is a small >> (~20 MB) QEMU download for x86 PCs (Windows, OS X, Linux) that provides >> a small Tiny Core Linux VM. I'd like to see something similar but with >> all the files and tools needed to pull the latest source code and >> cross-compile FPC (also with Debian instead of Tiny Core?). >> http://mikelev.in/ux/ >> >> It seems to me that such a small VM should allow a nice standard method >> that will make it easy to test and see things work. >> >> I look forward to your thoughts and comments! > > I'm not suggesting a single VM for multiple uses. > > How hard would it be to make a small VM (~100 MB with Debian?) that > will run on a x86 PC and download FPC and Lazarus source (trunk) and > configure Lazarus for Android development? I think 100Mb is a bit small. You'll need cross-binutils, X, cross-dev libs and whatnot. 650Mb would be feasable, I guess.

Thanks for that info, but couldn't most of that be download into the VM *after* it is running? Seems to me I'd like the *smallest* VM and then have a way to load things into that standard PC. But maybe I'm thinking wrongly? If so please help me get it right.

I've looked at (or tried) laz4android and fpcup. Seems that such an approach would work much better on a "standard" PC?

Reply by email

Hans-Peter Diettrich
to Paul Breneman
Show quoted text 9 lines
> I think 100Mb is a bit small. > You'll need cross-binutils, X, cross-dev libs and whatnot. > > 650Mb would be feasable, I guess. Thanks for that info, but couldn't most of that be download into the VM *after* it is running? Seems to me I'd like the *smallest* VM and then have a way to load things into that standard PC. But maybe I'm thinking wrongly? If so please help me get it right.

I don't understand why the VM *size* should matter - unless it's >30GB for current Windows versions. My goal would be a *simple* OS, easy to configure and manage, and then install into it whatever is required. Why download and configure all the required tools whenever the VM is run? This may take half an day, to get the VM up for cross-development, and the downloads end up on the virtual disk as well.

For cross-development I'd install a network of dedicated target VMs, one of which can host the project files, and then build the project in every target VM. This would allow for parallel builds, and every created executable can be tested immediately on its platform - also in parallel for comparison of the GUI and operation. With a single development VM you would need another VM or emulator to perform the final checks, for every single target platform.

I've looked at (or tried) laz4android and fpcup. Seems that such an approach would work much better on a "standard" PC?

Virtual machines work well on the same hardware (CPU), but for other targets (ARM instead of x86) an emulator is required. Wikipedia says that a LiveCD and AndroVM with Android for x86 is available, where it might be possible to develop Android applications somewhat "natively" on an x86 machine. But finally an emulator or physical device is required, where the cross-compiled programs can run on their target CPU, using the according libraries (RTL, VCL... for ARM).

Please don't ask me about Adroid, my experience is limited to FPC/Lazarus development on various Windows and Linux VMs, and I never tried to cross-compile myself. Why cross-compile when I cannot check the results?

DoDi

Reply by email

Paul Breneman
to Hans-Peter Diettrich
Hans-Peter Diettrich wrote 44 lines
Paul Breneman schrieb: >> I think 100Mb is a bit small. >> You'll need cross-binutils, X, cross-dev libs and whatnot. >> >> 650Mb would be feasable, I guess. > > Thanks for that info, but couldn't most of that be download into the > VM *after* it is running? Seems to me I'd like the *smallest* VM and > then have a way to load things into that standard PC. But maybe I'm > thinking wrongly? If so please help me get it right. I don't understand why the VM *size* should matter - unless it's >30GB for current Windows versions. My goal would be a *simple* OS, easy to configure and manage, and then install into it whatever is required. Why download and configure all the required tools whenever the VM is run? This may take half an day, to get the VM up for cross-development, and the downloads end up on the virtual disk as well. For cross-development I'd install a network of dedicated target VMs, one of which can host the project files, and then build the project in every target VM. This would allow for parallel builds, and every created executable can be tested immediately on its platform - also in parallel for comparison of the GUI and operation. With a single development VM you would need another VM or emulator to perform the final checks, for every single target platform. > I've looked at (or tried) laz4android and fpcup. Seems that such an > approach would work much better on a "standard" PC? Virtual machines work well on the same hardware (CPU), but for other targets (ARM instead of x86) an emulator is required. Wikipedia says that a LiveCD and AndroVM with Android for x86 is available, where it might be possible to develop Android applications somewhat "natively" on an x86 machine. But finally an emulator or physical device is required, where the cross-compiled programs can run on their target CPU, using the according libraries (RTL, VCL... for ARM). Please don't ask me about Adroid, my experience is limited to FPC/Lazarus development on various Windows and Linux VMs, and I never tried to cross-compile myself. Why cross-compile when I cannot check the results? DoDi

Thanks DoDi for all of your feedback.

You are correct that the size of the VM doesn't matter much. I was thinking of leaving out things that change often but maybe that is really only the source code.

Building FPC is complex and mobile seems even more complex. So an easy and simple way to see things work might be a valuable first step even though the developer should move over to a better development environment ASAP.

Reply by email

Vsevolod Alekseyev
to Paul Breneman

IMHO, just documenting the cross-building process for mobile would already go a long way. Better yet, shipping prebuilt cross-compiler packs for major desktop platforms. When I say "mobile", I really mean "Android"; iOS is well covered as it is (modulo arm64) and Windows CE is on the way out.

Earlier message 63 lines
-----Original Message----- From: On Behalf Of Paul Breneman Sent: Saturday, November 01, 2014 7:18 AM To: Subject: Re: [fpc-devel] Small virtual machine to cross compile FPC On 11/01/2014 03:13 AM, Hans-Peter Diettrich wrote: > Paul Breneman schrieb: > >>> I think 100Mb is a bit small. >>> You'll need cross-binutils, X, cross-dev libs and whatnot. >>> >>> 650Mb would be feasable, I guess. >> >> Thanks for that info, but couldn't most of that be download into the >> VM *after* it is running? Seems to me I'd like the *smallest* VM and >> then have a way to load things into that standard PC. But maybe I'm >> thinking wrongly? If so please help me get it right. > > I don't understand why the VM *size* should matter - unless it's >30GB > for current Windows versions. My goal would be a *simple* OS, easy to > configure and manage, and then install into it whatever is required. > Why download and configure all the required tools whenever the VM is run? > This may take half an day, to get the VM up for cross-development, and > the downloads end up on the virtual disk as well. > > For cross-development I'd install a network of dedicated target VMs, > one of which can host the project files, and then build the project in > every target VM. This would allow for parallel builds, and every > created executable can be tested immediately on its platform - also in > parallel for comparison of the GUI and operation. With a single > development VM you would need another VM or emulator to perform the > final checks, for every single target platform. > >> I've looked at (or tried) laz4android and fpcup. Seems that such an >> approach would work much better on a "standard" PC? > > Virtual machines work well on the same hardware (CPU), but for other > targets (ARM instead of x86) an emulator is required. Wikipedia says > that a LiveCD and AndroVM with Android for x86 is available, where it > might be possible to develop Android applications somewhat "natively" > on an x86 machine. But finally an emulator or physical device is > required, where the cross-compiled programs can run on their target > CPU, using the according libraries (RTL, VCL... for ARM). > > Please don't ask me about Adroid, my experience is limited to > FPC/Lazarus development on various Windows and Linux VMs, and I never > tried to cross-compile myself. Why cross-compile when I cannot check > the results? > > DoDi Thanks DoDi for all of your feedback. You are correct that the size of the VM doesn't matter much. I was thinking of leaving out things that change often but maybe that is really only the source code. Building FPC is complex and mobile seems even more complex. So an easy and simple way to see things work might be a valuable first step even though the developer should move over to a better development environment ASAP.

Reply by email

Paul Breneman
to Paul Breneman: Thanks DoDi for all of your feedback. You are correct that the size of the VM doesn't…

I didn't know better, but last fall I also posted this topic in the Free Pascal section of the Lazarus forums. Today and yesterday I left notes there about making small VMs with Debian Jessie RC2 *and* ReactOS: http://forum.lazarus.freepascal.org/index.php/topic,26315.0.html

Paul Breneman wrote 56 lines
On 11/01/2014 03:13 AM, Hans-Peter Diettrich wrote: > Paul Breneman schrieb: > >>> I think 100Mb is a bit small. >>> You'll need cross-binutils, X, cross-dev libs and whatnot. >>> >>> 650Mb would be feasable, I guess. >> >> Thanks for that info, but couldn't most of that be download into the >> VM *after* it is running? Seems to me I'd like the *smallest* VM and >> then have a way to load things into that standard PC. But maybe I'm >> thinking wrongly? If so please help me get it right. > > I don't understand why the VM *size* should matter - unless it's >30GB > for current Windows versions. My goal would be a *simple* OS, easy to > configure and manage, and then install into it whatever is required. Why > download and configure all the required tools whenever the VM is run? > This may take half an day, to get the VM up for cross-development, and > the downloads end up on the virtual disk as well. > > For cross-development I'd install a network of dedicated target VMs, one > of which can host the project files, and then build the project in every > target VM. This would allow for parallel builds, and every created > executable can be tested immediately on its platform - also in parallel > for comparison of the GUI and operation. With a single development VM > you would need another VM or emulator to perform the final checks, for > every single target platform. > >> I've looked at (or tried) laz4android and fpcup. Seems that such an >> approach would work much better on a "standard" PC? > > Virtual machines work well on the same hardware (CPU), but for other > targets (ARM instead of x86) an emulator is required. Wikipedia says > that a LiveCD and AndroVM with Android for x86 is available, where it > might be possible to develop Android applications somewhat "natively" on > an x86 machine. But finally an emulator or physical device is required, > where the cross-compiled programs can run on their target CPU, using the > according libraries (RTL, VCL... for ARM). > > Please don't ask me about Adroid, my experience is limited to > FPC/Lazarus development on various Windows and Linux VMs, and I never > tried to cross-compile myself. Why cross-compile when I cannot check the > results? > > DoDi Thanks DoDi for all of your feedback. You are correct that the size of the VM doesn't matter much. I was thinking of leaving out things that change often but maybe that is really only the source code. Building FPC is complex and mobile seems even more complex. So an easy and simple way to see things work might be a valuable first step even though the developer should move over to a better development environment ASAP.

Reply by email

Paul Breneman
to Paul Breneman

Today I updated the message for Debian Jessie as it was released last month: http://forum.lazarus.freepascal.org/index.php/topic,26315.msg174469.html#msg174469

Paul Breneman wrote 63 lines
I didn't know better, but last fall I also posted this topic in the Free Pascal section of the Lazarus forums. Today and yesterday I left notes there about making small VMs with Debian Jessie RC2 *and* ReactOS: http://forum.lazarus.freepascal.org/index.php/topic,26315.0.html On 11/01/2014 06:17 AM, Paul Breneman wrote: > On 11/01/2014 03:13 AM, Hans-Peter Diettrich wrote: >> Paul Breneman schrieb: >> >>>> I think 100Mb is a bit small. >>>> You'll need cross-binutils, X, cross-dev libs and whatnot. >>>> >>>> 650Mb would be feasable, I guess. >>> >>> Thanks for that info, but couldn't most of that be download into the >>> VM *after* it is running? Seems to me I'd like the *smallest* VM and >>> then have a way to load things into that standard PC. But maybe I'm >>> thinking wrongly? If so please help me get it right. >> >> I don't understand why the VM *size* should matter - unless it's >30GB >> for current Windows versions. My goal would be a *simple* OS, easy to >> configure and manage, and then install into it whatever is required. Why >> download and configure all the required tools whenever the VM is run? >> This may take half an day, to get the VM up for cross-development, and >> the downloads end up on the virtual disk as well. >> >> For cross-development I'd install a network of dedicated target VMs, one >> of which can host the project files, and then build the project in every >> target VM. This would allow for parallel builds, and every created >> executable can be tested immediately on its platform - also in parallel >> for comparison of the GUI and operation. With a single development VM >> you would need another VM or emulator to perform the final checks, for >> every single target platform. >> >>> I've looked at (or tried) laz4android and fpcup. Seems that such an >>> approach would work much better on a "standard" PC? >> >> Virtual machines work well on the same hardware (CPU), but for other >> targets (ARM instead of x86) an emulator is required. Wikipedia says >> that a LiveCD and AndroVM with Android for x86 is available, where it >> might be possible to develop Android applications somewhat "natively" on >> an x86 machine. But finally an emulator or physical device is required, >> where the cross-compiled programs can run on their target CPU, using the >> according libraries (RTL, VCL... for ARM). >> >> Please don't ask me about Adroid, my experience is limited to >> FPC/Lazarus development on various Windows and Linux VMs, and I never >> tried to cross-compile myself. Why cross-compile when I cannot check the >> results? >> >> DoDi > > Thanks DoDi for all of your feedback. > > You are correct that the size of the VM doesn't matter much. I was > thinking of leaving out things that change often but maybe that is > really only the source code. > > Building FPC is complex and mobile seems even more complex. So an easy > and simple way to see things work might be a valuable first step even > though the developer should move over to a better development > environment ASAP.

Reply by email