Recent

Author Topic: How to Build Laz IDE from GitLab Repo (Not Using fpcupdeluxe, DEBs, or tar.gz)?  (Read 628 times)

Aruna

  • Hero Member
  • *****
  • Posts: 597
Hi all,

I'm interested in building the Lazarus IDE completely from source by cloning the official GitLab repository. I’m aware there are several other ways to install Lazarus:

    via .deb packages,
    downloading .zip or .tar.gz archives,
    or using fpcupdeluxe.

However, I specifically want to clone the GitLab source repositories for both Free Pascal (FPC) and Lazarus, and build everything manually from scratch — partly to better understand the internals and possibly contribute in the future.

Has anyone here done this recently? If so:

    What are the necessary steps involved?
    Any important prerequisites or potential gotchas to be aware of?
    Is it better to start by building FPC first, then Lazarus? (Since Lazarus depends on FPC?)
    Are there official build scripts or is it recommended to use make clean all?

Any guidance or links to up-to-date build instructions would be much appreciated. Thanks!

Best regards,
Aruna

MarkMLl

  • Hero Member
  • *****
  • Posts: 8330
Don't know whether you can see this, or if association with IRC has rotted your bits.

Looking at a system I set up a few weeks ago, I can see these two stages of package installation to allow me to build FPC and Lazarus in situ:

Code: [Select]
1.3 -> 1.4, 2024/10/23 17:38:02
autoconf
automake
bison
build-essential
flex
gdb
gdbserver
libgpm-dev
libncurses5-dev
libncursesw5-dev
libpq-dev
libssl-dev
libtool
libusb-dev
subversion

1.4 -> 1.5, 2024/10/23 17:42:03
libasound2-dev
libcap-dev
libffi-dev
libglib2.0-dev
libgtk2.0-dev
libhidapi-dev
libi2c-dev
libicu-dev
libjpeg-dev
libqt5pas-dev
pkg-config
spi-tools

The important manual ones are curses and GPM for FPC, with libpq-dev, libssl-dev, libusb-dev being needed plus of course libgtk2.0-dev for Lazarus. In fact of those latter you really only /need/ libgtk2.0-dev, but having the others sets up some important symlinks.

You can do a basic build by putting the Lazarus IDE etc. sources in a directory under your full control, then applying  make all  . Once you are certain that works, do something like

Code: Text  [Select][+][-]
  1. $ make clean distclean bigide
  2.  

However I urge you to start off with the stable version, not trunk which is WIP.

One general issue there is that it won't build IDE-extension packages: in order to get those you have to either rebuild from the IDE itself, or use lazbuild which is a bit arcane. See thread at https://forum.lazarus.freepascal.org/index.php/topic,67244.msg517062.html#msg517062 plus the cited links.

HTH

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

paweld

  • Hero Member
  • *****
  • Posts: 1325
Best regards / Pozdrawiam
paweld

Aruna

  • Hero Member
  • *****
  • Posts: 597
Don't know whether you can see this, or if association with IRC has rotted your bits.
I can see it loud and clear, no comment on the latter second part. We do live in a free world, and everyone’s entitled to make their own choices... within the boundaries of sanity, of course. That said, I must admit I’m slightly miffed, sir. I believe I’ve sent you several PMs, and—radio silence. Not even a “seen.” What gives? I thought we were friends. Anyways fpc compiled+linked and built fine. Lazarus on the other hand when I ran make all choked on me with this which I am yet trying to understand. "You' may see what I may have missed.   

So this is what I did so far:
- cloned fpc repo
- cloned lazarus repo
- cd into fpc sources and ran make all (This went well)
-cd back into lazarus and ran make all and below you see what is giving me serious headaches.

Code: Text  [Select][+][-]
  1. aruna@debian:~/keelazide/lazarus$ make all
  2. make -C packager/registration
  3. make[1]: Entering directory '/home/aruna/keelazide/lazarus/packager/registration'
  4. /usr/bin/rm -f ../units/x86_64-linux/fcllaz.ppu
  5. /usr/bin/ppcx64 -MObjFPC -Scghi -O1 -g -gl -l -vewnhibq -Fu. -Fu/usr/local/lib/fpc/3.2.2/units/x86_64-linux/rtl -FE. -FU../units/x86_64-linux -Cg -Fl/usr/lib/gcc/x86_64-linux-gnu/10 -dx86_64 fcllaz.pas
  6. Hint: (11030) Start of reading config file /etc/fpc.cfg
  7. Hint: (11031) End of reading config file /etc/fpc.cfg
  8. Free Pascal Compiler version 3.2.2 [2021/07/09] for x86_64
  9. Copyright (c) 1993-2021 by Florian Klaempfl and others
  10. (1002) Target OS: Linux for x86-64
  11. (3104) Compiling fcllaz.pas
  12. (10001) PPU Loading /usr/lib/fpc/3.2.2/units/x86_64-linux/fcl-db/db.ppu
  13. (10011) PPU Source: db.pas not available
  14. (10011) PPU Source: dataset.inc not available
  15. (10011) PPU Source: fields.inc not available
  16. (10011) PPU Source: datasource.inc not available
  17. (10011) PPU Source: database.inc not available
  18. (10011) PPU Source: dsparams.inc not available
  19. (10028) Recompiling DB, checksum changed for /usr/local/lib/fpc/3.2.2/units/x86_64-linux/rtl/classes.ppu
  20. /home/aruna/keelazide/lazarus/packager/registration/fcllaz.pas(11,3) Fatal: (10022) Can't find unit DB used by fcllaz
  21. Fatal: (1018) Compilation aborted
  22. make[1]: *** [Makefile:3471: fcllaz.ppu] Error 1
  23. make[1]: Leaving directory '/home/aruna/keelazide/lazarus/packager/registration'
  24. make: *** [Makefile:3112: registration] Error 2
  25. aruna@debian:~/keelazide/lazarus$
  26.  
