* * *

Author Topic: [SOLVED] Multiple Lazarus Install => "Error system.ppu not found. Check fpc.cfg"  (Read 909 times)

Hartmut

  • Full Member
  • ***
  • Posts: 115
On a Windows 7 system (32 bit) I have 3 Lazarus Installations in the folders:
 - h:\Progs\Lazarus\144\  (which is Lazarus 1.4.4 with FPC 2.6.4)
 - h:\Progs\Lazarus\162\  (which is Lazarus 1.6.2 with FPC 3.0.0)
 - h:\Progs\Lazarus\180\  (which is Lazarus 1.8.0 RC5 with FPC 3.0.4)

Their config folders are:
 - c:\Users\Admin\AppData\Local\lazarus144\
 - c:\Users\Admin\AppData\Local\lazarus162\
 - c:\Users\Admin\AppData\Local\lazarus180\

Lazarus 1.8.0 and 1.6.2 start. But Lazarus 1.4.4 shows on start an Error "system.ppu not found. Check your fpc.cfg"
The shown path to the compiler = H:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.exe (seems correct for me).

The installation of  Lazarus 1.8.0 RC5 and 1.6.2 have been made with the "secondary installation" option.

Lazarus 1.4.4 menu "View / IDE Internals / About FPC" shows:
    FPC executable:
    Compiler=H:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.exe
    ...
    CfgFilename=h:\Progs\Lazarus\162\fpc\3.0.0\bin\i386-win32\fpc.cfg

    ...

    Undefines:
    UnitPaths:
    H:\Progs\Lazarus\162\fpc\3.0.0\bin\i386-win32
Both bold marked paths seem to be incorrect for me.

My question is: how can I solve the Error "system.ppu not found. Check your fpc.cfg" at start of Lazarus 1.4.4 ?
 
I attached the output of Lazarus 1.4.4 menus "View / IDE Internals / About FPC + About IDE" and the config folder of Lazarus 1.4.4 and file h:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.cfg
Thanks a lot in advance.
« Last Edit: October 22, 2017, 09:07:53 pm by Hartmut »

wp

  • Hero Member
  • *****
  • Posts: 3893
I think the fpc.cfg which you posted for your Laz 1.4.4 installation is missing the "144" in the paths:

