Recent

Author Topic: [CLOSED] IDE shows wrong Error Message "Cross compiler not supported" (fpcupdelu  (Read 6410 times)

Hartmut

  • Hero Member
  • *****
  • Posts: 853
I installed FPC 3.2.2 with Lazarus 2.2.4 on Linux Ubuntu 22.04 64-bit via fpcupdeluxe. Then I added 4 cross-compilers to that installation via fpcupdeluxe:
 - 32-bit (i386)
 - avr (avr5 + avr25)
 - aarch64

Everything works fine. I can successfully compile for all those targets. But when I select in Menu "Project Options / Compiler Options / Config and Target / Target CPU family" = "aarch64" and press OK, then I always get this Error Message:

Compiler "<install_path>/fpc.sh" does not support target aarch64-linux.

When I start the IDE with this "Target CPU family" being active, I always get this message too.

I want to get rid of this wrong Error Message. How can I achieve that? Thanks in advance.
« Last Edit: June 12, 2023, 06:06:58 pm by Hartmut »

Hartmut

  • Hero Member
  • *****
  • Posts: 853
Re: IDE shows wrong Error Message "Cross compiler not supported"
« Reply #1 on: June 09, 2023, 05:21:53 pm »
Hmm, no answers after 4 days. Did I pick the wrong subforum? Did I describe my problem not clear enough? Then please ask...

How does the IDE "decide", whether a selected "Target CPU family" is supported or not? Is there a some kind of configuration file for that, which I could correct?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: IDE shows wrong Error Message "Cross compiler not supported"
« Reply #2 on: June 09, 2023, 05:28:28 pm »
Maybe change the subject to include FpcUpDeluxe.

Sorry, but I don't know anything on the issue itself.

Lazarus would run the compiler (in your case I guess fpc.sh) and ask it what it supports.
I don't know if its possible to capture the output of that....

Hartmut

  • Hero Member
  • *****
  • Posts: 853
Re: IDE shows wrong Error Message "Cross compiler not supported"
« Reply #3 on: June 10, 2023, 08:44:25 am »
Maybe change the subject to include FpcUpDeluxe.
Thanks Martin_fr. I included 'fpcupdeluxe' into the subject.

Quote
Lazarus would run the compiler (in your case I guess fpc.sh) and ask it what it supports.
I don't know if its possible to capture the output of that....
Does this mean, that all cross-compilers are "integrated" into the one main compiler, which fits all? Or does one separate compiler exist for each cross-compiler?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
Re: IDE shows wrong Error Message "Cross compiler not supported"
« Reply #4 on: June 10, 2023, 08:55:23 am »
Does this mean, that all cross-compilers are "integrated" into the one main compiler, which fits all? Or does one separate compiler exist for each cross-compiler?

fpc.exe (or just fpc) on windows is a wrapper/loader. (and fpc.sh is a wrapper around the wrapper // adding the path to the fpc.cfg).

The actual compiler is ppcx86 or ppci386 or ppcarch...
Afaik the should all be in the same folder.

When fpc sees the options for a target/cpu in the param list, it will select the correct ppc... and execute it.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
The curious thing is that you can compile for the target, or so you say => so that is when you compile from command line?

Maybe an issues with what the current directory is, maybe not. Not sure how fpcupdeluxe deals with that.

Mind that all installations are made for the exact path in which they were originally installed. Renaming folders (mv my/fpc/delexux/fpc new/fpc) will break them (afaik).

Hartmut

  • Hero Member
  • *****
  • Posts: 853
fpc.exe (or just fpc) on windows is a wrapper/loader. (and fpc.sh is a wrapper around the wrapper // adding the path to the fpc.cfg).
The actual compiler is ppcx86 or ppci386 or ppcarch...
Afaik the should all be in the same folder.
In the folder of fpc.sh I found 4 files, which start with ppc*:
ppcross386 (could be the 32-bit cross-compiler)
ppcrossa64 (could be the aarch64 cross-compiler)
ppcrossavr (could be the avr cross-compiler)
ppcx64     (could be the main 64-bit compiler)

Quote
The curious thing is that you can compile for the target, or so you say => so that is when you compile from command line?
I always compiled out of the Lazarus IDE, which works. I never tried to compile from the command line (because I don't know which compiler / cross-compiler I had to use and all it's many parameters).

Quote
Maybe an issues with what the current directory is, maybe not. Not sure how fpcupdeluxe deals with that.
The current directory should within the IDE always be the same, I think.

Quote
Mind that all installations are made for the exact path in which they were originally installed. Renaming folders (mv my/fpc/delexux/fpc new/fpc) will break them (afaik).
I did not rename folders.

TRon

  • Hero Member
  • *****
  • Posts: 3647
I always compiled out of the Lazarus IDE, which works. I never tried to compile from the command line (because I don't know which compiler / cross-compiler I had to use and all it's many parameters).
Your fpc.sh wrapper should be able to pass commandline parameters to the FPC executable.

For command line parameters for FPC, see https://www.freepascal.org/docs-html/user/userap1.html

You should be looking at the options -T and -P for setting the target specifications in particular.

For information on targets see option -i, specifically -it

for instance (as an example) you can target windows with:
Code: [Select]
fpc -Twin32 -Pi386 myprogram.pasin order to create a i386 executable that is bale to run on windows

for instance my FPC host compiler is running on x86-64 and in order to see the targets for 32-bit processors you can do:
Code: [Select]
fpc -Pi386 -itWhich would show (amongst others) that the windows target is win32 (that is the "value" you can add to the -T parameter)

Since I run on 64 bit x86 there is no need to add -Px86_64 as processor in order to list/see the supported target (but you can do so).

If you provide the (correct) CPU target argument then the FPC wrapper automatically selects the correct cross-compiler (ppcross386, ppcrossa64 and ppcrossavr).

Having said that, the avr target probably also requires you to set a subtarget but, I do not know much about the specifics. Try the avr wiki pages in that case.
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

TRon

  • Hero Member
  • *****
  • Posts: 3647
Mind that all installations are made for the exact path in which they were originally installed. Renaming folders (mv my/fpc/delexux/fpc new/fpc) will break them (afaik).
Which installations do you refer to in particular ? Lazarus ? (with included fpc) or otherwise ?

imho it is not necessary at all to have FPC bound to a particular (installation) directory. FPC can be setup and configured to completely act/work stand-alone (provided that you follow some of the rules imposed by the compiler).
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Hartmut

  • Hero Member
  • *****
  • Posts: 853
Thank you very much TRon for that detailed informations. With that I was able to run the compiler from the command line:
Code: Text  [Select][+][-]
  1. /opt/lazarus_224/fpc/bin/x86_64-linux/fpc.sh -Mtp -Fu/media/D/FPC/work/ -Fu/media/D/FPC/work/fremde/ -Fu/opt/lazarus_224/lazarus/components/lazutils/lib/aarch64-linux -Paarch64 wettcsv.pas

But my goal is to use the IDE for compiling and to get rid of the annoying error message, which 1) the IDE always shows, when I switch the "Target CPU family" to "aarch64" and press OK and which 2) is shown every time, when I start the IDE and the last project has "Target CPU family" = "aarch64".

TRon

  • Hero Member
  • *****
  • Posts: 3647
But my goal ...
For sure and I am sympathetic to that desire. It is just that Martin_fr asked "what happens if ...". Now we/you know  (e.g. no errors/warning or alike that could indicate a setup issue with FPC that could cause the Lazarus related message) :)

