Just to keep the thread alive.
The problem is still there (using flexiblas
shim library to allow run-time switching between BLAS libraries):
% xcodebuild -version
Xcode 16.2
Build version 16C5032a
% cat t2.f90
program sblas
! test some single-precision blas results.
implicit none
real :: x(2)=[3.,4.], y(2)=[1.,1.]
complex :: w(2)=[(4.,3.),(3.,4.)], z(2)=[(5.,6.),(7.,8.)]
real, external :: sdot, sdsdot, snrm2, scnrm2, sasum, scasum
complex, external :: cdotu, cdotc
character(*), parameter :: cfmt='(*(g0.4,1x))'
write(*,cfmt) 'sdot=', sdot(2,x,1,y,1), 'should be 7.000'
write(*,cfmt) 'sdsdot=', sdsdot(2,0.0,x,1,y,1), 'should be 7.000'
write(*,cfmt) 'snrm2=', snrm2(2,x,1), 'should be 5.000'
write(*,cfmt) 'scnrm2=', scnrm2(2,w,1), 'should be 7.071'
write(*,cfmt) 'sasum=', sasum(2,x,1), 'should be 7.000'
write(*,cfmt) 'scasum=', scasum(2,w,1), 'should be 14.00'
write(*,cfmt) 'cdotu=', cdotu(2,w,1,z,1), 'should be -9.000 91.00'
write(*,cfmt) 'cdotc=', cdotc(2,w,1,z,1), 'should be 91.00 5.000'
end program sblas
% gfortran t2.f90 -lflexiblas -L/opt/homebrew/lib
% flexiblas list
System-wide:
System-wide (config directory):
APPLE
library = libflexiblas_apple.dylib
comment =
NETLIB
library = libflexiblas_netlib.dylib
comment =
OPENBLASOPENMP
library = libflexiblas_openblasopenmp.dylib
...
% FLEXIBLAS=NETLIB ./a.out
sdot= 7.000 should be 7.000
sdsdot= 7.000 should be 7.000
snrm2= 5.000 should be 5.000
scnrm2= 7.071 should be 7.071
sasum= 7.000 should be 7.000
scasum= 14.00 should be 14.00
cdotu= -9.000 91.00 should be -9.000 91.00
cdotc= 91.00 5.000 should be 91.00 5.000
% FLEXIBLAS=OPENBLASOPENMP ./a.out
sdot= 7.000 should be 7.000
sdsdot= 7.000 should be 7.000
snrm2= 5.000 should be 5.000
scnrm2= 7.071 should be 7.071
sasum= 7.000 should be 7.000
scasum= 14.00 should be 14.00
cdotu= -9.000 91.00 should be -9.000 91.00
cdotc= 91.00 5.000 should be 91.00 5.000
% FLEXIBLAS=APPLE ./a.out
sdot= 0.000 should be 7.000
sdsdot= 0.000 should be 7.000
snrm2= 0.000 should be 5.000
scnrm2= 0.000 should be 7.071
sasum= 0.000 should be 7.000
scasum= 0.000 should be 14.00
cdotu= -9.000 91.00 should be -9.000 91.00
cdotc= 91.00 5.000 should be 91.00 5.000