Sign in Join

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

Mailing lists / lazarus / 2019-04

Cross compile for Linux x64 on Windows 7 x64?

11 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

I have a command line utility created in Lazarus 2.0.0/fpc 3.0.4 on Windows 7 x64. I use the Lazarus/fpc downloaded via this page: https://www.lazarus-ide.org/index.php?page=downloads

Now I want to compile this project for Linux on the same x64 Intel CPU so I can run it under Ubuntu 16.4 LTS Server x64.
Since that is a headless machine (it is a server) I need to build the utility by cross-compile on my Windows x64 Lazarus installation.

Is there a *simple* instruction on how to do this? I have looked at the doc page:
http://wiki.lazarus.freepascal.org/Cross_compiling but it is too complex for me to understand. I tried to just go to the sections I deemed relevant to my simple (and probably very common) case but they all cross-reference into a maze...

I need a "For Dummies" how-to which presupposes I have installed Lazarus/Fpc for Windows x64 and then tells me what to download extra (and from where) and also how to set up the project environment to make the Linux target.
Is something like that available?

Bo Berglund Developer in Sweden

Reply by email

Marcos Douglas B. Santos
to Bo Berglund
AM Bo Berglund wrote 22 lines
I have a command line utility created in Lazarus 2.0.0/fpc 3.0.4 on Windows 7 x64. I use the Lazarus/fpc downloaded via this page: https://www.lazarus-ide.org/index.php?page=downloads Now I want to compile this project for Linux on the same x64 Intel CPU so I can run it under Ubuntu 16.4 LTS Server x64. Since that is a headless machine (it is a server) I need to build the utility by cross-compile on my Windows x64 Lazarus installation. Is there a *simple* instruction on how to do this? I have looked at the doc page: http://wiki.lazarus.freepascal.org/Cross_compiling but it is too complex for me to understand. I tried to just go to the sections I deemed relevant to my simple (and probably very common) case but they all cross-reference into a maze... I need a "For Dummies" how-to which presupposes I have installed Lazarus/Fpc for Windows x64 and then tells me what to download extra (and from where) and also how to set up the project environment to make the Linux target. Is something like that available?

The fastest and easy way to setup the cross-compilation - and install Lazarus itself - is using fpcupdeluxe
-> https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases

Just get the binary for your platform, run and following the instructions. That's all.

best regards,
Marcos Douglas

Reply by email

Bo Berglund
to Marcos Douglas B. Santos
"Marcos Douglas B. Santos wrote 6 lines
The fastest and easy way to setup the cross-compilation - and install Lazarus itself - is using fpcupdeluxe -> https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases Just get the binary for your platform, run and following the instructions. That's all.

I don't want to scrap my existing installation of Lazarus 2.0.0/fpc 3.0.4 created by the official download on the www.lazarus-ide.org page..

It is configured and I have used it for several projects already....

It seems to me like my question would be solved by downloading the cross-compiler from the additional files page on the lazarus-ide site but I don't know how to go from there...

https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.0/

The file I mean is:
lazarus-2.0.0-fpc-3.0.4-cross-i386-win32-win64.exe

But I don't know if it just contains the fpc cross compiler or if it aso contains some Lazarus version, thus I am hesitant to get it and risk starting over again.

But then there is also the question regarding HOW to use the cross compiler....

Bo Berglund Developer in Sweden

Reply by email

Ralf Quint
to Bo Berglund
Bo Berglund wrote 23 lines
On Tue, 2 Apr 2019 09:26:20 -0300, "Marcos Douglas B. Santos via lazarus" wrote: > The fastest and easy way to setup the cross-compilation - and install > Lazarus itself - is using fpcupdeluxe > -> https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases > > Just get the binary for your platform, run and following the > instructions. That's all. I don't want to scrap my existing installation of Lazarus 2.0.0/fpc 3.0.4 created by the official download on the www.lazarus-ide.org page.. It is configured and I have used it for several projects already.... It seems to me like my question would be solved by downloading the cross-compiler from the additional files page on the lazarus-ide site but I don't know how to go from there... https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.0/ The file I mean is: lazarus-2.0.0-fpc-3.0.4-cross-i386-win32-win64.exe

This is the cross-compiler to compile Win32 programs from a Win64 setup. It is not a cross-compiler to any Linux(-x64) target...

Ralf

---
This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

Reply by email

Bo Berglund
to Ralf Quint
Ralf Quint wrote 5 lines
> The file I mean is: > lazarus-2.0.0-fpc-3.0.4-cross-i386-win32-win64.exe This is the cross-compiler to compile Win32 programs from a Win64 setup. It is not a cross-compiler to any Linux(-x64) target...

