Recent

Author Topic: Portable verion of FPC and Lazarus  (Read 2550 times)

backprop

  • Sr. Member
  • ****
  • Posts: 257
Re: Portable verion of FPC and Lazarus
« Reply #30 on: June 07, 2026, 04:27:15 pm »
Code: [Select]
[0.000] Configfile search: /home/s/.fpc.cfg
[0.000] Configfile search: /tmp/FPC_LAZ/fpc-main/etc/fpc.cfg
[0.000] Configfile search: /etc/fpc.cfg
[0.000] Reading options from file /etc/fpc.cfg
[0.000] Hint: Start of reading config file /etc/fpc.cfg

That is probably part of the problem, as I do not see how to prevent it to search config file on pultiple praces. It is on all these places, but this custom one is here: /tmp/FPC_LAZ/fpc-main/etc/fpc.cfg

Test source:

Code: Pascal  [Select][+][-]
  1. program FPCVersion_Test;
  2. {$MACRO ON}
  3. begin
  4.   writeln(FPC_FULLVERSION);
  5. end.
  6.  
« Last Edit: June 08, 2026, 09:51:14 pm by backprop »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12955
  • FPC developer.
Re: Portable verion of FPC and Lazarus
« Reply #31 on: June 07, 2026, 04:43:58 pm »
Well, IDE simply refuse to accept  /tmp/FPC_LAZ/fpc-main/compiler/ppcx64 even the rest is accepted.


In more server oriented distributions /tmp might not have execute permissions

backprop

  • Sr. Member
  • ****
  • Posts: 257
Re: Portable verion of FPC and Lazarus
« Reply #32 on: June 07, 2026, 04:49:37 pm »
In more server oriented distributions /tmp might not have execute permissions

It is default RAM disk and have all permissions.  There is now 2GB of files with FPC and Lazarus compiled files...

Well, unless someone try these steps, I see no solution. Although I may try to create and mount another virtual drive.

Point is that new lazarus here works fine, even can rebuild, install components etc here. Except it can't use new FPC.
« Last Edit: June 07, 2026, 05:20:44 pm by backprop »

Thausand

  • Hero Member
  • *****
  • Posts: 560
Re: Portable verion of FPC and Lazarus
« Reply #33 on: June 07, 2026, 04:56:15 pm »
You make confuse write  :D You want use or not want use SSD ?
...
May be I not have understand correct what is mean messy...
...

If you do not understand, then stop replying, simple as that. I was perfectly clear what I refer to and from whom I expect clarification. And didn't I wrote that I do not want messy Ai replies? This is exactly what is happening here!
Thank you for close topic because not want listen what is work.

I not use clanker for give answer *ever*.  If you not have know how is work standalone fpc/lazarus and I know then why is make false accuse ?

Well, unless someone try these steps, I see no solution.
Then have look how is work fpcup what is do same what you do or have read command line options how is work for force configuration.
A docile goblin always follow HERMES.md

backprop

  • Sr. Member
  • ****
  • Posts: 257
Re: Portable verion of FPC and Lazarus
« Reply #34 on: June 07, 2026, 05:15:35 pm »
Thausand, do not make a noise, I have not asked you anything and definitely I have no time to waste and try endless solutions. It is as talking to hallucinating AI...

You make confuse write  :D You want use or not want use SSD ?
...
May be I not have understand correct what is mean messy...
...

If you do not understand, then stop replying, simple as that. I was perfectly clear what I refer to and from whom I expect clarification. And didn't I wrote that I do not want messy Ai replies? This is exactly what is happening here!
Thank you for close topic because not want listen what is work.

I not use clanker for give answer *ever*.  If you not have know how is work standalone fpc/lazarus and I know then why is make false accuse ?

Well, unless someone try these steps, I see no solution.
Then have look how is work fpcup what is do same what you do or have read command line options how is work for force configuration.
« Last Edit: June 07, 2026, 05:17:35 pm by backprop »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12560
  • Debugger - SynEdit - and more
    • wiki
Re: Portable verion of FPC and Lazarus
« Reply #35 on: June 07, 2026, 05:18:32 pm »
Code: [Select]
[0.000] Configfile search: /home/s/.fpc.cfg
[0.000] Configfile search: /tmp/FPC_LAZ/fpc-main/etc/fpc.cfg
[0.000] Configfile search: /etc/fpc.cfg
[0.000] Reading options from file /etc/fpc.cfg
[0.000] Hint: Start of reading config file /etc/fpc.cfg

That is probably part of the problem, as I do not see how to prevent it to search config file on pultiple praces. It is on all these places, but this custom one is here: /tmp/FPC_LAZ/fpc-main/etc/fpc.cfg

Well, it picking up /etc/fpc.cfg is not what you want.

