root@ff-gfortran:~# cat > vect_test.f90
program test_vect
implicit none
integer, parameter :: n = 64*1024**2
integer :: i
integer(8) :: t1, t2, t0
real(8) :: tic
!
real, allocatable :: a32(:), b32(:)
real(8), allocatable :: a64(:), b64(:)
!
allocate( a32(n), a64(n))
allocate( b32(n), b64(n))
!
call random_number(a32 )
call random_number(a64 )
!
call system_clock(t0, tic)
!
do i = 1, n
b32(i) = sin(a32(i))
end do
!
call system_clock(t1)
print*, (t1-t0)/tic
!
do i = 1, n
b64(i) = sin(a64(i))
end do
!
call system_clock(t2)
print*, (t2-t1)/tic
!
end program test_vect
root@ff-gfortran:~# dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-=============-============-=================================
ii libc6:amd64 2.31-0ubuntu9 amd64 GNU C Library: Shared libraries
root@ff-gfortran:~# dpkg -l libc6 | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-=============-============-=================================
ii libc6:amd64 2.31-0ubuntu9 amd64 GNU C Library: Shared libraries
root@ff-gfortran:~# gfortran -O3 -mavx2 vect_test.f90 -o test.x
root@ff-gfortran:~# nm ./test.x | grep sin
U sin@@GLIBC_2.2.5
U sinf@@GLIBC_2.2.5
root@ff-gfortran:~# sed -i 's/backports/proposed/' /etc/apt/sources.list
root@ff-gfortran:~# apt update -qq
48 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@ff-gfortran:~# apt install -qq libc6 libc-bin locales
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
libc-dev-bin libc6-dev
Suggested packages:
glibc-doc
The following packages will be upgraded:
libc-bin libc-dev-bin libc6 libc6-dev locales
5 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.
Need to get 9807 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
(Reading database ... 35617 files and directories currently installed.)
Preparing to unpack .../libc6-dev_2.31-0ubuntu9.1_amd64.deb ...
Unpacking libc6-dev:amd64 (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Preparing to unpack .../libc-dev-bin_2.31-0ubuntu9.1_amd64.deb ...
Unpacking libc-dev-bin (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Preparing to unpack .../libc6_2.31-0ubuntu9.1_amd64.deb ...
Unpacking libc6:amd64 (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Setting up libc6:amd64 (2.31-0ubuntu9.1) ...
(Reading database ... 35616 files and directories currently installed.)
Preparing to unpack .../locales_2.31-0ubuntu9.1_all.deb ...
Unpacking locales (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Preparing to unpack .../libc-bin_2.31-0ubuntu9.1_amd64.deb ...
Unpacking libc-bin (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Setting up libc-bin (2.31-0ubuntu9.1) ...
Setting up locales (2.31-0ubuntu9.1) ...
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
Setting up libc-dev-bin (2.31-0ubuntu9.1) ...
Setting up libc6-dev:amd64 (2.31-0ubuntu9.1) ...
Processing triggers for man-db (2.9.1-1) ...
root@ff-gfortran:~# gfortran -O3 -mavx2 vect_test.f90 -o test.x
root@ff-gfortran:~# nm ./test.x | grep sin
U _ZGVdN4v_sin@@GLIBC_2.22
U _ZGVdN8v_sinf@@GLIBC_2.22
root@ff-gfortran:~#
Tested 2.31-0ubuntu9.1 on Focal:
root@ff-gfortran:~# cat > vect_test.f90 Unknown/ Install/ Remove/ Purge/Hold Not/Inst/ Conf-files/ Unpacked/ halF-conf/ Half-inst/ trig-aWait/ Trig-pend /Reinst- required (Status,Err: uppercase=bad) ======= ====-== ======= ====-== ======= ===-=== ======= ======= ======= ======= == Unknown/ Install/ Remove/ Purge/Hold Not/Inst/ Conf-files/ Unpacked/ halF-conf/ Half-inst/ trig-aWait/ Trig-pend /Reinst- required (Status,Err: uppercase=bad) ======= ====-== ======= ====-== ======= ===-=== ======= ======= ======= ======= == proposed/ ' /etc/apt/ sources. list dev_2.31- 0ubuntu9. 1_amd64. deb ... dev-bin_ 2.31-0ubuntu9. 1_amd64. deb ... 2.31-0ubuntu9. 1_amd64. deb ... 2.31-0ubuntu9. 1_all.deb ... bin_2.31- 0ubuntu9. 1_amd64. deb ... sin@@GLIBC_ 2.22 sinf@@GLIBC_ 2.22
program test_vect
implicit none
integer, parameter :: n = 64*1024**2
integer :: i
integer(8) :: t1, t2, t0
real(8) :: tic
!
real, allocatable :: a32(:), b32(:)
real(8), allocatable :: a64(:), b64(:)
!
allocate( a32(n), a64(n))
allocate( b32(n), b64(n))
!
call random_number(a32 )
call random_number(a64 )
!
call system_clock(t0, tic)
!
do i = 1, n
b32(i) = sin(a32(i))
end do
!
call system_clock(t1)
print*, (t1-t0)/tic
!
do i = 1, n
b64(i) = sin(a64(i))
end do
!
call system_clock(t2)
print*, (t2-t1)/tic
!
end program test_vect
root@ff-gfortran:~# dpkg -l libc6
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii libc6:amd64 2.31-0ubuntu9 amd64 GNU C Library: Shared libraries
root@ff-gfortran:~# dpkg -l libc6 | cat
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii libc6:amd64 2.31-0ubuntu9 amd64 GNU C Library: Shared libraries
root@ff-gfortran:~# gfortran -O3 -mavx2 vect_test.f90 -o test.x
root@ff-gfortran:~# nm ./test.x | grep sin
U sin@@GLIBC_2.2.5
U sinf@@GLIBC_2.2.5
root@ff-gfortran:~# sed -i 's/backports/
root@ff-gfortran:~# apt update -qq
48 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@ff-gfortran:~# apt install -qq libc6 libc-bin locales
The following package was automatically installed and is no longer required:
libfreetype6
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
libc-dev-bin libc6-dev
Suggested packages:
glibc-doc
The following packages will be upgraded:
libc-bin libc-dev-bin libc6 libc6-dev locales
5 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.
Need to get 9807 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
(Reading database ... 35617 files and directories currently installed.)
Preparing to unpack .../libc6-
Unpacking libc6-dev:amd64 (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Preparing to unpack .../libc-
Unpacking libc-dev-bin (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Preparing to unpack .../libc6_
Unpacking libc6:amd64 (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Setting up libc6:amd64 (2.31-0ubuntu9.1) ...
(Reading database ... 35616 files and directories currently installed.)
Preparing to unpack .../locales_
Unpacking locales (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Preparing to unpack .../libc-
Unpacking libc-bin (2.31-0ubuntu9.1) over (2.31-0ubuntu9) ...
Setting up libc-bin (2.31-0ubuntu9.1) ...
Setting up locales (2.31-0ubuntu9.1) ...
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
Setting up libc-dev-bin (2.31-0ubuntu9.1) ...
Setting up libc6-dev:amd64 (2.31-0ubuntu9.1) ...
Processing triggers for man-db (2.9.1-1) ...
root@ff-gfortran:~# gfortran -O3 -mavx2 vect_test.f90 -o test.x
root@ff-gfortran:~# nm ./test.x | grep sin
U _ZGVdN4v_
U _ZGVdN8v_
root@ff-gfortran:~#