Recent

Author Topic: Manual Lazarus build  (Read 3337 times)

TRon

  • Hero Member
  • *****
  • Posts: 3791
Manual Lazarus build
« on: August 19, 2024, 06:24:24 am »
I am attempting to build Lazarus (3.4) from scratch by source on and for windows 64-bit but no matter what I do I seem to run from issue to issue.

Is it even (officially) supported to build Lazarus on window 64-bit using the makefile ?

I am not interested in alternative methods of the build.
« Last Edit: August 19, 2024, 06:45:23 am by TRon »
I do not have to remember anything anymore thanks to total-recall.

Thaddy

  • Hero Member
  • *****
  • Posts: 16390
  • Censorship about opinions does not belong here.
Re: Manual Lazarus build
« Reply #1 on: August 19, 2024, 06:39:19 am »
To build Lazarus, use the LazBuild utility.
See https://wiki.freepascal.org/lazbuild
Essential build options are -B -r --build-ide
You probably need to set a couple of more options
Essentally fpcmake builds all dependencies first before it builds the ide itself.
(If you log the build order, you can use that order later to build lazarus through its make files manually if you feel like doing so )
« Last Edit: August 19, 2024, 06:52:24 am by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

TRon

  • Hero Member
  • *****
  • Posts: 3791
Re: Manual Lazarus build
« Reply #2 on: August 19, 2024, 06:46:51 am »
Hi Thaddy,
You are correct in that my question was imprecise.

I have slightly adjusted my initial question so that it becomes clear that I am building Lazarus from scratch.
I do not have to remember anything anymore thanks to total-recall.

paweld

  • Hero Member
  • *****
  • Posts: 1278
Re: Manual Lazarus build
« Reply #3 on: August 19, 2024, 06:50:58 am »
Code: Bash  [Select][+][-]
  1. @echo off
  2. set _LAZDIR=C:\lazarus
  3. set _PATH=%PATH%
  4. set PATH=%_LAZDIR%\fpc\3.2.3\bin\x86_64-win64;%PATH%
  5. echo -= Rebuild Lazarus =-
  6. cd %_LAZDIR%
  7. make -s clean
  8. make -s bigide
  9. set PATH=%_PATH%
Best regards / Pozdrawiam
paweld

Thaddy

  • Hero Member
  • *****
  • Posts: 16390
  • Censorship about opinions does not belong here.
Re: Manual Lazarus build
« Reply #4 on: August 19, 2024, 06:55:41 am »
That works too, but I seem to remember that fpcmake is the recommend way.
I used to use a similar batchfile like yours.
There is nothing wrong with being blunt. At a minimum it is also honest.

TRon

  • Hero Member
  • *****
  • Posts: 3791
Re: Manual Lazarus build
« Reply #5 on: August 19, 2024, 07:05:05 am »
Ok, for good measures  :)

It is the Lazarus makefile that I wish to address and not use other methods to build Lazarus. Especially the make install part seems to go haywire, lack creating directories, try to install mac related ppu's that don't exist etc. etc.

Either there is a makefile that works or there isn't and the latter seems to be the case for me. In fairness win64 is a bit of an odd target so it might be there are some (known) issues. e..g cross-building work as intended but again does not have my interest.
I do not have to remember anything anymore thanks to total-recall.

paweld

  • Hero Member
  • *****
  • Posts: 1278
Re: Manual Lazarus build
« Reply #6 on: August 19, 2024, 07:06:44 am »
@Thaddy: I personally prefer Menu Tools > Build Lazarus with profile: clean and build all (if I already have a compiled Lazarus) :-)
Best regards / Pozdrawiam
paweld

dbannon

  • Hero Member
  • *****
  • Posts: 3194
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Manual Lazarus build
« Reply #7 on: August 19, 2024, 10:27:11 am »
I build Lazarus from source using "make bigide" , I think its currently on 3.2 so have not tried 3.4 (I'd need to reboot to see).

Just a case of making make, a working compiler (fpc322 is all I use) and the source.  If I get some time, I will update to 3.4 to see how I go.

In the mean time, just what sort of 'issues' bite you ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Bart

  • Hero Member
  • *****
  • Posts: 5497
    • Bart en Mariska's Webstek
Re: Manual Lazarus build
« Reply #8 on: August 19, 2024, 12:20:13 pm »
I build Lazarus from scracth from time to time (Lazarus trunk) on Windows.
Just a simple make clean bigide just works out of the box.
You only need fpc in the %path%  (and make sure that the make that is distributed with fpc is used, otherwise havoc will occur).

Bart

Thaddy

  • Hero Member
  • *****
  • Posts: 16390
  • Censorship about opinions does not belong here.
Re: Manual Lazarus build
« Reply #9 on: August 19, 2024, 01:32:40 pm »
(and make sure that the make that is distributed with fpc is used, otherwise havoc will occur).
Meaning that if you have a Delphi installed (any) the make.exe of Delphi is in the path and often takes precedence.
Use a fully qualified path to the GNU version of make that comes with FreePascal.
The two make executable are not compatible.
Otherwise, indeed, havoc may occur... :D

Many people on Windows have both Delphi and Lazarus installed. In my case multiple versions of both.
Just make sure fpc's make has the fully qualified path. That is the easy way out.
« Last Edit: August 19, 2024, 01:36:20 pm by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11991
  • FPC developer.
Re: Manual Lazarus build
« Reply #10 on: August 19, 2024, 04:31:03 pm »
Ok, for good measures  :)

