Which Fortran compilers are usable on Raspberry Pi?

Which Fortran compilers are usable on Raspberry Pi, e.g., model 4B?

Here is the information about such a model with the recommended Raspberry Pi OS, which is 32-bit.

$ uname -a && lscpu
Linux Pi-1 5.15.61-v7l+ #1579 SMP Fri Aug 26 11:13:03 BST 2022 armv7l GNU/Linux
Architecture:                    armv7l
Byte Order:                      Little Endian
CPU(s):                          4
On-line CPU(s) list:             0-3
Thread(s) per core:              1
Core(s) per socket:              4
Socket(s):                       1
Vendor ID:                       ARM
Model:                           3
Model name:                      Cortex-A72
Stepping:                        r0p3
CPU max MHz:                     1800.0000
CPU min MHz:                     600.0000
BogoMIPS:                        108.00
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Not affected
Vulnerability Retbleed:          Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1:        Mitigation; __user pointer sanitization
Vulnerability Spectre v2:        Vulnerable
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

gfortran is readily available by a simple sudo apt install gfortran, which is great. Do you know other compilers that are compatible with Raspberry Pi? Thank you very much.

I think ARM has a version of FLANG/CLANG that runs on LInux. Don’t know what it would take to get it to run on a PI (if it does at all). DuckDuckGo is your friend

Thank you @rwmsu . I had a try, but failed. The installer complained something like “incorrect binary file format”. I am not sure whether it is due to the fact that the OS is 32-bit.

What is the operational system put on the memory chip/available to you? From the characteristic red swirl shown top left on the home page of Raspbian/Rasperry Pi OS here tailored to the device, one can assume the OS is an off-spring of Linux Debian. Running synaptics (maybe this requires once a sudo apt-get install synaptics) likely offers you gfortran (.or. gcc). As by today, Debian 12/bookworm (branch testing) reached version 12.2.0-14 (release/package for both).

For a more detailed view per release of the OS, see e.g., the table compiled by distrowatch; it states gcc 10.2.1 is offered for the OS shipped by 2022-09-26.

1 Like

Thank you @nbehrnd . The OS is the “Raspberry Pi OS, the recommended operating system for most users”. It is based on Debian.

As you said, gfortran is readily available with apt. I hope to know whether there is any other, in case someone here has some experience.

I think there is a 64 bit version of the Raspberry Pi OS but I don’t know if its officially maintained. Installing that instead of the 32 bit version might be an option.

1 Like