patch: Fixes for ATLAS build

Jules Bergmann jules at codesourcery.com
Thu Dec 1 15:28:57 UTC 2005


This patch fixes some errata with the ATLAS patch.

First, the conventions for calling Fortran functions compiled by g77 
from C appear to change when going from i386 to x86-64.  In particular, 
a Fortran function returning a float looks like a C function returning a 
float for i386, but looks like a C function returning a double on 
x86-64.  This situation is made more complex by MKL, which has real 
functions that look like C functions returning a float.

The right thing to do here is to avoid calling Fortran functions 
altogether (Fortran subroutines are OK).  Fortunately, the only Fortran 
functions we call are in BLAS, which has a C API (CBLAS).  This patch 
adds support to use CBLAS if present.  This can be disabled with the 
--disable-cblas option.

This patch also lets the path to libg2c.a be specified as a configure 
option.  This is useful on machines like Sethra where libg2c.a is in a 
directory with old libstdc++ libraries, making it impossible to add the 
directory as a -L option to LDFLAGS before calling configure.

For an example of using this option, the following configure line should 
work on Sethra to configure the library to use the internal ATLAS:

configure --with-lapack=builtin \
	--with-g2c-path=/usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3

The following configure line should do the same on Sparrowhawk:

configure --with-lapack=builtin \
	--with-g2c-path=/usr/lib/gcc/x86_64-redhat-linux/3.4.3


Finally, this patch changes the behavior of the --with-mkl-prefix=PATH 
configure option slightly.  Previously, PATH was the directory 
containing the MKL libraries (i.e. /opt/mkl721/lib/em64t on Sethra). 
Now, PATH should be the top-level MKL directory (/opt/mkl721). 
Configure attempts to determine the subdirectory of lib based on the 
host_cpu type, and can be given a hint with the --with-mkl-arch=ARCH option.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: atlas2.diff
URL: <http://sourcerytools.com/pipermail/vsipl++/attachments/20051201/d500dddd/attachment.ksh>


More information about the vsipl++ mailing list