예제 #1
0
파일: setup.py 프로젝트: Juanlu001/scipy
def configuration(parent_package='',top_path=None):
    from numpy.distutils.system_info import get_info, NotFoundError
    from numpy.distutils.misc_util import Configuration
    from scipy._build_utils import get_g77_abi_wrappers, get_sgemv_fix

    lapack_opt = get_info('lapack_opt')

    if not lapack_opt:
        raise NotFoundError('no lapack/blas resources found')

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

    arpack_sources = [join('ARPACK','SRC', '*.f')]
    arpack_sources.extend([join('ARPACK','UTIL', '*.f')])

    arpack_sources += get_g77_abi_wrappers(lapack_opt)

    config.add_library('arpack_scipy', sources=arpack_sources,
                       include_dirs=[join('ARPACK', 'SRC')])

    ext_sources = ['arpack.pyf.src']
    ext_sources += get_sgemv_fix(lapack_opt)
    config.add_extension('_arpack',
                         sources=ext_sources,
                         libraries=['arpack_scipy'],
                         extra_info=lapack_opt,
                         depends=arpack_sources,
                         )

    config.add_data_dir('tests')

    # Add license files
    config.add_data_files('ARPACK/COPYING')

    return config
예제 #2
0
파일: setup.py 프로젝트: BranYang/scipy
def configuration(parent_package='',top_path=None):
    from scipy._build_utils.system_info import get_info, NotFoundError
    from numpy.distutils.misc_util import Configuration
    from scipy._build_utils import get_g77_abi_wrappers

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

    lapack_opt = get_info('lapack_opt')

    # iterative methods
    methods = ['BiCGREVCOM.f.src',
               'BiCGSTABREVCOM.f.src',
               'CGREVCOM.f.src',
               'CGSREVCOM.f.src',
#               'ChebyREVCOM.f.src',
               'GMRESREVCOM.f.src',
#               'JacobiREVCOM.f.src',
               'QMRREVCOM.f.src',
#               'SORREVCOM.f.src'
               ]

    Util = ['getbreak.f.src']
    sources = Util + methods + ['_iterative.pyf.src']
    sources = [join('iterative', x) for x in sources]
    sources += get_g77_abi_wrappers(lapack_opt)

    config.add_extension('_iterative',
                         sources=sources,
                         extra_info=lapack_opt)

    config.add_data_dir('tests')

    return config
예제 #3
0
파일: setup.py 프로젝트: hitej/meta-core
def configuration(parent_package="", top_path=None):
    from numpy.distutils.misc_util import Configuration
    from numpy.distutils.system_info import get_info
    from scipy._build_utils import get_g77_abi_wrappers

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

    lapack_opt = get_info("lapack_opt", notfound_action=2)

    atlas_version = ([v[3:-3] for k, v in lapack_opt.get("define_macros", []) if k == "ATLAS_INFO"] + [None])[0]
    if atlas_version:
        print(("ATLAS version: %s" % atlas_version))

    target_dir = ""

    depends = [__file__, "fblas_l?.pyf.src", "fblas.pyf.src"]

    # fblas:
    sources = ["fblas.pyf.src"]
    sources += get_g77_abi_wrappers(lapack_opt)
    config.add_extension("fblas", sources=sources, depends=depends, extra_info=lapack_opt)

    # cblas:
    def get_cblas_source(ext, build_dir):
        name = ext.name.split(".")[-1]
        assert name == "cblas", repr(name)
        if atlas_version is None:
            target = join(build_dir, target_dir, "cblas.pyf")
            from distutils.dep_util import newer

            if newer(__file__, target):
                f = open(target, "w")
                f.write(tmpl_empty_cblas_pyf)
                f.close()
        else:
            target = ext.depends[0]
            assert os.path.basename(target) == "cblas.pyf.src"
        return target

    config.add_extension(
        "cblas", sources=[get_cblas_source], depends=["cblas.pyf.src", "cblas_l?.pyf.src"], extra_info=lapack_opt
    )

    config.add_data_dir("tests")

    return config