It is the Lazarus makefile that I wish to address and not use other methods to build Lazarus. Especially the make install part seems to go haywire, lack creating directories, try to install mac related ppu's that don't exist etc. etc.

I don't know if Lazarus makefiles have a sane install command, I never used it. As Lazarus requires source for rebuild-with-new-components that is not really logical
 

Thaddy

  • Hero Member
  • *****
  • Posts: 16390
  • Censorship about opinions does not belong here.
Re: Manual Lazarus build
« Reply #11 on: August 19, 2024, 09:01:36 pm »
try to install mac related ppu's that don't exist etc. etc.
For good measure, you don't install ppu's, you build them from source. In any of the give build examples.
There are no ppu's in the source distribution. What you refer to are probably build dependencies that need to be compiled first.
There are at least three different and correct answers given. The easiest is simply to switch to the root directory where the Lazarus sourcecode resides and type make clean all bigide. You do not always want bigide, but just all would do.
Note that you will be missing some packages, then, that need to be installed by hand on demand.
« Last Edit: August 19, 2024, 09:04:57 pm by Thaddy »
There is nothing wrong with being blunt. At a minimum it is also honest.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8111
Re: Manual Lazarus build
« Reply #12 on: August 19, 2024, 09:25:47 pm »
I shouldn't be here, since I'm not a Windows user. However there was various discussion a few months ago which appeared to lead to the conclusions:

* Be very careful about precisely which utilities are being used (OP: you might have problems with MS vs GNU, I sympathise since I've crossed swords with Marco about Sun vs GNU in the past).

* Use make bigide etc. (as suggested by Thaddy) to get a baseline IDE running.

* Set up various extra packages etc. and then use lazbuild.

My experience is that particularly if you are trying to keep multiple variants of the IDE (e.g. for GTK and Qt) in step then you can't rely on rebuilding from inside the IDE.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

dbannon

  • Hero Member
  • *****
  • Posts: 3194
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Manual Lazarus build
« Reply #13 on: August 20, 2024, 07:31:06 am »
Like Mark, I am out of my home space.

Lazarus 3.4 built easily on Windows 11 with just "make bigide" and existing FPC 322 install. And works fine. A pretty clean Windows, no Delphi nor anything much else installed.

But later on Ron, you mention "install", I would never install Lazarus. It destroys the major advantages of installing from source. Even I can make a Windows shortcut (see, I know all the terms and everything!) that will start it for me where it is, in its source directory.  And that is my approach on Windows, Linux, MacOS and Unixes.

Now, that said, it built cleanly and runs fine. But why does it take Windows some 13 minutes to unzip a lazarus zipball and on the same hardware, Linux can do it in about 5 seconds ?  I know Windows file systems struggle with lots of files but there must be more than that going on ! A factor of 100 ??  Everything else seem as expected, its slower but not by a huge margin.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 3791
Re: Manual Lazarus build
« Reply #14 on: August 20, 2024, 09:04:08 am »
Thank you all for the feedback. Really appreciated.

Just Like MarkMLI, I am not a Windows user (anymore and for a long time) so I approached this from a Linux point of view.

So, let's start from the beginning  :)

I am on pure Windows so no cygwin, msys, wsl or whatever.

I obtained the gnu tools for windows 64-bit and build and installed the FPC compiler (that went smooth).

Just like on Linux I use a prefab script to launch the compiler. I do this to stop FPC from loading any default config and instead force my own and setup custom environment variables to allow for on the fly switching between compiler versions.

Then I started building Lazarus.

First hurdle is that for some obscure reason the .exe file extension is forced by the makefile. Perhaps something to be expected for a platform that heavily relies on that extension (no it actually isn't, that is why the mime types exist) but it is annoying as hell. So, I had to waste quite some time to work around that issue.

During the IDE build some minor issues popped up, mainly to my own stupidity/setup and I worked around those.

To make sure I got my head screwed on right I did display the make help to make sure what I can and can't use and for sure the make install option is advertised (though it does also tell at the bottom that you /can/ use install for which we can assume it is not required but also not forbidden or unsupported).

The help also tells about changing the install_prefix option to install to another location (and no it does not because the makefile does something completely different than advertised and forces the C:\Lazarus directory upon us. That said, that particular option can be overridden). The makefile lacks creating any of these directories though (and thus fails) :shrugs:

But the real fun starts when using make install and/or make zipinstall, starting with copying the macos app package (or whatever it stands for) but it wasn't build to begin with. At least on Linux that stuff gets build.

So, the makefile bails out on us again.

So, in an attempt to bring marcov up to par: no Lazarus makefiles do not have a sane install command but it could have just like the Linux version does (which has the same requirements).

After more than 10 years of windows absence the only thing I wanted to verify is if there was some progress on that matter but unfortunately it seems that there was some kind of freeze.

So, please don't try to beat around the bush with a copy over the compiled directory, use fpcup or, whatever because I already knew that before I started and it is besides the point (and actually you can't if you want to create a proper installation).

Now, I personally do not mind if something isn't supported but can we please stop advertising that it is ?

2 cents
I do not have to remember anything anymore thanks to total-recall.

 

TinyPortal © 2005-2018