Recent

Author Topic: Configure Debugger and project for cross-compilation: Windows AND Linux.  (Read 9168 times)

DelphiLazus

  • New Member
  • *
  • Posts: 34
First of all, Happy New Year!
I know many are in times of parties and celebrations and/or on vacation, so I do not expect an answer soon.
Not sure if this is the most appropriate forum in which to open this thread, I beg your pardon if I'm wrong.

I have a system to develop for Windows and Linux. I currently have not had the opportunity to perform compilation as for other platforms.

And looking documentation I have come to see a video:
https://www.youtube.com/watch?v=qT9fm0lQA7I

It does look pretty simple when it is from Windows to Linux.
But this brought me more questions ... What if I need to compile for both OS: Windows and Linux? How should proceed? Is it possible to establish more than one OS Tarjet? What if I need to compile for 32bit and 64bit?
What should I to configure in both the debugger and the project?

Currently I own CodeTyphon use Windows 5.5 and 8.1 to work. Mi notebook is 64bits. I have pending install any distro of Linux, possibly Manjaro which is what one of my clients most important used.
CT install me Lazarus in 32bit and 64bit, and as I have understood I use each to proceed to compile the same project to generate executable on 32bit and 64bit respectively.

I recognize that being a multiplatform certain things I care program. My intention is to follow the guidance that is in the wiki itself:
http://wiki.freepascal.org/Multiplatform_Programming_Guide

But not if I am a fool or gross to find documentation on how to properly configure everything to work on a project for multiplatform. For now, at least I've configured the debugger and the project following the recommendations given for Windows:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Win_64_bit
http://wiki.lazarus.freepascal.org/Debugger_Setup

I would like, if possible if there is someone with some time to give me some guidance, and if not too good to abuse the trust of some sound advice based on their experiences.

Best Regards,
PS: Sorry for my poor english.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #1 on: December 31, 2015, 07:12:32 am »
http://wiki.freepascal.org/Cross_compiling should cover all the basic info.

DelphiLazus

  • New Member
  • *
  • Posts: 34
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #2 on: December 31, 2015, 02:19:10 pm »
http://wiki.freepascal.org/Cross_compiling should cover all the basic info.
Thanks for the documentation Leledumbo.
I shall read these days, after the holidays. I hope this can evacuate me questions, or at least guide me a little more.

Best Regards,

DelphiLazus

  • New Member
  • *
  • Posts: 34
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #3 on: January 05, 2016, 11:43:19 pm »
I've had time to read the article link, but it still remains my question. I need my application for Windows AND Linux.
In The link to the video that I put in the first post are the steps to build from Windows to Linux.
My question is how do I do if I need to compile from Windows to Windows AND Linux? Do I have to change the tarjet whenever I need to compile for each platform? Not is possible to specify 2 or more tarjet? And if possible, how and who should be configured?

Because one when developing a system is compiling and testing until it has done. And if it's not convenient to have to be changing the target and configure all whenever I need to compile and testing for each OS. This is what confuses me.
Or is it recommended to make compile to Linux when I have the final product to testing?

Regards,
PS: Sorry for my poor english.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #4 on: January 07, 2016, 01:50:36 pm »
I never did cross-compiling, but if I remember correctly, you can have two different Lazarus installed, one to compile Windows and the other to compile Linux.

Also, you can save your compilation configuration (see "Export" and "Import" buttons at the bottom of "Project options" dialog).  This way you can switch from one to other more easily than modifying the options "by hand".

Anyway, I recommend you to have both OS installed.  Most Linux distributions needs way less disk space than WIndows (i.e. Xubuntu needs 6GiB for system), and they live with Windows without problems. You'll need to change the configuration of the boot menu to set Windows as default, but it's a minor issue.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #5 on: January 07, 2016, 05:53:05 pm »
I never did cross-compiling, but if I remember correctly, you can have two different Lazarus installed, one to compile Windows and the other to compile Linux.
Err...what's that for? One Lazarus to target as many targets as you can is possible (well, technical limitations apply, don't hope to cross to osx from any other os for now).

DelphiLazus

  • New Member
  • *
  • Posts: 34
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #6 on: January 07, 2016, 11:27:07 pm »
I never did cross-compiling, but if I remember correctly, you can have two different Lazarus installed, one to compile Windows and the other to compile Linux.

Also, you can save your compilation configuration (see "Export" and "Import" buttons at the bottom of "Project options" dialog).  This way you can switch from one to other more easily than modifying the options "by hand".

Anyway, I recommend you to have both OS installed.  Most Linux distributions needs way less disk space than WIndows (i.e. Xubuntu needs 6GiB for system), and they live with Windows without problems. You'll need to change the configuration of the boot menu to set Windows as default, but it's a minor issue.
Thank you for responding to my call, dear colleague!
So you suggest that Lazarus has installed on each operating system and from each SO compile and build the same project.