OK, then I will have to uninstall that installation (I did it to check what would happen)...

But then how do I get hold of a Linux cross-compiler? Can I just check out some "binutils" for Linux from SVN?

Or do I have to create a virtual Linux machine and install SVN + Lazarus/fpc on that and then pull the project sources over via svn and compile natively?

I found a description over her:
http://wiki.lazarus.freepascal.org/Cross_compiling#From_Windows_to_Linux But it says:
"This is less trivial, there is some info in the buildfaq

See also fpcup for descriptions on which binutils work and what libraries/files to copy.

As the Build FAQ explains, you will need libs (.so files) from the target system, e.g. from /lib and /user/lib (but could be more locations). On some systems, some .so files are actually scripts; check with

grep -i "ld script" *

Remove those .so and copy over (or symlink) the .so.x files that you should have to .so in order for the linker to find them."

I do not really get what *actually* to do from this....

Seems ike I am heading in the wrong direction, but I absolutely was under the impression that one could develop anywhere (Linux or Windows) and then compile for any target in this one development setup...
Probably faster to go the Linux virtual machine path and build natively from sources via svn..

Bo Berglund Developer in Sweden

Reply by email

DougC
to Bo Berglund: I have a command line utility created in Lazarus 2.0.0/fpc 3.0.4 on Windows 7 x64. I use…

I am VERY interested in how this question is answered and resolved. It seems to be a weak point in how the Lazarus/FPC effort has developed.

This type of question has prevented me from diving into the Lazarus/FPC ecosystem because there seem to be regular requests for help in resolving this type of issue.

Doug C.

---- On Tue, 02 Apr 2019 08:14:39 -0400 Bo Berglund via lazarus wrote ----

I have a command line utility created in Lazarus 2.0.0/fpc 3.0.4 on

Windows 7 x64. I use the Lazarus/fpc downloaded via this page:

https://www.lazarus-ide.org/index.php?page=downloads

Now I want to compile this project for Linux on the same x64 Intel CPU

so I can run it under Ubuntu 16.4 LTS Server x64.

Since that is a headless machine (it is a server) I need to build the

utility by cross-compile on my Windows x64 Lazarus installation.

Is there a *simple* instruction on how to do this? I have looked at

the doc page:

http://wiki.lazarus.freepascal.org/Cross_compiling

but it is too complex for me to understand. I tried to just go to the

sections I deemed relevant to my simple (and probably very common)

case but they all cross-reference into a maze...

I need a "For Dummies" how-to which presupposes I have installed

Lazarus/Fpc for Windows x64 and then tells me what to download extra

(and from where) and also how to set up the project environment to

make the Linux target.

Is something like that available?

Bo Berglund Developer in Sweden --

Reply by email

Alfred
to DougC

As maintainer of fpcupdeluxe, I feel the need of stepping into this discussion.
(which I do not often do, because of the freedom of choice)

Yes, setting up cross-compiling is a non-trivial task. This is why fpcup(deluxe) has been created by its original author (BigChimp).

He wanted to give the users of FPC and Lazarus:
* an easy way of installing different versions of FPC and Lazarus.
* isolate these installs
* enable easy cross-compilation

So, just
* use fpcupdeluxe
* have a look at the forum about fpcupdeluxe
* see how cross-compiling is setup and done

And, do not use fpcupdeluxe if you do not want to. As I said, the freedom is yours.

------ Origineel bericht ------
Van: "DougC via lazarus"
Aan: "lazarus"
CC: "DougC"
Verzonden: 2-4-2019 22:00:18
Onderwerp: Re: [Lazarus] Cross compile for Linux x64 on Windows 7 x64?

Show quoted text 47 lines
I am VERY interested in how this question is answered and resolved. It seems to be a weak point in how the Lazarus/FPC effort has developed. This type of question has prevented me from diving into the Lazarus/FPC ecosystem because there seem to be regular requests for help in resolving this type of issue. Doug C. ---- On Tue, 02 Apr 2019 08:14:39 -0400 Bo Berglund via lazarus wrote ---- >I have a command line utility created in Lazarus 2.0.0/fpc 3.0.4 on >Windows 7 x64. I use the Lazarus/fpc downloaded via this page: >https://www.lazarus-ide.org/index.php?page=downloads > >Now I want to compile this project for Linux on the same x64 Intel CPU >so I can run it under Ubuntu 16.4 LTS Server x64. >Since that is a headless machine (it is a server) I need to build the >utility by cross-compile on my Windows x64 Lazarus installation. > >Is there a *simple* instruction on how to do this? I have looked at >the doc page: >http://wiki.lazarus.freepascal.org/Cross_compiling >but it is too complex for me to understand. I tried to just go to the >sections I deemed relevant to my simple (and probably very common) >case but they all cross-reference into a maze... > >I need a "For Dummies" how-to which presupposes I have installed >Lazarus/Fpc for Windows x64 and then tells me what to download extra >(and from where) and also how to set up the project environment to >make the Linux target. >Is something like that available? > > >-- >Bo Berglund >Developer in Sweden > >-- >_______________________________________________ >lazarus mailing list > >https://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190402/ad1b776e/attachment-0001.html>

