Gcc/gfortran 16 released

I meant to edit my original post but haven’t gotten around to it yet.

The GCC 16 version I downloaded is in the ubuntu-toolchain-r/test repository and is a pre-release version from March. It doesn’t appear to include the caf_shared library required for shared memory CAF. Version 15.2 is in the standard Ubuntu toolchain ppa

To access either you have to add a ppa path to the repository. This is usually done by:

``’
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-16 gfortran-16 g+±16

or
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
sudo apt update
sudo apt install gcc-15 gfortran-15 g+±15

I’m waiting for it to appear in Homebrew too (MacOS). It usually takes a few weeks from the standard release for it to appear in the various package managers.

While the standard compiler of Ubuntu 26.04 is gcc/gfortran is version 15 (which will remain the standard compiler), gcc and gfortran 16 are the repository. I think the packsge is called gfortran-16.

I do not know about earlier versions of Ubuntu, but one can look that up in your packet manager.

I tried that package in Ubuntu 26.04, but that version does not seem to include the caf_shmem library:

$ gfortran-16 -fcoarray=lib coarrays.f90 -lcaf_shmem
/usr/bin/x86_64-linux-gnu-ld.bfd: cannot find -lcaf_shmem: No such file or directory
collect2: error: ld returned 1 exit status
$ gfortran-16 --version
GNU Fortran (Ubuntu 16-20260322-1ubuntu1) 16.0.1 20260322 (experimental) [trunk r16-8246-g569ace1fa50]

I guess you will have to wait for Ubuntu 26.10 for the official repositories.

In Fedora 44, we now have:

$ gfortran --version
GNU Fortran (GCC) 16.1.1 20260515 (Red Hat 16.1.1-2)

In GCC versioning, 16.0 is the experimental development version. 16.1 is the first stable release. GCC 17.0 is now opened for development, to be released in April 2027 as GCC 17.1.

It is also available in Debian SID (unstable) repository.
Unfortunately, even gcc-15 is only in SID, the “system” GCC for Debian 13 (trixie) being version 14

For easy access to the latest open-source software, use Windows :grinning_face: . From equation.com I have

c:\fortran>gfortran --version
GNU Fortran (GCC) 17.0.0 20260510 (experimental)

(Was joking above and am thinking of putting Linux on one of my PCs so I use the latest versions of LFortran and other compilers.)

1 Like

I think that might be due to the person building the GCC packages for each Ubuntu version is not including the build options that turn on the shared memory CAF support. Doubt that will change with a new Ubuntu version unless someone requests that CAF support be turned on in all future versions.

Fedora is a good choice for bleeding edge Fortran compilers: GFortran, Flang and LFortran are in the official repos.

1 Like

Does Fedora still try to shove the nouveau open source graphics driver for Nvidia cards and Gnome 3 desktop down your throat. Those are the two biggest reasons I switched to Linux Mint. I despise both. Nouveau was like a zombie. Even when you thought you had done all the necessary steps to get rid of it, it still came back. Gnome 3 caught the Microsoft/Apple OS “our way or the highway” bug. Linux Mint gives me a choice of desktops and seamless installation of Nvidia’s native drivers at installation. Unfortunately, it does stay a couple generations behind “bleeding edge” since it’s main distro is based on an Ubuntu LTS release. There is an alternate version based on pure Debian that is the Linux Mint developers backup should Ubuntu disappear.

@rwmsu

Fedora has two official desktop versions: Workstation (GNOME) and KDE. See https://fedoraproject.org/
They of course offer other desktops in versions they call “Spins”, like XFCE, Cinnamon, etc.

I have Fedora 44 on four machines (with GNOME), but indeed some display problems on the one with a NVIDIA Quadro K620. The driver is nouveau by default. I have not yet tried to investigate. See their discourse for more information, for example:

ChatGPT gave me pretty simple and clean way to install and test gfortran-16 from Debian SID on my MX Linux 25, using a “chroot container” (just 1.5GB inside normal FS hierarchy), without messing up with system libc etc. I guess it also might work on Ubuntu, though YMMV. If anybody interested, let me know.

1 Like

As a follow up for anyone wanting to try Nvidia gpu programming (my main system has an Nvidia Quadro RTX 4000 with 8GB of ram and 2304 cores) I found the easiest way was to run a linux distro under the Microsoft Windows Subsystem for Linux. I have got openSuSe tumbleweed and ubuntu 22.04.5 running the Nvidia Fortran examples on this system accessing the gpu. I had major problems trying to do get a native linux install (multi boot, Windows, Redhat and SuSe) working due to problems installing the nvidia drivers. Trying to move from the default nouveau driver to the nvidia driver ‘bricked’ my Redhat installation. Good way to waste several days!

1 Like

I just noticed that Homebrew now has gcc 16.1.0 available.

2 Likes

The new version is great. It is my fault, but GFORTRAN_NUM_IMAGES and GFORTRAN_IMAGE_NUM looks REALLY similar and latter should not be altered at all.

with the latter (which I tried first), a.out crashes immediately.

NB. without optimization (like -O2) the coarrays do not work at all, with execution time increasing with the number of images!
NB2. strangely, at least in Linux version, compiled as
gfortran -fcoarray=lib -O2 prog.f90 -lcaf_shmem
the running threads have all absurdly huge Virtual Size (like 16g), without any arrays involved. Luckily the Resident Size is “normal”. It was not so with OpenCoarrays and gfortran-13.