I never did cross-compiling, but if I remember correctly, you can have two different Lazarus installed, one to compile Windows and the other to compile Linux.
Err...what's that for? One Lazarus to target as many targets as you can is possible (well, technical limitations apply, don't hope to cross to osx from any other os for now).
That was my understanding, at least theoretically possible from a single OS can build applications for different OS.
But to me it is not clear just that. In the video that I put in my first post cross compiling steps to be explained from Windows to Linux.
My big concern is how to do this yourself but for 2 OS: Windows and Linux. Because just in the project options in SO target (-T) only allows me to select one.

Do I have if or change these settings, either by hand or by importing configuration as suggested Ñuño whenever I need to compile and build for each OS?

Best Regards,

Cyrax

  • Hero Member
  • *****
  • Posts: 836
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #7 on: January 07, 2016, 11:40:50 pm »
If your hardware allows it, you can run Linux in virtualization software like VirtualBox under Windows and vice versa.

DelphiLazus

  • New Member
  • *
  • Posts: 34
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #8 on: January 08, 2016, 12:15:34 am »
If your hardware allows it, you can run Linux in virtualization software like VirtualBox under Windows and vice versa.
I have a very good machine so I virtualize is not an impediment.
Moreover, I intend to do for my system and then test to make sure it works.

But if you're like leledumbo he says, if you can build from one OS to various OS then why do double duty? My question is precisely this: How do I configure multiple OS Tarjet if only lets me choose one?

Best Regards,
PS: Sorry my poor English.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #9 on: January 08, 2016, 12:05:18 pm »
I never did cross-compiling, but if I remember correctly, you can have two different Lazarus installed, one to compile Windows and the other to compile Linux.
Err...what's that for? One Lazarus to target as many targets as you can is possible (well, technical limitations apply, don't hope to cross to osx from any other os for now).
That's what I said, didn't I?  :-\
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

DelphiLazus

  • New Member
  • *
  • Posts: 34
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #10 on: January 08, 2016, 08:33:12 pm »
I understood that what you propose is to have as many installations of Lazarus as many SO needed.
While I understand the words of leledumbo to pointing I do not need to reach that but from a single installation on any OS is possible to compile and build software for any OS.

Best Regards,
PS: Sorry for my poor English.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #11 on: January 11, 2016, 07:45:14 pm »
Well, yes, you can have one compiler only. But IIRC the one included in the binaries compiles for one target only (at least, the one I have in my Xubuntu can compile for Linux x86_64 only, as "-iTO -iSP" options says). You should build the "full" compiler, or a compiler that is able to compile the requested targets, from sources (it isn't too hard). Also, you'll need different RTL/FCL/LCL compiled for each target.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

DelphiLazus

  • New Member
  • *
  • Posts: 34
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #12 on: January 12, 2016, 01:05:10 am »
Well, yes, you can have one compiler only. But IIRC the one included in the binaries compiles for one target only (at least, the one I have in my Xubuntu can compile for Linux x86_64 only, as "-iTO -iSP" options says). You should build the "full" compiler, or a compiler that is able to compile the requested targets, from sources (it isn't too hard). Also, you'll need different RTL/FCL/LCL compiled for each target.
Now if I feel lost. Every time I understand less!
How is this "full"? You left me thinking about something. I use CodeTyphon, and it comes with a tool called Cross toolchain, and apparently this should generate the toolchain for each OS tarjet and already this could compile my projects. As I understand, CT and generates default me 16 toolschains, including those needed for Linux. Although disabled Cross toolchain Engine.
I can not find any documentation to clarify this to me.

Regards,

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9900
  • Debugger - SynEdit - and more
    • wiki
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #13 on: January 12, 2016, 01:40:00 am »
At current (don't know if project groups will change that), selecting "run" or "compile" will compile only for the one currently selected target.

But if you create a buildmode for each target, you get a nice dropdown, next to the run button in the main IDE bar. So you can change buildmode (and therefore target) really easy.

You can even set the destination for the exe (output file name) to be on a shared folder of your virtual machine for the different target.

Only the debugger will not follow automatic, as it has global settings.

A patch to change that would be welcome. global setting should be kept. But the patch could add additional settings that can override them to the project.

DelphiLazus

  • New Member
  • *
  • Posts: 34
Re: Configure Debugger and project for cross-compilation: Windows AND Linux.
« Reply #14 on: January 12, 2016, 01:26:18 pm »
At current (don't know if project groups will change that), selecting "run" or "compile" will compile only for the one currently selected target.

But if you create a buildmode for each target, you get a nice dropdown, next to the run button in the main IDE bar. So you can change buildmode (and therefore target) really easy.

You can even set the destination for the exe (output file name) to be on a shared folder of your virtual machine for the different target.

Only the debugger will not follow automatic, as it has global settings.

A patch to change that would be welcome. global setting should be kept. But the patch could add additional settings that can override them to the project.
Thanks Martin_fr, I'll read and investigate Build Modes.
I will need time and arm myself with patience to study and implement all about cross-compiling.
It will probably take me back here for further doubt.

Best Regards,
PS: Sorry my poor English

 

TinyPortal © 2005-2018