Gcc/gfortran 16 released

GCC 16.1 was officially released today:

2 Likes

does anyone have a ./configure line that has worked? I am not being able to compile gcc

1 Like

Jerry guided me to compile GCC a few weeks ago.

I had created a gcc-dev directory with three subdirs:

  • trunk/ (gcc sources)
  • objdir/ (empty)
  • usr/ (empty)

First, in trunk/:

$ ./contrib/download_prerequisites
$ sudo dnf install gcc-c++ glibc-devel.i686

From objdir/, I had in my script:

readonly repertoire=/home/my_login/gcc_dev
../trunk/configure --prefix="${repertoire}"/usr --enable-languages=c,c++,fortran --enable-multilib --enable-libgomp --disable-bootstrap

make -j10 1>/dev/null && make install 1>/dev/null

Drink you coffee… :hot_beverage:

Finally I tested my snippets with:

gcc_dev/my_snippets$ LD_LIBRARY_PATH=/home/my_login/gcc_dev/usr/lib:/home/my_login/gcc_dev/usr/lib64
gcc_dev/my_snippets$ export LD_LIBRARY_PATH
gcc_dev/my_snippets$ ../usr/bin/gfortran -fcoarray=lib collective.f90 -lcaf_shmem

I should update the Fortran Wiki page with those info.

1 Like

For adventurers only, GFortran 16.1 has arrived in Fedora Rawhide (development distribution):

Next steps should be Fedora 44 Testing, then Stable.

It has just arrived in Fedora Linux 44:

$ gfortran --version
GNU Fortran (GCC) 16.1.1 20260501 (Red Hat 16.1.1-1)
Copyright © 2026 Free Software Foundation, Inc.
1 Like

Does gfortran 16 have an entirely new front-end? What kinds of problems should we watch for with new front end code?

The gfortran front end is an evolution of what has existed for many years. So you shouldn’t have to change anything. (Modulo bug fixes. One I know about is that Jerry D and I worked to get certain INQUIRE return values corrected.) The new front ends over the past couple of major releases are Algol 68 and COBOL.

2 Likes

DO CONCURRENT can speedup like openMP in gfortran 16.1?

I’ve had little success with GNU accelerating do concurrent, if you have good experiences please do tell

2 Likes

the solution was to do an out of source build…

1 Like

Indeed @jorgeg , that’s an advice that Jerry gave me, after my first attempts.

1 Like

Jerry is smart! thanks so much

2 Likes

That is definitely a prerequisite to be a GFortran developer :grin: . I guess he compiles GCC every day, so you can trust him.

1 Like

Another news about GCC (17 ?):

I don’t know if Fortran will be concerned, but if it is a back-end… LFortran has already a WebAssembly back-end.

1 Like

I did some comparative bench marking of gfortran and Intel ifx.
Here is the source code of the main program.

! include ‘precision_module.f90’
! include ‘integer_kind_module.f90’
! Included in the timing_module

include ‘timing_module.f90’

program ch3403

use precision_module
use timing_module

implicit none

real (dp) :: fortran_internal_pi
real (dp) :: partial_pi
real (dp) :: coarray_pi
real (dp) :: width
real (dp) :: total_sum
real (dp) :: x
real (dp), codimension [ * ] :: partial_sum

integer :: n_intervals
integer :: i
integer :: j
integer :: current_image
integer :: n_images

fortran_internal_pi = 4.0_dp*atan(1.0_dp)
n_images = num_images()
current_image = this_image()

if (current_image==1) then
print *, ’ Number of images = ', n_images
call start_timing()
end if

n_intervals = 100000

do j = 1, 5
width = 1.0_dp/real(n_intervals, dp)
total_sum = 0.0_dp
partial_sum = 0.0_dp
do i = current_image, n_intervals, n_images
x = (real(i,dp)-0.5_dp)width
partial_sum = partial_sum + f(x)
end do
partial_sum = partial_sumwidth
sync all
if (current_image==1) then
do i = 1, n_images
total_sum = total_sum + partial_sum[ i ]
end do
coarray_pi = total_sum
print 100, n_intervals, time_difference()
print 110, coarray_pi, abs(coarray_pi-fortran_internal_pi)
end if
n_intervals = n_intervals*10
sync all
end do

if (current_image==1) then
call end_timing()
end if

100 format (’ n intervals = ‘, i12, ’ time =’, f18.6)
110 format (’ pi = ', f20.16, /, ’ difference = ', f20.16)

contains

real (dp) function f(x)
implicit none
real (dp), intent (in) :: x

f = 4.0_dp/(1.0_dp+x*x)

end function

end program

Here are the timing details.

Intervals Average of 10 runs
gfortran 100,000 0.000408
gfortran 1,000,000 0.000907
gfortran 10,000,000 0.001538
gfortran 100,000,000 0.009646
gfortran 1,000,000,000 0.098619
gfortran Total 0.111455
Intel ifx 100,000 0.000275
Intel ifx 1,000,000 0.000289
Intel ifx 10,000,000 0.001027
Intel ifx 100,000,000 0.007884
Intel ifx 1,000,000,000 0.108436
Intel ifx Total 0.118361
gfortran 16.1.1 20260501
ifx 2026.0.0
Fedora Fedora Linux 44 Workstation edition
Redhat 16.1.1-1
Processor Intel I9 10980XE
hyper-v
memory 32 GB
cores 16

The source files are on our web sites.

There is a tar file of all the source files.

1 Like