[SciPy-user] Checking vecLib usage for SciPy (OS X)

Arnd Baecker arnd.baecker at web.de
Thu Dec 8 02:07:05 EST 2005


On Wed, 7 Dec 2005, David M. Cooke wrote:

> On Wed, Dec 07, 2005 at 04:07:30PM -0800, Joshua L. Adelman wrote:
> > I was wondering if there was a simple way to tell if an installation
> > of SciPy on OS X properly used the optimized vecLib libraries for
> > ATLAS BLAS and LAPACK or if it was linked against the default
> > libraries (that would not result in optimal performance).
> >
> > Thanks in advance for any help that you can provide.
>
> You could use otool -L against the .so files to see what frameworks
> they're linked with.
>
> On my Mac, they are being linked properly (to the Accelerate framework,
> which contains the vecLib libraries).


Another command which I find very helpful (pointed out to me by Pearu,
if I remember correctly) is
  import scipy
  scipy.__core_config__.show()
and for the full scipy
  scipy.__scipy_config__.show()

(for the old scipy one could try
`import scipy.config;scipy.config.show()`)

Actually, it might be useful to have some
   scpipy.__core_config.show_used_libraries()
(etc.) command, which reveals, which libraries are really used
in the end.

For fft  I used something like this:

####################################################
import scipy
import os
import subprocess

dir=os.path.split(scipy.__file__)[0]
lib=dir+"/fftpack/_fftpack.so"

# firr shared linking (most obvious one, I think ...)
print "ldd:"
o=subprocess.call("/usr/bin/ldd %s "  % (lib),shell=True   )

# If the result is not empty for the following commands, fftw
# has been linked into _fftpack.so
print "search for fftw:"
o=subprocess.call("nm %s | grep fftw" % (lib),shell=True    )
# If the following is not empty, fftw2 is used
# (this symbol only exists for fftw2 and not fftw3)
print "fftw2?         :"
o=subprocess.call("nm %s | grep create" % (lib),shell=True)
############################################################

I am sure this can be made nicer (and more automatic and generalized
to other platforms/situations), but maybe it is still useful.

Best, Arnd








More information about the SciPy-User mailing list