예제 #4
0
def configuration(parent_package='',top_path=None):
    from numpy.distutils.system_info import get_info, NotFoundError
    from numpy.distutils.misc_util import Configuration
    from scipy._build_utils import get_g77_abi_wrappers, split_fortran_files

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

    lapack_opt = get_info('lapack_opt')

    if not lapack_opt:
        raise NotFoundError('no lapack/blas resources found')

    atlas_version = ([v[3:-3] for k,v in lapack_opt.get('define_macros',[])
                      if k == 'ATLAS_INFO']+[None])[0]
    if atlas_version:
        print(('ATLAS version: %s' % atlas_version))

    # fblas:
    sources = ['fblas.pyf.src']
    sources += get_g77_abi_wrappers(lapack_opt)

    config.add_extension('_fblas',
                         sources=sources,
                         depends=['fblas_l?.pyf.src'],
                         extra_info=lapack_opt
                         )

    # flapack:
    sources = ['flapack.pyf.src']
    sources += get_g77_abi_wrappers(lapack_opt)

    config.add_extension('_flapack',
                         sources=sources,
                         depends=['flapack_user.pyf.src'],
                         extra_info=lapack_opt
                         )

    if atlas_version is not None:
        # cblas:
        config.add_extension('_cblas',
                             sources=['cblas.pyf.src'],
                             depends=['cblas.pyf.src', 'cblas_l1.pyf.src'],
                             extra_info=lapack_opt
                             )

        # clapack:
        config.add_extension('_clapack',
                             sources=['clapack.pyf.src'],
                             depends=['clapack.pyf.src'],
                             extra_info=lapack_opt
                             )

    # _flinalg:
    config.add_extension('_flinalg',
                         sources=[join('src','det.f'),join('src','lu.f')],
                         extra_info=lapack_opt
                         )

    # calc_lwork:
    config.add_extension('calc_lwork',
                         [join('src','calc_lwork.f')],
                         extra_info=lapack_opt
                         )

    # _interpolative:
    routines_to_split = [
        'dfftb1',
        'dfftf1',
        'dffti1',
        'dsint1',
        'dzfft1',
        'id_srand',
        'idd_copyints',
        'idd_id2svd0',
        'idd_pairsamps',
        'idd_permute',
        'idd_permuter',
        'idd_random_transf0',
        'idd_random_transf0_inv',
        'idd_random_transf_init0',
        'idd_subselect',
        'iddp_asvd0',
        'iddp_rsvd0',
        'iddr_asvd0',
        'iddr_rsvd0',
        'idz_estrank0',
        'idz_id2svd0',
        'idz_permute',
        'idz_permuter',
        'idz_random_transf0_inv',
        'idz_random_transf_init0',
        'idz_random_transf_init00',
        'idz_realcomp',
        'idz_realcomplex',
        'idz_reco',
        'idz_subselect',
        'idzp_aid0',
        'idzp_aid1',
        'idzp_asvd0',
        'idzp_rsvd0',
        'idzr_asvd0',
        'idzr_reco',
        'idzr_rsvd0',
        'zfftb1',
        'zfftf1',
        'zffti1',
    ]
    print('Splitting linalg.interpolative Fortran source files')
    fnames = split_fortran_files(join(os.path.split(
                                          os.path.abspath(__file__))[0],
                                      'src', 'id_dist', 'src'),
                                 routines_to_split)
    fnames = [join('src', 'id_dist', 'src', f) for f in fnames]
    config.add_extension('_interpolative', fnames + ["interpolative.pyf"],
                         extra_info = lapack_opt
                         )

    config.add_data_dir('tests')
    config.add_data_dir('benchmarks')
    return config
