Dag Sverre Seljebotn <da...@...> writes:
> >>>>> Hi,
> >>>>> I'm trying to run testlapack example from cython-notur09 on OS X 10.6.
> >>>>> First, while compiling I faced with following error
> >>>>> gcc -L/sw64/lib -bundle -L/sw64/lib/python2.6/config -lpython2.6
> >>>>> build/temp.macosx-10.4-i386-2.6/lapack.o
> >>>>> -L/Applications/development/sage//local/lib -llapack -lf77blas -lcblas
> >>>>> -latlas -o lapack.so -g
> >>>>> Undefined symbols:
> >>>>> "_clapack_dgesv", referenced from:
> >>>>> _dgesv in lapack.o
> >>>>> _dsolve in lapack.o
> >>>>> ld: symbol(s) not found
> >>>>> So I changed clapack_dgesw in lapack.pxd to dgesw and successfully
> >>>>> build it against SAGE (sage-4.2.1-OSX10.6-Intel-64bit-i386-Darwin.dmg)
> >>>>> but when I run testlapack.test() python froze, using 100% of CPU,
> >>>>> below is debuging info.
> >>> In [3]: numpy.show_config()
> >>> lapack_opt_info:
> >>> extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
> >>> extra_compile_args = ['-msse3']
> >>> define_macros = [('NO_ATLAS_INFO', 3)]
> >>>
> >>> blas_opt_info:
> >>> extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
> >>> extra_compile_args = ['-msse3',
> >>> '-I/System/Library/Frameworks/vecLib.framework/Headers']
> >>> define_macros = [('NO_ATLAS_INFO', 3)]
> > Here it is
> > In [2]: scipy.show_config()
> > amd_info:
> > libraries = ['amd']
> > library_dirs = ['/sw64/lib']
> >
> > umfpack_info:
> > libraries = ['umfpack', 'amd']
> > library_dirs = ['/sw64/lib']
> >
> > lapack_opt_info:
> > extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
> > extra_compile_args = ['-msse3']
> > define_macros = [('NO_ATLAS_INFO', 3)]
> >
> > blas_opt_info:
> > extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
> > extra_compile_args = ['-msse3',
> > '-I/System/Library/Frameworks/vecLib.framework/Headers']
> > define_macros = [('NO_ATLAS_INFO', 3)]
> >
> Have you tried dropping libraries=.... from setup.py? You should really
> build your extension the way SciPy has been built, meaning modifying
> setup.py so that gcc is invoked in the way described by blas_opt_info above.
>
> Dag Sverre
>
Finally I used following setup.py
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os
import numpy as np
ext_modules=[
Extension("lapack",
["lapack.pyx"],
libraries=['lapack', 'cblas'],
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate'],
extra_compile_args =
['-faltivec','-I/System/Library/Frameworks/vecLib.framework/Headers'],
define_macros = [('NO_ATLAS_INFO', 3)],
include_dirs=[np.get_include()]),
Extension("testlapack",
["testlapack.pyx"],
include_dirs=[np.get_include()]),
]
setup(
name = 'LAPACK wrapping demo',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules,
)
I build it using /usr/bin/python, lapack.so and testlapack.so are used following
libs, but it still don't work.
otool -L lapack.so
lapack.so:
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/
vecLib.framework/Versions/A/libLAPACK.dylib (compatibility version
1.0.0,
current version 219.0.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/
vecLib.framework/Versions/A/libBLAS.dylib (compatibility version 1.0.0,
current version 219.0.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
(compatibility version 1.0.0, current version 4.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0,
current version 246.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0,
current version 125.0.0)
otool -L testlapack.so
testlapack.so:
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0,
current version 246.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, c
urrent version 125.0.0)
But it still doesn't work (
Max
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev