[fortran,patch] BLAS-enabled matmul

Daniel Jacobowitz drow@false.org
Mon Apr 3 22:30:00 GMT 2006

On Mon, Apr 03, 2006 at 11:53:24PM +0200, FX Coudert wrote:
> On the front-end side: we look for the new options -fexternal-blas and 
> -fblas-matmul-limit. If the second one is used for compilation of the 
> main program, a call to set the library 
> compile_options.blas_matmul_limit value accordingly. As for the first one:
> 1. if it's not specified, the driver adds "-lgfortran_blas -lgfortran" 
> to the options, making the full final libraries order "-lgfortranbegin 
> -lgfortran -lgfortran_blas -lgfortran -lm"; this is needed because 
> libgfortran_blas references a symbol from libgfortran, namely 
> libgfortran_called_blas (see above about this one)
> 2. if -fexternal-blas is specified, its argument is added instead of 
> -lgfortran_blas, but everything else from point 1 is still valid; 
> append_blas() breaks the space-separated words in
> -fexternal-blas argument before appending them to the arguments. As for 
> the order of linking, -lgfortran still needs to be added after the 
> external blas library, because if the external library was compiled with 
> gfortran, it might have some libgfortran symbols referred in it :)

This is pretty nasty.  If I were designing a command line interface for
this, it would just be "-fexternal-blas disables inclusion of the
default libgfortran_blas.a".  Can't we get that to work?  Maybe with
--start-group and --end-group?

Daniel Jacobowitz

More information about the Gcc-patches mailing list