[SciPy-user] making an existing scipy installation use atlas?libraries

David Cournapeau david@ar.media.kyoto-u.ac...
Mon Oct 8 22:52:35 CDT 2007


Lev Givon wrote:
> Received from Eike Welk on Mon, Oct 08, 2007 at 01:07:25PM EDT:
>   
>> On Monday 08 October 2007 17:00, Lev Givon wrote:
>>     
>>> Received from Robert Kern on Sun, Oct 07, 2007 at 03:29:42PM EDT:
>>>       
>>>> Lev Givon wrote:
>>>>         
>>>>> The scipy installation instructions for Linux relating to atlas
>>>>> (http://tinyurl.com/2kuwcy) appear to imply that one can force
>>>>> an existing scipy installation that was built against netlib
>>>>> blas and lapack to take advantage of subsequently installed
>>>>> atlas libraries by directing the library loader to point to the
>>>>> atlas-provided libblas.so and liblapack.so libraries rather
>>>>> than their netlib equivalents. Does this approach provide
>>>>> inferior performance compared to building numpy/scipy directly
>>>>> against atlas (i.e., such that the atlas objects are built into
>>>>> the cblas/clapack modules)?
>>>>>           
>>>> ATLAS has a few other libraries that are needed besides its
>>>> libblas.so and liblapack.so.  You would essentially have to
>>>> relink the extension modules, not just change LD_LIBRARY_PATH.
>>>>         
>>> True, but isn't it sufficient that those libraries (e.g.,
>>> libatlas.so) are already linked to by the atlas-provided libblas.so
>>> and liblapack.so libraries? After all, aren't the BLAS/LAPACK
>>> functions the only public interfaces to the atlas stuff that are
>>> accessed by programs/libraries that use them? Or do some of the
>>> extension modules you mentioned actually access other
>>> atlas-specific routines when built against atlas?
>>>       
>>  
>> You could ask David Cournapeau. He has created an Atlas package for 
>> Suse Linux, that works the way you propose: Select Atlas by putting 
>> the directory, where it is stored, into LD_LIBRARY_PATH.
>>
>> See 'ashigabou repository' at:
>> http://www.scipy.org/Installing_SciPy/Linux
>>     
>
> That snippet on the above page is actually what prompted my curiosity
> regarding this whole topic :-)
>
> The Fedora folks, incidentally, have also concocted an rpm package
> that facilitates building and installing atlas in a manner germane to
> the above approach to making an existing dynamically linked
> blas/lapack-dependent program/library use atlas.
>   
If you want to do it by yourself when compiling atlas, the relevant 
lines in the makefile are:

(for lapack, in ATLAS/makes/Make.lib)
liblapack.so.$(LAPACK_MAJOR) : liblapack.a libcblas.a
     ld $(LDFLAGS) -shared -soname $@ -o $@ --whole-archive \
     liblapack.a libcblas.a --no-whole-archive $(F77SYSLIB)

(for blas, same makefile)
libblas.so.$(BLAS_MAJOR) : libf77blas.a libcblas.a
    ld $(LDFLAGS) -shared -soname $@ -o $@ --whole-archive libcblas.a 
libf77blas.a libatlas.a \
    --no-whole-archive $(F77SYSLIB)

As you can see, this is rather trivial: just give the --whole-archive 
argument before the archives you want to include (this requires of 
course that all object code in the archives are built with -fPIC).

cheers,

David



More information about the SciPy-user mailing list