예제 #5
0
파일: setup.py 프로젝트: 1641731459/scipy
def configuration(parent_package='', top_path=None):
    from distutils.sysconfig import get_python_inc
    from numpy.distutils.system_info import get_info, NotFoundError, numpy_info
    from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
    from scipy._build_utils import (get_sgemv_fix, get_g77_abi_wrappers,
                                    split_fortran_files)

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

    lapack_opt = get_info('lapack_opt')

    if not lapack_opt:
        raise NotFoundError('no lapack/blas resources found')

    atlas_version = ([v[3:-3] for k, v in lapack_opt.get('define_macros', [])
                      if k == 'ATLAS_INFO']+[None])[0]
    if atlas_version:
        print(('ATLAS version: %s' % atlas_version))

    # fblas:
    sources = ['fblas.pyf.src']
    sources += get_g77_abi_wrappers(lapack_opt)
    sources += get_sgemv_fix(lapack_opt)

    config.add_extension('_fblas',
                         sources=sources,
                         depends=['fblas_l?.pyf.src'],
                         extra_info=lapack_opt
                         )

    # flapack:
    sources = ['flapack.pyf.src']
    sources += get_g77_abi_wrappers(lapack_opt)
    dep_pfx = join('src', 'lapack_deprecations')
    deprecated_lapack_routines = [join(dep_pfx, c + 'gegv.f') for c in 'cdsz']
    sources += deprecated_lapack_routines

    config.add_extension('_flapack',
                         sources=sources,
                         depends=['flapack_user.pyf.src'],
                         extra_info=lapack_opt
                         )

    if atlas_version is not None:
        # cblas:
        config.add_extension('_cblas',
                             sources=['cblas.pyf.src'],
                             depends=['cblas.pyf.src', 'cblas_l1.pyf.src'],
                             extra_info=lapack_opt
                             )

        # clapack:
        config.add_extension('_clapack',
                             sources=['clapack.pyf.src'],
                             depends=['clapack.pyf.src'],
                             extra_info=lapack_opt
                             )

    # _flinalg:
    config.add_extension('_flinalg',
                         sources=[join('src', 'det.f'), join('src', 'lu.f')],
                         extra_info=lapack_opt
                         )

    # _interpolative:
    routines_to_split = [
        'dfftb1',
        'dfftf1',
        'dffti1',
        'dsint1',
        'dzfft1',
        'id_srand',
        'idd_copyints',
        'idd_id2svd0',
        'idd_pairsamps',
        'idd_permute',
        'idd_permuter',
        'idd_random_transf0',
        'idd_random_transf0_inv',
        'idd_random_transf_init0',
        'idd_subselect',
        'iddp_asvd0',
        'iddp_rsvd0',
        'iddr_asvd0',
        'iddr_rsvd0',
        'idz_estrank0',
        'idz_id2svd0',
        'idz_permute',
        'idz_permuter',
        'idz_random_transf0_inv',
        'idz_random_transf_init0',
        'idz_random_transf_init00',
        'idz_realcomp',
        'idz_realcomplex',
        'idz_reco',
        'idz_subselect',
        'idzp_aid0',
        'idzp_aid1',
        'idzp_asvd0',
        'idzp_rsvd0',
        'idzr_asvd0',
        'idzr_reco',
        'idzr_rsvd0',
        'zfftb1',
        'zfftf1',
        'zffti1',
    ]
    print('Splitting linalg.interpolative Fortran source files')
    dirname = os.path.split(os.path.abspath(__file__))[0]
    fnames = split_fortran_files(join(dirname, 'src', 'id_dist', 'src'),
                                 routines_to_split)
    fnames = [join('src', 'id_dist', 'src', f) for f in fnames]
    config.add_extension('_interpolative', fnames + ["interpolative.pyf"],
                         extra_info=lapack_opt
                         )

    # _calc_lwork:
    config.add_extension('_calc_lwork',
                         [join('src', 'calc_lwork.f')],
                         extra_info=lapack_opt)

    # _solve_toeplitz:
    config.add_extension('_solve_toeplitz',
                         sources=[('_solve_toeplitz.c')],
                         include_dirs=[get_numpy_include_dirs()])

    config.add_data_dir('tests')

    # Cython BLAS/LAPACK
    config.add_data_files('cython_blas.pxd')
    config.add_data_files('cython_lapack.pxd')

    sources = ['_blas_subroutine_wrappers.f', '_lapack_subroutine_wrappers.f']
    sources += get_g77_abi_wrappers(lapack_opt)
    sources += get_sgemv_fix(lapack_opt)
    includes = numpy_info().get_include_dirs() + [get_python_inc()]
    config.add_library('fwrappers', sources=sources, include_dirs=includes)

    config.add_extension('cython_blas',
                         sources=['cython_blas.c'],
                         depends=['cython_blas.pyx', 'cython_blas.pxd',
                                  'fortran_defs.h', '_blas_subroutines.h'],
                         include_dirs=['.'],
                         libraries=['fwrappers'],
                         extra_info=lapack_opt)

    config.add_extension('cython_lapack',
                         sources=['cython_lapack.c'],
                         depends=['cython_lapack.pyx', 'cython_lapack.pxd',
                                  'fortran_defs.h', '_lapack_subroutines.h'],
                         include_dirs=['.'],
                         libraries=['fwrappers'],
                         extra_info=lapack_opt)

    config.add_extension('_decomp_update',
                         sources=['_decomp_update.c'])

    return config