Reply by email

Marcos Douglas B. Santos
to Bo Berglund: On Tue, 2 Apr 2019 09:26:20 -0300, "Marcos Douglas B. Santos via I don't want to scrap my…
AM Bo Berglund wrote 16 lines
On Tue, 2 Apr 2019 09:26:20 -0300, "Marcos Douglas B. Santos via lazarus" wrote: >The fastest and easy way to setup the cross-compilation - and install >Lazarus itself - is using fpcupdeluxe >-> https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases > >Just get the binary for your platform, run and following the >instructions. That's all. I don't want to scrap my existing installation of Lazarus 2.0.0/fpc 3.0.4 created by the official download on the www.lazarus-ide.org page.. It is configured and I have used it for several projects already....

I would say that you just basically need to:
- install a new one
- rewrite your setup files (.xml) at the fpcup default directory
- build Lazarus again to install components that you might have in your current IDE

That is pretty almost everything.

However, feel free to setup it manually.

regards,
Marcos Douglas

Reply by email

Bo Berglund
to DougC: I am VERY interested in how this question is answered and resolved. It seems to be a weak…
DougC wrote 7 lines
I am VERY interested in how this question is answered and resolved. It seems to be a weak point in how the Lazarus/FPC effort has developed. This type of question has prevented me from diving into the Lazarus/FPC ecosystem because there seem to be regular requests for help in resolving this type of issue.

I decided that it would be easier to just use a LinuxMint19x64 virtual machine that I had already installed fpc 3.0.4/lazarus 1.8.5 into.

I checked out the lazarus 2.0.0 sources and issued the make bigide inside of the checkout and then created the application launch desktop file.

Then checked out the project files via svn into the LinuxMint vm and opened the project inside Lazarus 2.0.0 and it built right away. Simplest solution since I already had the virtual linux machine available....

Now I will go for what I really wanted to do, i.e create a command line version of the utility, which I can use on a headless Ubuntu 16.04 server.

Bo Berglund Developer in Sweden

Reply by email

Carlos Eduardo S. M.

For me, the simplest solution is installing Ubuntu in a dual boot or, even better, in a virtual machine (e.g. free VMWare Player) with access to the Windows' Lazarus project folder. Independent install and configuration of Lazarus and debugging for each platform.

[]'s,

Carlos Eduardo S. Matuzaki
Curitiba / Parana' / Brazil

Show quoted text 30 lines
Date: Tue, 02 Apr 2019 08:14:39 -0400 From: Bo Berglund To: Subject: [Lazarus] Cross compile for Linux x64 on Windows 7 x64? Message-ID: Content-Type: text/plain; charset=us-ascii I have a command line utility created in Lazarus 2.0.0/fpc 3.0.4 on Windows 7 x64. I use the Lazarus/fpc downloaded via this page: https://www.lazarus-ide.org/index.php?page=downloads Now I want to compile this project for Linux on the same x64 Intel CPU so I can run it under Ubuntu 16.4 LTS Server x64. Since that is a headless machine (it is a server) I need to build the utility by cross-compile on my Windows x64 Lazarus installation. Is there a *simple* instruction on how to do this? I have looked at the doc page: http://wiki.lazarus.freepascal.org/Cross_compiling but it is too complex for me to understand. I tried to just go to the sections I deemed relevant to my simple (and probably very common) case but they all cross-reference into a maze... I need a "For Dummies" how-to which presupposes I have installed Lazarus/Fpc for Windows x64 and then tells me what to download extra (and from where) and also how to set up the project environment to make the Linux target. Is something like that available?

---
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus

Reply by email

Bo Berglund
to Carlos Eduardo S. M.
"Carlos Eduardo S. M. wrote 5 lines
For me, the simplest solution is installing Ubuntu in a dual boot or, even better, in a virtual machine (e.g. free VMWare Player) with access to the Windows' Lazarus project folder. Independent install and configuration of Lazarus and debugging for each platform.

I agree on the first part about the virtual machine. I have already done so.
But no shared folder, I checked out the project using SVN to the linux machine and opened the project there. Worked fine. So I work in Linux on the same project via Subversion.

Bo Berglund Developer in Sweden

Reply by email