Just to be difficult since you concurred my bits have rotted due to association with IRC that sadly is not possible since HIV tried and failed miserably, so HA!


MarkMLl

  • Hero Member
  • *****
  • Posts: 8330
That said, I must admit I’m slightly miffed, sir. I believe I’ve sent you several PMs, and—radio silence. Not even a “seen.” What gives? I thought we were friends.

Last I heard was your

Quote
Not much to report back other than Joanna saying you should come to talk to her about that last question in the forum on IRC :)

I have said, repeatedly, that I am not getting involved with IRC, and if Joanna thinks that by pretending she can't see me on the open forum that I'll start using it she's got another thought coming.

Quote
Anyways fpc compiled+linked and built fine. Lazarus on the other hand when I ran make all choked on me with this which I am yet trying to understand. "You' may see what I may have missed.   

Did you install the compiler plus RTL etc. after you'd built it? Did you check that it was not the one being used? Did you check it could recompile itself? It looks as though you're still using one that was built in 2021, and I'd suspect that the FCL isn't installed properly.

What version of Lazarus are you building? Are you sure?

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

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10914
  • Debugger - SynEdit - and more
    • wiki
I was about to ask: OS? But your follow up shows Linux.

Then the next question is, do you plan to have more than one FPC?
And that includes: Do you already have an FPC installation via any installer?

1) If you have an installed fpc, you likely have /etc/fpc.cfg or at least an fpc.cfg in your home folder.
And if you have that, your new fpc is gonna see this, and is going to do things you don't want it to do...

Also, if there is more than one fpc, then you don't want them in the %PATH%. If you have you can very quickly get screw ups. Especially since fpc needs to call ppc...

If you only have one, its easy (well except for the starting compiler that you need for the build).
If you have (or may in future have) more than one, then you need to be careful.

You can run the make install with an INSTALL_PREFIX. And do the install outside of %PATH%.
And there is a place somewhere in that install where you can create your fpc.cfg so that it will be found by that one fpc only (and not by any other that is in any other path).
You can always use "fpc -va someprog.pas" and scan the output for all locations that it seeks for the fpc.cfg.

I use something like....
- Not sure if you need to modify the PATH var. If you don't you may have to specify some other stuff....
- for me I temporarily point it to another existing install
- I had to edit the below, as my script has plenty of shell vars / hope I made no mistakes...
- not sure why I have 2 fpc.cfg created / one must be wrong /unused
- not sure if the ln is needed. If you always call ppx64 directly then not. Otherwise check first if your fpc finds the correct ppcx64 (finds it at all, assuming no other is in path)

Code: Text  [Select][+][-]
  1. FPC=/home/m/somewhere/ppcx64 export FPC
  2. PATH=/home/m/fpc/install/3.2.2:$PATH ; export PATH
  3.  
  4. cd /home/m/fpc/git
  5. make clean
  6. make all  OPT=" -O4 "  
  7. make install INSTALL_PREFIX=/home/m/fpc/install/3.3.1
  8. mkdir -p /home/m/fpc/install/3.3.1/lib/fpc/etc
  9. mkdir -p /home/m/fpc/install/3.3.1/etc
  10.  
  11. cd /home/m/fpc/install/3.3.1
  12. ./bin/fpcmkcfg -d basepath=/home/m/fpc/install/3.3.1/lib/fpc/3.3.1 > lib/fpc/etc/fpc.cfg
  13. ./bin/fpcmkcfg -d basepath=/home/m/fpc/install/3.3.1/lib/fpc/3.3.1 > etc/fpc.cfg
  14.  
  15. # ln -s /home/m/fpc/install/3.3.1/lib/fpc/3.3.1/ppcx64  /home/m/fpc/install/3.3.1/bin/ppcx64
  16.  


----------------------
Lazarus is easy to have many versions. Search the wiki for multiple lazarus. It should tell you how to create a lazarus.cfg file pointing to a separate pcp. (primary config path).

Aruna

  • Hero Member
  • *****
  • Posts: 597
<snip..>
Last I heard was your
Quote
Not much to report back other than Joanna saying you should come to talk to her about that last question in the forum on IRC :)
I have said, repeatedly, that I am not getting involved with IRC, and if Joanna thinks that by pretending she can't see me on the open forum that I'll start using it she's got another thought coming.
Ah, I figured that was the reason you went quiet. I was just the messenger, trying to connect the two of you. By the way, Joanna does ask about you from time to time. :)