예제 #6
0
파일: setup.py 프로젝트: Kitchi/scipy
def configuration(parent_package="", top_path=None):
    from distutils.sysconfig import get_python_inc
    from numpy.distutils.system_info import get_info, NotFoundError, numpy_info
    from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
    from scipy._build_utils import get_sgemv_fix, get_g77_abi_wrappers, split_fortran_files

    config = Configuration("linalg", parent_package, top_path)

    lapack_opt = get_info("lapack_opt")

    if not lapack_opt:
        raise NotFoundError("no lapack/blas resources found")

    atlas_version = ([v[3:-3] for k, v in lapack_opt.get("define_macros", []) if k == "ATLAS_INFO"] + [None])[0]
    if atlas_version:
        print(("ATLAS version: %s" % atlas_version))

    # fblas:
    sources = ["fblas.pyf.src"]
    sources += get_g77_abi_wrappers(lapack_opt)
    sources += get_sgemv_fix(lapack_opt)

    config.add_extension("_fblas", sources=sources, depends=["fblas_l?.pyf.src"], extra_info=lapack_opt)

    # flapack:
    sources = ["flapack.pyf.src"]
    sources += get_g77_abi_wrappers(lapack_opt)

    config.add_extension("_flapack", sources=sources, depends=["flapack_user.pyf.src"], extra_info=lapack_opt)

    if atlas_version is not None:
        # cblas:
        config.add_extension(
            "_cblas", sources=["cblas.pyf.src"], depends=["cblas.pyf.src", "cblas_l1.pyf.src"], extra_info=lapack_opt
        )

        # clapack:
        config.add_extension(
            "_clapack", sources=["clapack.pyf.src"], depends=["clapack.pyf.src"], extra_info=lapack_opt
        )

    # _flinalg:
    config.add_extension("_flinalg", sources=[join("src", "det.f"), join("src", "lu.f")], extra_info=lapack_opt)

    # _interpolative:
    routines_to_split = [
        "dfftb1",
        "dfftf1",
        "dffti1",
        "dsint1",
        "dzfft1",
        "id_srand",
        "idd_copyints",
        "idd_id2svd0",
        "idd_pairsamps",
        "idd_permute",
        "idd_permuter",
        "idd_random_transf0",
        "idd_random_transf0_inv",
        "idd_random_transf_init0",
        "idd_subselect",
        "iddp_asvd0",
        "iddp_rsvd0",
        "iddr_asvd0",
        "iddr_rsvd0",
        "idz_estrank0",
        "idz_id2svd0",
        "idz_permute",
        "idz_permuter",
        "idz_random_transf0_inv",
        "idz_random_transf_init0",
        "idz_random_transf_init00",
        "idz_realcomp",
        "idz_realcomplex",
        "idz_reco",
        "idz_subselect",
        "idzp_aid0",
        "idzp_aid1",
        "idzp_asvd0",
        "idzp_rsvd0",
        "idzr_asvd0",
        "idzr_reco",
        "idzr_rsvd0",
        "zfftb1",
        "zfftf1",
        "zffti1",
    ]
    print("Splitting linalg.interpolative Fortran source files")
    dirname = os.path.split(os.path.abspath(__file__))[0]
    fnames = split_fortran_files(join(dirname, "src", "id_dist", "src"), routines_to_split)
    fnames = [join("src", "id_dist", "src", f) for f in fnames]
    config.add_extension("_interpolative", fnames + ["interpolative.pyf"], extra_info=lapack_opt)

    # _calc_lwork:
    config.add_extension("_calc_lwork", [join("src", "calc_lwork.f")], extra_info=lapack_opt)

    # _solve_toeplitz:
    config.add_extension("_solve_toeplitz", sources=[("_solve_toeplitz.c")], include_dirs=[get_numpy_include_dirs()])

    config.add_data_dir("tests")

    # Cython BLAS/LAPACK
    config.add_data_files("cython_blas.pxd")
    config.add_data_files("cython_lapack.pxd")

    sources = ["_blas_subroutine_wrappers.f", "_lapack_subroutine_wrappers.f"]
    sources += get_g77_abi_wrappers(lapack_opt)
    sources += get_sgemv_fix(lapack_opt)
    includes = numpy_info().get_include_dirs() + [get_python_inc()]
    config.add_library("fwrappers", sources=sources, include_dirs=includes)

    config.add_extension(
        "cython_blas",
        sources=["cython_blas.c"],
        depends=["cython_blas.pyx", "cython_blas.pxd", "fortran_defs.h", "_blas_subroutines.h"],
        include_dirs=["."],
        libraries=["fwrappers"],
        extra_info=lapack_opt,
    )

    config.add_extension(
        "cython_lapack",
        sources=["cython_lapack.c"],
        depends=["cython_lapack.pyx", "cython_lapack.pxd", "fortran_defs.h", "_lapack_subroutines.h"],
        include_dirs=["."],
        libraries=["fwrappers"],
        extra_info=lapack_opt,
    )

    config.add_extension("_decomp_update", sources=["_decomp_update.c"])

    return config
