Skip to content
Prev 17145 / 63424 Next

gfortran and BLAS on AMD64 Linux

Linux users are used to all compilers using the same linkage conventions 
(those of pcc) whereas users of other platforms are used to the idea that 
code from different compilers cannot in general be mixed.

This is no longer true for gfortran on AMD64.  Given a double complex 
function like

       double complex function zdotc(n,zx,incx,zy,incy)

gfortran returns the result in a 128-bit XMM SSE register, whereas g77 
(and gcc using Rcomplex) would return the result in memory.

The result is that a BLAS compiled with g77 or gcc is not compatible with 
R compiled with gfortran and attempts to use the combination results in 
memory corruption.

We have already seen 3 instances of this

- the libblas that ships with FC3 is (AFAIK) compiled with g77
- ATLAS built with g77.
- Dr Goto's tuned BLAS.

It may be possible to devise a configure test for 2.2.0, but meanwhile be 
aware of the problem.