Good question why it isn't picking the one in tmp up... Assuming read/write perm are given?
(You still have an issue if that runs on a box that has a config in /home/*/.fpc.cfg => for that the file could also be given via command line / fpcupdeluxe does that with a wrapper script, and the IDE gets the script as compiler exe)


I have a similar setup on some of my boxes, where the conf is in ../etc/fpc.cfg relative to the compiler.
Though not in temp / I actually have the ppcx in a diff folder. I don't recall why. I ended up with that after trial and error many many years ago...

I have (in the folder "/home/me/fpc/rel_3.2.2/64/def")
  def/bin/fpc
  def/bin/ppcx64 -> /home/me/fpc/rel_3.2.2/64/def/lib/fpc/3.2.2/ppcx64
  def/etc/fpc.cfg

(2nd is a symlink, but no idea why, or if actually required)


I also don't know if the directories in the fpc.cfg can be relative, or must be absolute....

backprop

  • Sr. Member
  • ****
  • Posts: 257
Re: Portable verion of FPC and Lazarus
« Reply #36 on: June 07, 2026, 05:37:40 pm »
I have planned to remove all FPC/Lazarus installations from .deb, that will also remove unwanted numerous of cfg files. There is also fpcmkcfg thus if that also fail, then it is definitely waste of time. If FPC decide by it's own what config file to use, then it is fairly a shame to whoever make it to work as this...

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12560
  • Debugger - SynEdit - and more
    • wiki
Re: Portable verion of FPC and Lazarus
« Reply #37 on: June 07, 2026, 05:55:59 pm »
As I said, fpcupdeluxe may be able to provide answers. Ask there.

It dose a script that calls

Code: Bash  [Select][+][-]
  1. #!/bin/sh
  2. fpc XXX_arg_for_set_config  @_

That script then is used as compiler.

that would mean you can do anything you need in that script. (though nothing to slow, as it is called for every fpc invocation)




IF it is just for your own use => i.e. not "portable" but a "custom install in a custom folder" and that folder stays fix, and you can ensure no conf in /home => then the ../etc location should work.

I definitely have that working on all my VM. Each of my VM has 3.2.2, 3.2.3 and 3.3.1 in different builds (opt/dbg). Of course, all my VM do not have a global config file at all. (all I need to start them is one ppcx compiler)
« Last Edit: June 07, 2026, 05:59:52 pm by Martin_fr »

backprop

  • Sr. Member
  • ****
  • Posts: 257
Re: Portable verion of FPC and Lazarus
« Reply #38 on: June 07, 2026, 06:07:53 pm »
Martin, I really have no time nor wish to  try or ask anywhere, but here. I simply need solution which works. I have listed FPC arguments and noticed that @<x>, but that is related to additional config option and not well explained, it is not clear what it does. Rigid path to it is all necessary in this case, overriding any "self guidance logic". Lazarus have pcp for command line, but that seems is overriden in GUI...

Probably is the best to use fpc/<version>... etc stile anyway, as overriding with exact paths seem to make sometimes  problems too... And generic fpc filename is used as compiler... All in all, not a clear way how to simply set things as they where needed.
« Last Edit: June 08, 2026, 06:14:33 am by backprop »

backprop

  • Sr. Member
  • ****
  • Posts: 257
Re: Portable verion of FPC and Lazarus
« Reply #39 on: June 07, 2026, 08:11:32 pm »
IF it is just for your own use => i.e. not "portable" but a "custom install in a custom folder" and that folder stays fix, and you can ensure no conf in /home => then the ../etc location should work.

I definitely have that working on all my VM. Each of my VM has 3.2.2, 3.2.3 and 3.3.1 in different builds (opt/dbg). Of course, all my VM do not have a global config file at all. (all I need to start them is one ppcx compiler)

As I wrote, this is not yet portable version, not even close. It is just a  path to it. It is not even installation, I want to get rid of these and use it as any custom executable. And that is not quite the same. Installation assume copying executables and other files inside system area, not necessary at the same places as they are during compilation. Usually they are during developing and easy debuging, but seems here is much more complicated... Let say need to be relocated in right places, which is not trivial... If that is the case, it is not easy at all. And probaly is, as there is separate installation for .deb src files...

To make it realy portable, need to be execeted on live distro, added necessary libraries manually at right places or handle it with symlinks... Etc...
« Last Edit: June 08, 2026, 06:16:02 am by backprop »

backprop

  • Sr. Member
  • ****
  • Posts: 257
Re: Portable verion of FPC and Lazarus
« Reply #40 on: June 07, 2026, 11:32:51 pm »
It suddenly started to read correct cfg file created with fpcmkcfg, but suddenly switched to /usr directory even that do not exists in cfg....

Code: Pascal  [Select][+][-]
  1. [0.008] Interpreting option "-va"
  2. [0.008] Free Pascal Compiler version 3.3.1 [2026/06/07] for x86_64
  3. [0.008] Copyright (c) 1993-2026 by Florian Klaempfl and others
  4. [0.008] Path "/usr/lib/fpc/3.3.1/units/x86_64-linux/rtl/" not found

It also seem it search files in wrong location, for instance system.ppu in /compiler etc. Seems that location of these files differs when is actuallty installed, thus this approach will not work.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12560
  • Debugger - SynEdit - and more
    • wiki
Re: Portable verion of FPC and Lazarus
« Reply #41 on: June 08, 2026, 12:26:26 am »
I don't know if that will help at all... It's not even halfway. But it is all I have. (and it seems info on that kind of "installs" is scarce)

My solution isn't portable. But it is working, and it has fpc (many of them) in custom directories, each with its own config.

I do
Code: Text  [Select][+][-]
  1. cd /home/m/fpc/$INSTSRC/source
  2.  
  3. make clean
  4. make all  OPT=" "  
  5. make install INSTALL_PREFIX=/home/m/fpc/$INSTPATH/def
  6.  
  7. mkdir -p /home/m/fpc/$INSTPATH/def/lib/fpc/etc
  8. mkdir -p /home/m/fpc/$INSTPATH/def/etc
  9.  
  10. cd /home/m/fpc/$INSTPATH
  11. def/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS > def/lib/fpc/etc/fpc.cfg
  12. def/bin/fpcmkcfg -d basepath=/home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS > def/etc/fpc.cfg
  13.  
  14. ln -s /home/m/fpc/$INSTPATH/def/lib/fpc/$INSTVERS/ppcx64 /home/m/fpc/$INSTPATH/def/bin/ppcx64
  15.  

I don't recall all the why, or if actually needed. I figured that out years ago, and back then it took me a lot of time. But I never wrote down the why, or anything but the final script.

Also, and that may be an issue for you: the fpc.cfg file I have has full absolute path.
 (Fine for me, since I don't need portable)

So that you would still need to solve....

And as pointed out before => /home/me/.fpc.cfg would be an issue (but again, I don't have it)


backprop

  • Sr. Member
  • ****
  • Posts: 257
Re: Portable verion of FPC and Lazarus
« Reply #42 on: June 27, 2026, 11:17:44 pm »
It is funny that no one else is concernes about this...

I have manage to recompile current lazarus code with FPC 3.3.1, however, fpc switcher is still the problem.

Code: [Select]
#!/bin/sh

base=[whatever, RAM disk, HDD...]
export HOME="$base/home"
export FPCDIR="$base/fpc/3.3.1"
export PATH="$FPCDIR/bin:$PATH"
mkdir -p "$HOME" "$base/pcp"
exec "$base/lazarus/4.99/src/lazarus" --pcp="$base/pcp"

Starting lazarus as this, start it, but it is used FPC 3.2.2 which is only installed. Changing paths inside Lazarus to 3.3.1 branch failing with various errors. Starting lazarus as this is incomplete, at beginning settings for new or old GUI behavior missing, no OPM menu items, etc...
« Last Edit: June 27, 2026, 11:31:05 pm by backprop »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12560
  • Debugger - SynEdit - and more
    • wiki
Re: Portable verion of FPC and Lazarus
« Reply #43 on: June 28, 2026, 12:48:46 am »
Starting lazarus as this, start it, but it is used FPC 3.2.2 which is only installed. Changing paths inside Lazarus to 3.3.1 branch failing with various errors. Starting lazarus as this is incomplete, at beginning settings for new or old GUI behavior missing, no OPM menu items, etc...

Not much info...

I don't know where your 2ndary fpc are and what config they have? But lets assume, that
- each is in a patch of its own
- each can be used from commandline by using /full/path/to/version/fpc project1.pas

Then it should work in Lazarus too. That is, I have (on Windows and Linux) Lazarus installations, that I frequently change to different FPC versions (3.2.0 to 3.3.1 and in between). And when I restart that Lazarus then it still has the fpc I gave it. I can also rebuild that Lazarus with any of the FPC versions. (Every once in a blue moon, my 3.3.1 is on a commit that causes errors either while compiling, or in the resulting exe - but that is expected of a trunk version)

backprop

  • Sr. Member
  • ****
  • Posts: 257
Re: Portable verion of FPC and Lazarus
« Reply #44 on: June 28, 2026, 08:18:57 am »
The problem here is that need to be "guess" where is what expected to be as there is no proper parameters with proper config files. All is assumed to be somewhere fixed in proper form. And then fpc swicher ("fpc" executable), loop around that...

That is also why changning paths for fpc branches is quite limited, assuming fpc switcher only is required, proper src version path seems to be xxx/fpcsrc/FPCVER etc, etc.

But I do not see anywhere it is specified usage of multiple versions of FPC and Lazarus and that is the problem. No parameters for using specific fpc cfg in Lazarus...

Point here is as title said - to use it without need to be installed on the system partittion, not to use hardcoded directories paths...

Quite a confusion if "establised rules" are not publicly available. Your claim that you also needed to "come to solution with trial and error" and that "you don't remember" just prove all I have wrote here. How to expect from others to "find" solution if you can't?

And one of your "jobs" here is Lazarus IDE... I do not know who else to ask if you do not know...
« Last Edit: June 28, 2026, 12:42:15 pm by backprop »

 

TinyPortal © 2005-2018