Did you install the compiler plus RTL etc. after you'd built it? Did you check that it was not the one being used? Did you check it could recompile itself? It looks as though you're still using one that was built in 2021, and I'd suspect that the FCL isn't installed properly.

What version of Lazarus are you building? Are you sure?
Mark, I have multiple versions of Lazarus here and I switch between them now and again. I have no clue why it is so darn difficult to clone a GitLab repo and then get the source to work. It should not be this hard. Anyway good to be back in touch even if I get fried for mentioning Joanna.

Listen about IRC, this is what "i" have observed and learned. Right now we have about 64 people in the channel it varies between a low of 58 to a high of 67 so far.  Most people in the #pascal channel never talk, really I mean never. Others 'if' you ask a question that is within *their* expertise they do offer guidance and solutions. There are a lot of seasoned veterans in there so I have learned a bit about many things assembler included. Imagine that in a Pascal channel eh? So when the lady asks me again about you what do I tell her ? I promise I won’t bring up IRC again I would just like to see two highly knowledgable people co-exist peacefully in the forum and elsewhere. Btw, HR just informed me my last day of work will be this March 31st as my contract ends then and they have not been able to secure funding to keep us all. So come April I will be jobless again :)

Aruna

  • Hero Member
  • *****
  • Posts: 597
I was about to ask: OS? But your follow up shows Linux.
Hello Martin_fr yes I use Linux Debian :)

Then the next question is, do you plan to have more than one FPC?
And that includes: Do you already have an FPC installation via any installer?
Yes to both questions. Over time I have done some weird and wonderful things (unintentionally most times)

1) If you have an installed fpc, you likely have /etc/fpc.cfg or at least an fpc.cfg in your home folder.
And if you have that, your new fpc is gonna see this, and is going to do things you don't want it to do...
Ah, that makes a lot of sense so that is probably what is happening?

Also, if there is more than one fpc, then you don't want them in the %PATH%. If you have you can very quickly get screw ups. Especially since fpc needs to call ppc...
<snip..>
Lazarus is easy to have many versions. Search the wiki for multiple lazarus. It should tell you how to create a lazarus.cfg file pointing to a separate pcp. (primary config path).
Thank you once again for taking the time to do this and I will go through this slowly and start to hopefully fix things.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8330
Mark, I have multiple versions of Lazarus here and I switch between them now and again. I have no clue why it is so darn difficult to clone a GitLab repo and then get the source to work. It should not be this hard.

As do I: everything from 0.9 to 2.2 (I've had no need to investigate newer versions) with "best match" FPC. But I've worked from numbered releases, I don't like git and am not going to attempt to offer suggestions (other than that you look for specific tagged releases). Having said which, I've got enormous respect for fpcupdeluxe, which has worked very well when I was looking at the Pico etc.

Quote
Listen about IRC, this is what "i" have observed and learned.

Get this into your head: I have absolutely no intention of touching IRC. I've been using threaded discussion systems since the mid 1980s (Multics Forums etc.) and have no intention whatsoever of regressing to something that mixes things up together. And that is final.

And tell your giddy female friend that she does nothing but make a fool of herself by pretending that she can't see stuff I post here, since it all comes from a central server and if she can see one contributor then she can see all of them (except the ones she's blacklisted).

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

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10914
  • Debugger - SynEdit - and more
    • wiki
I have (on Windows and Linux) many different versions of Fpc and Lazarus. Build directly from git.

For FPC see my prior notes. You need at least a start compiler: ppcx... for your architecture.  And it must be of the correct version (always ONE release before what you want to build)
- to build 3.2.3 or 3.3.1 you need to start with version 3.2.2
- to build 3.2.2 you need to start with 3.2.0

FPC afaik needs to be "make installed" but with INSTALL_PREFIX

Troubleshoot with
fpc -va test.pas
or
ppcx... -va test.pas

To find any access to wrong config, or wrong folders of other installations....





Lazarus should build with just something like
make bigide FPC=

I usually update regularly, which means I can build from within my existing lazarus.

Lazarus should then be started with the correct --pcp= (see lazarus.cfg remark earlier). Otherwise they mixup config (you can mix config, but really why would you?)

Lazarus does not need a "make install". You can run from within the git folder.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12110
  • FPC developer.
What Martin says can also be seen in your output:


0001) PPU Loading /usr/lib/fpc/3.2.2/units/x86_64-linux/fcl-db/db.ppu
(10011) PPU Source: db.pas not available
(10011) PPU Source: dataset.inc not available
(10011) PPU Source: fields.inc not available
(10011) PPU Source: datasource.inc not available
(10011) PPU Source: database.inc not available
(10011) PPU Source: dsparams.inc not available
(10028) Recompiling DB, checksum changed for /usr/local/lib/fpc/3.2.2/units/x86_64-linux/rtl/classes.ppu

Note the difference betwen both bold statements.

I also recommend trying to read the buildfaq (linked on the documentation page of FPC) at least once in its entirety for some background info

 

TinyPortal © 2005-2018