Lazarus

Using the Lazarus IDE => General => Topic started by: ertank on November 01, 2017, 05:44:16 pm

Title: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: ertank on November 01, 2017, 05:44:16 pm
Hello,

System is updated today: Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux
Everything is build from relevant SVN source
fpc-3.0.4RC1
lazarus 1.8.0RC5

I have searched for subject error message and all suggestions are to either install fpc in /usr/local and have a /usr/local/bin/fpcres binary rested in there or have a symlink in there.

- I have my fpc installation in /home/pi/fpc-3.1
- My search path is as follows:
PATH=/home/pi/fpc-3.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
PPC_CONFIG_PATH=/home/pi/fpc-3.1/bin
- I can open an empty project. Save it in a new folder and use below command which works just fine.
Code: [Select]
/home/pi/lazarus_1.8RC/bin/lazbuild -B project1.lpi
- fpcres works anywhere in shell command line

However, lazarus ide complains about it cannot find fpcres.

Any suggestions?

Thanks.
Title: Re: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: Neutrino on February 11, 2018, 12:42:31 am
Hello,

I have the same problem with similar setup, do you have find a working solution ?
It's been two days that I sought unsuccessfully...

Thanks !
Title: Re: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: ertank on February 13, 2018, 02:23:30 pm
I did create a symbolic link in /usr/local/bin/fpcres to my fpcres binary. I could not find any other solution.
Title: Re: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: rvk on February 13, 2018, 03:04:21 pm
How did you add /home/pi/fpc-3.1/bin to your PATH variable?

It could be you added it only for the interactive bash shell (in which case it isn't in PATH when Lazarus is run).

Adding a symbolic link in /usr/local/bin will work because /usr/local/bin is already in PATH for your standard profile.
Title: Re: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: ertank on April 15, 2018, 04:36:44 pm
How did you add /home/pi/fpc-3.1/bin to your PATH variable?

It could be you added it only for the interactive bash shell (in which case it isn't in PATH when Lazarus is run).

Adding a symbolic link in /usr/local/bin will work because /usr/local/bin is already in PATH for your standard profile.

Hello rvk,

Sorry for late reply. Below is my search path and if I do not make a symbolic link I cannot have Lazarus to build successfully.
Code: [Select]
PATH=/home/pi/fpc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
# I also have below environment variable set.
PPC_CONFIG_PATH=/home/pi/fpc/bin
Title: Re: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: rvk on April 16, 2018, 10:43:34 am
How did you add /home/pi/fpc-3.1/bin to your PATH variable?
It could be you added it only for the interactive bash shell (in which case it isn't in PATH when Lazarus is run).
Adding a symbolic link in /usr/local/bin will work because /usr/local/bin is already in PATH for your standard profile.
Below is my search path and if I do not make a symbolic link I cannot have Lazarus to build successfully.
You STILL didn't specify HOW you added the fpc-directory to the PATH. That's very important.

If you added it only for the interactive bash shell, you SEE the path when you check the path via a terminal, but it ISN'T present when running the desktop itself.

Note: Search path for desktop can be different from the search path for the interactive shell.

For instance... a simple check. Does the directory exists in the path with this:
Code: Pascal  [Select]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   Showmessage(GetEnvironmentVariable('PATH'));
  4. end;

Look at the attached image. The PATH from the GUI (showmessage) comes from ~/.profile and the one from the terminal comes from ~\.bashrc. See, they are different (after reboot to make sure). I added the xxxx path to the .bashrc to show the difference. So where did you add the path?
Title: Re: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: ertank on April 16, 2018, 01:13:08 pm
Sorry, I didn't understand the question in the first place. Path is added in ".bachrc" file. My Linux knowledge is not deep.

If my memory serves me right, I failed to add it in ".profile" file for a reason I do not remember. What I recall is I tried to add fpc search path in ".profile" file and it did not work. Then I tried ".bashrc" and it seemingly worked.

Knowing it actually works using .profile file. Question comes in my mind is "Do I need to run a command or do system restart in order ".profile" file changes to become active? " It maybe that I likely failed to do.
Title: Re: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: rvk on April 16, 2018, 01:23:37 pm
Path is added in ".bachrc" file.
Yep, in that case it's only added for bash-shells. But when a program is not run through a bash-shell (i.e. the desktop environment), it doesn't have the correct PATH. So Lazarus can't compile itself without adding an extra symlink to a directory in the PATH.

Some explanation:
http://stefaanlippens.net/bashrc_and_others/

Quote
.profile is for things that are not specifically related to Bash, like environment variables PATH and friends, and should be available anytime. For example, .profile should also be loaded when starting a graphical desktop session.
.bashrc is for the configuring the interactive Bash usage, like Bash aliases, setting your favorite editor, setting the Bash prompt, etc.

So you need to add it to your ~/.profile to be present for the PATH in the desktop environment. In that case you don't need the symlink.

PS. You would need to logout and log back in to make the changes in ~/.profile visible for a bash-shell. So maybe that's why you didn't see the PATH change right away after adding it to .profile.
Title: Re: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: thierrybo on May 19, 2018, 11:22:52 am
Hi,

you can also create .desktop or a shell script in your ~/bin with this (this is mine .desktop):

Code: Pascal  [Select]
  1. Exec=sh -c "export HEAPTRC=\\"log=heap.trc nohalt\\" && export PATH=$PATH:/home/thierrybo/.local/opt/fpc/current/bin && /home/thierrybo/.local/opt/lazarus_fixes/startlazarus --pcp=~/.lazarus-stable --scp=~/.lazarus-stable"
Title: Re: Lazarus 1.8.0RC5 - fpcres not found on Raspberry Pi 3 stretch
Post by: marcov on May 19, 2018, 12:05:26 pm
Or maybe set -FD/path/to/fpcres ?