edit
Quote
But my goal is to use the IDE for compiling and to get rid of the annoying error message, which 1) the IDE always shows, when I switch the "Target CPU family" to "aarch64" and press OK and which 2) is shown every time, when I start the IDE and the last project has "Target CPU family" = "aarch64".
concerning 2 (that could probably also lead to 1: That should not be. Have you at any time changed the global Lazarus (default target) settings perhaps ?
« Last Edit: June 10, 2023, 11:07:06 am by TRon »
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Hartmut

  • Hero Member
  • *****
  • Posts: 853
Have you at any time changed the global Lazarus (default target) settings perhaps ?

Sorry, I don't understand your question. Which settings do you mean (in which menu do I find this)? Please be more verbose. Thanks.

TRon

  • Hero Member
  • *****
  • Posts: 3647
Sorry, I don't understand your question. Which settings do you mean (in which menu do I find this)? Please be more verbose. Thanks.
No need to be sorry.

Unfortunately, I can not get very verbose simply because it is a single checkbox in the (current open) project options that takes care of that.

When you open the project options (empty new project is good enough for testing) at the bottom just above the (help, ok, cancel) buttons at the left size is a single tiny checkbox with the text "Set compiler options as default"

If you have ever tapped that checkbox then all new projects will (by default) use those settings that you saved (pressed ok) while the checkbox is checked.

In the same way you can "remove" the default global setting(s) for the target.

Configure all settings in such a way that you are comfortable with them to use as global defaultl settings, tap the checkbox so tjhat it is activated and press  ok to save the new (global) settings.

Was that more helpful ?
This tagline is powered by AI (AI advertisement: Free Pascal the only programming language that matters)

Hartmut

  • Hero Member
  • *****
  • Posts: 853
Thank you TRon for that explainations. Now I know which checkbox you mean. I have used this checkbox once in the past to save some settings, but did *not* change "Target OS" or "Target CPU family" or "Target processor" this way. Was that what you meant?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10553
  • Debugger - SynEdit - and more
    • wiki
I don't think it is the "default".

Since the error happens when he opens a project with specific settings in that project (settings that would be other than his defaults, since the IDE does not complain for other/normal projects)



It must be done to whatever test the IDE runs on the compiler, if a project has those settings.

But, I don't have an idea what....

 

TinyPortal © 2005-2018