예제 #7
0
파일: setup.py 프로젝트: wenqixe/scipy
def configuration(parent_package='', top_path=None):
    from distutils.sysconfig import get_python_inc
    from scipy._build_utils.system_info import get_info, numpy_info
    from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
    from scipy._build_utils import (get_g77_abi_wrappers, gfortran_legacy_flag_hook,
                                    blas_ilp64_pre_build_hook, get_f2py_int64_options,
                                    uses_blas64)

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

    lapack_opt = get_info('lapack_opt')

    atlas_version = ([v[3:-3] for k, v in lapack_opt.get('define_macros', [])
                      if k == 'ATLAS_INFO']+[None])[0]
    if atlas_version:
        print(('ATLAS version: %s' % atlas_version))

    if uses_blas64():
        lapack_ilp64_opt = get_info('lapack_ilp64_opt', 2)

    # fblas:
    sources = ['fblas.pyf.src']
    sources += get_g77_abi_wrappers(lapack_opt)
    depends = ['fblas_l?.pyf.src']

    config.add_extension('_fblas',
                         sources=sources,
                         depends=depends,
                         extra_info=lapack_opt
                         )

    if uses_blas64():
        sources = ['fblas_64.pyf.src'] + sources[1:]
        ext = config.add_extension('_fblas_64',
                                   sources=sources,
                                   depends=depends,
                                   f2py_options=get_f2py_int64_options(),
                                   extra_info=lapack_ilp64_opt)
        ext._pre_build_hook = blas_ilp64_pre_build_hook(lapack_ilp64_opt)

    # flapack:
    sources = ['flapack.pyf.src']
    sources += get_g77_abi_wrappers(lapack_opt)
    dep_pfx = join('src', 'lapack_deprecations')
    deprecated_lapack_routines = [join(dep_pfx, c + 'gegv.f') for c in 'cdsz']
    sources += deprecated_lapack_routines
    depends = ['flapack_gen.pyf.src',
               'flapack_gen_banded.pyf.src',
               'flapack_gen_tri.pyf.src',
               'flapack_pos_def.pyf.src',
               'flapack_pos_def_tri.pyf.src',
               'flapack_sym_herm.pyf.src',
               'flapack_other.pyf.src',
               'flapack_user.pyf.src']

    config.add_extension('_flapack',
                         sources=sources,
                         depends=depends,
                         extra_info=lapack_opt
                         )

    if uses_blas64():
        sources = ['flapack_64.pyf.src'] + sources[1:]
        ext = config.add_extension('_flapack_64',
                                   sources=sources,
                                   depends=depends,
                                   f2py_options=get_f2py_int64_options(),
                                   extra_info=lapack_ilp64_opt)
        ext._pre_build_hook = blas_ilp64_pre_build_hook(lapack_ilp64_opt)

    if atlas_version is not None:
        # cblas:
        config.add_extension('_cblas',
                             sources=['cblas.pyf.src'],
                             depends=['cblas.pyf.src', 'cblas_l1.pyf.src'],
                             extra_info=lapack_opt
                             )

        # clapack:
        config.add_extension('_clapack',
                             sources=['clapack.pyf.src'],
                             depends=['clapack.pyf.src'],
                             extra_info=lapack_opt
                             )

    # _flinalg:
    config.add_extension('_flinalg',
                         sources=[join('src', 'det.f'), join('src', 'lu.f')],
                         extra_info=lapack_opt
                         )

    # _interpolative:
    ext = config.add_extension('_interpolative',
                               sources=[join('src', 'id_dist', 'src', '*.f'),
                                        "interpolative.pyf"],
                               extra_info=lapack_opt
                               )
    ext._pre_build_hook = gfortran_legacy_flag_hook

    # _solve_toeplitz:
    config.add_extension('_solve_toeplitz',
                         sources=[('_solve_toeplitz.c')],
                         include_dirs=[get_numpy_include_dirs()])

    config.add_data_dir('tests')

    # Cython BLAS/LAPACK
    config.add_data_files('cython_blas.pxd')
    config.add_data_files('cython_lapack.pxd')

    sources = ['_blas_subroutine_wrappers.f', '_lapack_subroutine_wrappers.f']
    sources += get_g77_abi_wrappers(lapack_opt)
    includes = numpy_info().get_include_dirs() + [get_python_inc()]
    config.add_library('fwrappers', sources=sources, include_dirs=includes)

    config.add_extension('cython_blas',
                         sources=['cython_blas.c'],
                         depends=['cython_blas.pyx', 'cython_blas.pxd',
                                  'fortran_defs.h', '_blas_subroutines.h'],
                         include_dirs=['.'],
                         libraries=['fwrappers'],
                         extra_info=lapack_opt)

    config.add_extension('cython_lapack',
                         sources=['cython_lapack.c'],
                         depends=['cython_lapack.pyx', 'cython_lapack.pxd',
                                  'fortran_defs.h', '_lapack_subroutines.h'],
                         include_dirs=['.'],
                         libraries=['fwrappers'],
                         extra_info=lapack_opt)

    config.add_extension('_decomp_update',
                         sources=['_decomp_update.c'])

    # Add any license files
    config.add_data_files('src/id_dist/doc/doc.tex')
    config.add_data_files('src/lapack_deprecations/LICENSE')

    return config