Example
current config:
# searchpath for units and other system dependent things
-FuH:\Progs\Lazarus\fpc\$FPCVERSION/units/$fpctarget
-FuH:\Progs\Lazarus\fpc\$FPCVERSION/units/$fpctarget/*
-FuH:\Progs\Lazarus\fpc\$FPCVERSION/units/$fpctarget/rtl

should be
# searchpath for units and other system dependent things
-FuH:\Progs\Lazarus\144\fpc\$FPCVERSION/units/$fpctarget
-FuH:\Progs\Lazarus\144\fpc\$FPCVERSION/units/$fpctarget/*
-FuH:\Progs\Lazarus\144\fpc\$FPCVERSION/units/$fpctarget/rtl
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Hartmut

  • Full Member
  • ***
  • Posts: 115
I think the fpc.cfg which you posted for your Laz 1.4.4 installation is missing the "144" in the paths:

You're right, the '144\' seems to be missing (although my Lazarus 1.4.4 installation worked, before I installed 1.8.0 RC5). I had seen this issue before and had tried with '144\' in the pathnames, but that had made no difference. Tried it now again with same result.

I'm afraid that the file h:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.cfg is not used and that file h:\Progs\Lazarus\162\fpc\3.0.0\bin\i386-win32\fpc.cfg is used instead (see bold path above in my 1st post).
Any idea about that? Thanks for your help!

molly

  • Hero Member
  • *****
  • Posts: 1960
I'm afraid that the file h:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.cfg is not used and that file h:\Progs\Lazarus\162\fpc\3.0.0\bin\i386-win32\fpc.cfg is used instead (see bold path above in my 1st post).
Any idea about that? Thanks for your help!
Compile with -va and read the compiler output. FPC is then able to tell you which fpc.cfg it is using (from what location).

wp

  • Hero Member
  • *****
  • Posts: 3893
Having  several Lazarus installations on my disk I've seen such issues occasionally. Unfortunately paths are used at various locations. Since you are on Windows and you use only release versions it is the quickest way to erase the defective version and its config folder and to install it anew.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

wp

  • Hero Member
  • *****
  • Posts: 3893
And make sure that you don't put any fpc directory etc in the Windows PATH, this is calling for trouble with multiple installations.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Hartmut

  • Full Member
  • ***
  • Posts: 115
@wp:
I would not be happy if I must erase and install Laz 1.4.4 again, because I think I would loose all the many configuration settings I made there and because this would be again a "secondary installation" I am afraid, that after this Laz 1.6.2 or 1.8.0 could have a problem.

@molly:
If I understood your request right, I started h:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.exe with -va option from the command line. The output shows:
...
[0.000] Reading options from file fpc.cfg
[0.000] Start of reading config file fpc.cfg
[0.000] interpreting file option "#"
[0.000] interpreting file option "# Config file generated by fpcmkcfg on 14.11.2015 - 11:49:40"
[0.000] interpreting file option "# Example fpc.cfg for Free Pascal Compiler"
...
which is the beginning of the fpc.cfg file in the h:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\ folder and not in the 162\fpc\3.0.0\ folder.
I attached the whole output.

Thanks to both for your help.

wp

  • Hero Member
  • *****
  • Posts: 3893
Referring to "secondary installation": You did a "primary" install for 1.4.4? The primary installation usually puts its config files in c:\users\<your name>\appdata\local\lazarus (without version number appended!). To take the config from a different location there is a file "lazarus.cfg" next to "lazarus.exe" which must have the content "--primary-config-path=c:\Users\Admin\AppData\Local\lazarus144\", or you must start lazarus with this as command line parameter. Please check if Laz 1.4.4 really gets its config data from the correct folder.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

molly

  • Hero Member
  • *****
  • Posts: 1960
@Hartmut:
You understood correctly :-)

except for one minor detail: start from lazarus compilation, project options -> verbosity all (sorry as i assumed you knew).

But, also my mistake (sorry about that) you already had all your relevant output in your attachment and already showed the wrong path for fpc.cfg.

As wp mentioned you need to add the pcp option to your shortcut to lazarus. In fact i do that for every lazarus install (even my primary one). The fact that lazarus (by default) stores its config files somewhere i do not have control over, is plain confusing to me.

In case the removal of fpc path for commandline compilation is problematic for you then please let know, as there are other solutions to 'fix' that f.e. with some script stored somewhere else on your path).


Hartmut

  • Full Member
  • ***
  • Posts: 115
For 1.4.4 I did a "primary install" to h:\Progs\Lazarus\ with the config folder c:\Users\Admin\AppData\Local\lazarus\
When I later added 1.6.2 I changed both locations and set
 - file h:\Progs\Lazarus\144\lazarus.cfg to contain --primary-config-path=c:\Users\Admin\AppData\Local\lazarus144
 - file h:\Progs\Lazarus\162\lazarus.cfg to contain --primary-config-path=c:\Users\Admin\AppData\Local\lazarus162
I did this 10 month ago and both installations worked fine.

I changed my shortcut to Laz 1.4.4 already to have the option --primary-config-path=c:\Users\Admin\AppData\Local\lazarus144 but that made no difference.

I think the removal of fpc PATH for commandline compilation is no problem for me, because I use Lazarus or the old Text Mode IDE.

If I understood molly correctly, you found the infos you requested already. Otherwise please let me know.

molly

  • Hero Member
  • *****
  • Posts: 1960
If I understood molly correctly, you found the infos you requested already. Otherwise please let me know.
That is correct. Thank you for the feedback.

The only other thing that seems out of the ordinary to me is inside your FPC iDE Internals log.
Quote
FPCDIR=h:\Progs\Lazarus\180\fpc\3.0.4\bin\i386-win32\
That does not seem right, see also here.
Quote
The compiler adds several paths to the unit search path:
1 The contents of the environment variable XXUNITS, where XX must be replaced with one of the supported targets: GO32V2, LINUX,WIN32, OS2, BEOS, FREEBSD, SUNOS, DARWIN (the actual list depends on the available targets).
2 The standard unit directory. This directory is determined from the FPCDIR environment variable. If this variable is not set, then it is defaulted to the following:

Where your fpc directory is located here:
Quote
Global IDE options:
LazarusDirectory=H:\Progs\Lazarus\144\
Resolved LazarusDirectory=H:\Progs\Lazarus\144\
Project's CompilerFilename=$(CompPath)
Resolved Project's CompilerFilename=H:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.exe
Default CompilerFilename=H:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.exe
Resolved default compilerFilename=H:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.exe
CompilerMessagesFilename=
Resolved CompilerMessagesFilename=H:\Progs\Lazarus\144\components\codetools\fpc.errore.msg
and
Quote
FPC executable:
Compiler=H:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\fpc.exe
Options=
CompilerDate=03.10.2015 20:27:28
RealCompiler=H:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\ppc386.exe
RealCompilerDate=03.10.2015 20:27:30
RealTargetOS=win32
RealTargetCPU=i386
RealCompilerInPath=H:\Progs\Lazarus\144\fpc\2.6.4\bin\i386-win32\ppc386.exe
Version=2.6.4
CfgFilename=h:\Progs\Lazarus\162\fpc\3.0.0\bin\i386-win32\fpc.cfg
Which seem to indicate that the units directory (FPCDIR) does not match your fpc location (you might perhaps have a different setup which makes it match, but i doubt that here).

Is that FPCDIR environment variable set by yourself ? If,m so then try to remove that and see if that influences your setup.

i am plain confused about the last line on the latest quote:
Quote
Version=2.6.4
CfgFilename=h:\Progs\Lazarus\162\fpc\3.0.0\bin\i386-win32\fpc.cfg

Are you sure you have a fpc 2.6.4 fpc.cfg file ?
« Last Edit: October 22, 2017, 06:46:32 pm by molly »

Hartmut

  • Full Member
  • ***
  • Posts: 115
Maybe I have a solution: starting with the suggestion from wp, not to put any fpc directory etc in the Windows PATH, and molly's recommendation to check for environment variables, I did the following:
 - deleted the PATH entry
 - deleted the Environment variables PPC_ERROR_FILE + PPC_EXEC_PATH (with them it did not work)
 - deleted file c:\Users\Admin\AppData\Local\lazarus144\fpcdefines.xml (because it contained a lot of paths to 1.6.2 and 1.8.0)
After this Laz 1.4.4 starts!

Give me some time for testing if every install uses the correct compiler. I will report a.s.a.p.

@molly:
yes, I have a fpc 2.6.4 fpc.cfg file. It's included in the attachment of my 1st post.

molly

  • Hero Member
  • *****
  • Posts: 1960
yes, I have a fpc 2.6.4 fpc.cfg file. It's included in the attachment of my 1st post.
Ah yes of course, my bad.

Quote
- deleted file c:\Users\Admin\AppData\Local\lazarus144\fpcdefines.xml (because it contained a lot of paths to 1.6.2 and 1.8.0)
That might be the smartest move yet because that was very 'dirty'. even generic unit directory located completely somewhere else: UnitPaths BaseDir="D:\FPC"

Quote
Give me some time for testing if every install uses the correct compiler. I will report a.s.a.p.
If no confusion left for fpc/lazarus with regards to generic OS paths and environment variables then you should be good to go. But please let know if you were successful or not.

Hartmut

  • Full Member
  • ***
  • Posts: 115
As far as I can see, the solution described in reply #11 works.
The operative point was to delete the PATH entry and the 2 Environment variables. Without this, deleting c:\Users\Admin\AppData\Local\lazarus144\fpcdefines.xml did not help.

Again a great "Thank you very much" to wp and molly, who helped me frequently.

For today my head smokes. Next days I will do some research about the Environment variables FPCDIR, PPC_CONFIG_PATH, PPC_ERROR_FILE and PPC_EXEC_PATH. Probably I will add them again now, where the problem of creating a valid c:\Users\Admin\AppData\Local\lazarus144\fpcdefines.xml is done. But in this case I will delete them before the next multiple Lazarus installation to avoid problems.

wp

  • Hero Member
  • *****
  • Posts: 3893
My Windows does not contain any environment variables related to FPC and Lazarus.

The path is polluted with entries for Delphi, though - it's a shame that this expensive commercial program is not able to find itself and its tools. And this is the reason why the usual make files do not work because always Delphi's make is called. Therefore, I do all console work using a batch file which sets the path temporarily.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus