Recent

Author Topic: [SOLVED] How to install an AVR-cross-compiler for multiple AVR-subarches?  (Read 2709 times)

Hartmut

  • Hero Member
  • *****
  • Posts: 893
Some time ago I successfully installed FPC 3.2.2 with Lazarus 2.2.4 with AVR-cross-compiler for AVR-subarch 'avr5' by fpcupdeluxe version 2.2.0n on Linux Ubuntu 18.04 64-bit.

Now I need AVR-cross-compiler for AVR-subarch 'avr25'.

My question is: what will happen, if I use fpcupdeluxe again to install AVR-cross-compiler for AVR-subarch 'avr25'?
a) will I have subarches 'avr5' and 'avr25' both working?
b) or will I loose subarch 'avr5' to have 'avr25' working?
c) or will I damage my installation and have none of both?

Does somebody know this? Thanks in advance.
« Last Edit: March 17, 2023, 07:07:04 pm by Hartmut »

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1793
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #1 on: March 17, 2023, 09:32:44 am »
As fpcupdeluxe makes isolated installs, you can just use (the latest version of) fpcupdeluxe to make a new install in a new directory and give it a try !
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/v2.2.0qp

Thaddy

  • Hero Member
  • *****
  • Posts: 16659
  • Kallstadt seems a good place to evict Trump to.
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #2 on: March 17, 2023, 09:34:17 am »
I would suggest you run your cross-compiler in a terminal window and specify -ic. Then you can see if that sub-architecture might already be supported. Note that you may still need the correct toolchain but I guess you know that.
But I am sure they don't want the Trumps back...

Hartmut

  • Hero Member
  • *****
  • Posts: 893
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #3 on: March 17, 2023, 09:49:46 am »
As fpcupdeluxe makes isolated installs, you can just use (the latest version of) fpcupdeluxe to make a new install in a new directory and give it a try !
https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/v2.2.0qp

Thank you DonAlfredo for your quick reply. But I don't want to make one additional Lazarus installation, if not really needed. AFAIK you are the father of fpcupdeluxe.
Please, what will happen, if I use fpcupdeluxe again to install AVR-cross-compiler for AVR-subarch 'avr25' over my existing 'avr5' installation?

a) will I have subarches 'avr5' and 'avr25' both working?
b) or will I loose subarch 'avr5' to have 'avr25' working?
c) or will I damage my installation and have none of both?

Thaddy

  • Hero Member
  • *****
  • Posts: 16659
  • Kallstadt seems a good place to evict Trump to.
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #4 on: March 17, 2023, 10:55:56 am »
Did you run my suggestion? Obviously not!
But I am sure they don't want the Trumps back...

Hartmut

  • Hero Member
  • *****
  • Posts: 893
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #5 on: March 17, 2023, 11:04:46 am »
Did you run my suggestion? Obviously not!

Hello Thaddy,

yes, I did run your suggestion:

hg6@i3300:/opt/lazarus_224/fpc/bin/x86_64-linux$ ./fpc -ic
ATHLON64
COREI
COREAVX
COREAVX2

But how does this answer my question:

What will happen, if I use fpcupdeluxe again to install AVR-cross-compiler for AVR-subarch 'avr25' over my existing 'avr5' installation?
a) will I have subarches 'avr5' and 'avr25' both working?
b) or will I loose subarch 'avr5' to have 'avr25' working?
c) or will I damage my installation and have none of both?

Thaddy

  • Hero Member
  • *****
  • Posts: 16659
  • Kallstadt seems a good place to evict Trump to.
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #6 on: March 17, 2023, 11:08:25 am »
You did not run the cross-compiler. The cross compiler should give you the AVR versions that are supported.
If I run my cross compilers for e.g. ARM I get a long list of supported ARM processors.
But I am sure they don't want the Trumps back...

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1793
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #7 on: March 17, 2023, 11:21:14 am »
In theory, having two subarchs should work.
Fpcupdeluxe employs some trickery to do so.
E.g. this is by fpc.cfg for avr5 and avr25
Code: Pascal  [Select][+][-]
  1. # begin fpcup do not remove avr-embedded
  2. # Inserted by fpcup 17/03/2023 10:13:17
  3. # Cross compile settings dependent on both target OS and target CPU
  4. #IFDEF FPC_CROSSCOMPILING
  5. #IFDEF EMBEDDED
  6. #IFDEF CPUAVR
  7. #IFDEF CPUAVR5
  8. #ENDIF CPUAVR5
  9. #IFDEF CPUAVR25
  10. #ENDIF CPUAVR25
  11. -FDC:\fpcupsystems\avr\cross\bin\avr-embedded
  12. -XPavr-embedded-
  13. -FlC:\fpcupsystems\avr\cross\lib\avr-embedded\$FPCSUBARCH
  14. -FuC:\fpcupsystems\avr\fpc\units\avr-embedded\$FPCSUBARCH\rtl
  15. -FuC:\fpcupsystems\avr\fpc\units\avr-embedded\$FPCSUBARCH\packages
  16. #ENDIF CPUAVR
  17. #ENDIF EMBEDDED
  18. #ENDIF FPC_CROSSCOMPILING
  19. # end fpcup do not remove
The unit-files for avr5 and avr25 are installed in a separate subdir of avr-embedded.
A fake system.ppu is added to satisfy Lazarus in the base directory.

Hartmut

  • Hero Member
  • *****
  • Posts: 893
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #8 on: March 17, 2023, 11:46:20 am »
You did not run the cross-compiler.

Ok, did not know that. Please how do I start the cross-compiler?



Thank you very much DonAlfredo for answering my question. I will try to install subarch 'avr25' over my existing 'avr5' installation.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1793
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #9 on: March 17, 2023, 11:53:19 am »
See screenshot !
Select the avr25 subarch and you should be good to go.
Remember, I use the latest fpcupdeluxe (pre-release).

ccrause

  • Hero Member
  • *****
  • Posts: 1007
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #10 on: March 17, 2023, 12:44:42 pm »
You did not run the cross-compiler. The cross compiler should give you the AVR versions that are supported.
If I run my cross compilers for e.g. ARM I get a long list of supported ARM processors.
Yes, this will confirm which controllers and subarchitectures the compiler supports.  It does not however guarantee that the RTL and package units for a particular subarch is actually installed.  fpcupdeluxe only install the selected subarch.  Thus, as Don explained, one has to repeat the installation for all the subarches the user needs.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5906
  • Compiler Developer
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #11 on: March 17, 2023, 03:23:14 pm »
I would suggest you run your cross-compiler in a terminal window and specify -ic. Then you can see if that sub-architecture might already be supported. Note that you may still need the correct toolchain but I guess you know that.

A compiler binary supports all the subarchitectures for a given platform (if they are handled as subarchitectures, so ARM vs. ARMHF or ARMEL vs ARMEB does not count), however the RTL needs to be compiled for that subarchitecture and that can't be reported by the compiler.

You did not run the cross-compiler.

Ok, did not know that. Please how do I start the cross-compiler?

Assuming that the fpc binary can locate the AVR cross compiler you can simply use fpc -P<platform> (e.g. fpc -Pavr) plus whatever additional parameters you need (e.g. -i) to invoke the specific cross compiler with those parameters.

Hartmut

  • Hero Member
  • *****
  • Posts: 893
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #12 on: March 17, 2023, 05:29:28 pm »
Thanks to ccrause and PascalDragon for clarification.

hg6@i3300:/opt/lazarus_224/fpc/bin/x86_64-linux$ ./fpc -Pavr -ic

shows

AVR1
AVR2
AVR25
AVR3
AVR31
AVR35
AVR4
AVR5
AVR51
AVR6

although only AVR5 is installed, as you said.

Hartmut

  • Hero Member
  • *****
  • Posts: 893
Re: How to install an AVR-cross-compiler for multiple AVR-subarches?
« Reply #13 on: March 17, 2023, 07:06:19 pm »
Now I installed with fpcupdeluxe Version 2.2.0qp (Pre-release) AVR-subarch 'avr25' over subarch 'avr5' and it worked perfectly. Now I can use both subarches parallel. Many thanks to DonAlfredo and all others who have helped me.

Mathias

  • Jr. Member
  • **
  • Posts: 98
With me everything goes parallel, dan Don Alfredo.
Code: [Select]
Running on Linux Mint
Build with: FPC 3.2.2 on Win11 x86_64
CPU cores used: 8
Available physical memory: 15702 MB
Available swap: 2047 MB

Current install directory: /home/tux/fpcupdeluxe_Embedded

Found crosscompiler for  avr-embedded-avr1
Found crosscompiler for  avr-embedded-avr2
Found crosscompiler for  avr-embedded-avr25
Found crosscompiler for  avr-embedded-avr35
Found crosscompiler for  avr-embedded-avr4
Found crosscompiler for  avr-embedded-avr5
Found crosscompiler for  avr-embedded-avr51
Found crosscompiler for  avr-embedded-avr6
Found crosscompiler for  avr-embedded-avrtiny
Found crosscompiler for  avr-embedded-avrxmega3
Found crosscompiler for  arm-embedded-armv6m
Found crosscompiler for  arm-embedded-armv7m
Found crosscompiler for  x86_64-windows
Found crosscompiler for  i386-windows
Found crosscompiler for  i386-linux
Found crosscompiler for  arm-linux
Found crosscompiler for  xtensa-freertos-lx6
Found crosscompiler for  xtensa-freertos-lx106
Found crosscompiler for  jvm-java
Found crosscompiler for  arm-android
Found crosscompiler for  jvm-android
Found crosscompiler for  aarch64-linux-musl
Found crosscompiler for  aarch64-windows
Found crosscompiler for  aarch64-android
Found crosscompiler for  aarch64-darwin
Found crosscompiler for  i8086-msdos
Found crosscompiler for  i386-go32v2
Found crosscompiler for  arm-ios
Found crosscompiler for  arm-freertos-armv7em
Found crosscompiler for  aarch64-ios
Found crosscompiler for  i386-android
Found crosscompiler for  i386-darwin
Found crosscompiler for  i386-freebsd
Found crosscompiler for  i386-openbsd
Found crosscompiler for  i386-haiku
Found crosscompiler for  i386-aros
Found crosscompiler for  x86_64-haiku
Found crosscompiler for  x86_64-solaris
Found crosscompiler for  x86_64-aros
Found crosscompiler for  ppc-morphos

Got settings from install directory.

 

TinyPortal © 2005-2018