ListArc » English » Computer and Internet » R-SIG-Mac » Problems+with+single+precision+routines+in+64+bit+vecLib+BLAS


22-06-2010 12:51 PM

Hello group,

It appears there are some broken 64-bit single precision routines in the
BLAS shipped with Apple's Accelerate Framework. Of course, it appears R
doesn't use any single precision routines, but I haven't seen this described
in R-devel or r-sig-mac so I figured I would report it in case it ever
becomes an issue.

The problem is that complex single and double precision BLAS routines will
throw a segfault if they are linked from the Accelerate framework in a way
that is not compliant with the old g77 style. With gfortran, this is done
with the -ff2c switch. However, if x86_64 binaries are being produced, the
-ff2c switch causes some single precision real and complex routines to
give erroneous results.

For example, if the level 1 BLAS test routines sblat1 and cblat1 are
downloaded from Netlib as sblat1.f and cblat1.f:

The following command:

gfortran -arch x86_64 -ff2c -o sblat1
sblat1.f -L/Library/Frameworks/R.framework/Resources/lib -lRblas

Will produce a test program, sblat1, that shows failures for the following
level 1 single precision real routines:



gfortran -arch x86_64 -ff2c -o cblat1
cblat1.f -L/Library/Frameworks/R.framework/Resources/lib -lRblas

Will show failures for the following level 1 single precision complex


The failures only appear if 64 bit routines are used.


[[alternative HTML version deleted]]


Posted on the R-SIG-Mac mailing list. Go to to subscribe.