Skip to content

Commit

Permalink
Enabled scipy.lib.{blas,lapack} packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
pearu committed Oct 30, 2005
1 parent 5c0fec7 commit 00d6812
Show file tree
Hide file tree
Showing 17 changed files with 211 additions and 246 deletions.
10 changes: 6 additions & 4 deletions Lib/lib/__init__.py
@@ -1,8 +1,10 @@

from info_lib import __doc__
from info import __doc__
__all__ = ['lapack','blas']

#from scipy.utils import ppimport
#lapack = ppimport('lapack')
#blas = ppimport('blas')

from scipy.base import ppimport
lapack = ppimport('lapack')
blas = ppimport('blas')
import blas
import lapack
4 changes: 2 additions & 2 deletions Lib/lib/blas/__init__.py
Expand Up @@ -2,7 +2,7 @@
# BLAS wrappers
#

from info_blas import __doc__
from info import __doc__

__all__ = ['fblas','cblas','get_blas_funcs']

Expand All @@ -25,7 +25,7 @@ def get_blas_funcs(names,arrays=(),debug=0):
BLAS routines."""
ordering = []
for i in range(len(arrays)):
t = arrays[i].typecode()
t = arrays[i].dtypechar
if not _type_conv.has_key(t): t = 'd'
ordering.append((t,i))
if ordering:
Expand Down
File renamed without changes.
53 changes: 20 additions & 33 deletions Lib/lib/blas/setup_blas.py → Lib/lib/blas/setup.py
Expand Up @@ -32,18 +32,11 @@
end python module cblas
'''

def configuration(parent_package='',parent_path=None):
from scipy.distutils.core import Extension
from scipy.distutils.misc_util import dot_join, get_path, default_config_dict
from scipy.distutils.system_info import get_info, dict_append

package = 'blas'
config = default_config_dict(package,parent_package)
local_path = get_path(__name__,parent_path)
def local_join(*paths):
return os.path.join(*((local_path,)+paths))
def local_glob(path):
return glob(os.path.join(local_path,path))
def configuration(parent_package='',top_path=None):
from scipy.distutils.misc_util import Configuration
from scipy.distutils.system_info import get_info

config = Configuration('blas',parent_package,top_path)

blas_opt = get_info('blas_opt',notfound_action=2)

Expand All @@ -70,16 +63,12 @@ def local_glob(path):
'drotmg srotmg drotm srotm'.split())

# fblas:
ext_args = {}
dict_append(ext_args,
name = dot_join(parent_package,package,'fblas'),
sources = [local_join('fblas.pyf.src'),
local_join('fblaswrap.f.src')],
depends = [__file__]+local_glob('fblas_l?.pyf.src'),
f2py_options = ['skip:']+skip_names['fblas']+[':'])
dict_append(ext_args,**blas_opt)
ext = Extension(**ext_args)
config['ext_modules'].append(ext)
config.add_extension('fblas',
sources = ['fblas.pyf.src','fblaswrap.f.src'],
depends = [__file__,'fblas_l?.pyf.src'],
f2py_options = ['skip:']+skip_names['fblas']+[':'],
extra_info = blas_opt
)

# cblas:
def get_cblas_source(ext, build_dir):
Expand All @@ -97,19 +86,17 @@ def get_cblas_source(ext, build_dir):
assert os.path.basename(target)=='cblas.pyf.src'
return target

ext_args = {}
dict_append(ext_args,
name = dot_join(parent_package,package,'cblas'),
sources = [get_cblas_source],
depends = [local_join('cblas.pyf.src')] \
+ local_glob('cblas_l?.pyf.src'),
f2py_options = ['skip:']+skip_names['cblas']+[':'])
dict_append(ext_args,**blas_opt)
ext = Extension(**ext_args)
config['ext_modules'].append(ext)
config.add_extension('cblas',
sources = [get_cblas_source],
depends = ['cblas.pyf.src','cblas_l?.pyf.src'],
f2py_options = ['skip:']+skip_names['cblas']+[':'],
extra_info = blas_opt
)

config.add_data_dir('tests')

return config

if __name__ == '__main__':
from scipy.distutils.core import setup
setup(**configuration(parent_path=''))
setup(**configuration(top_path='').todict())
4 changes: 2 additions & 2 deletions Lib/lib/blas/tests/test_blas.py
Expand Up @@ -13,11 +13,11 @@
"""


from Numeric import arange, add, array
from scipy.base import arange, add, array
import math

import sys
from scipy_test.testing import *
from scipy.test.testing import *
set_package_path()
from blas import fblas
from blas import cblas
Expand Down

0 comments on commit 00d6812

Please sign in to comment.