Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CBLAS not present but scikit does not add the local copy #5489

@dballesteros7

Description

@dballesteros7

My installation with pip fails because CBLAS is not present, even though ATLAS is present and the scipy pip installation worked.

The error is:

error: Command "g++ -pthread -shared build/temp.linux-x86_64-3.5/sklearn/svm/liblinear.o build/temp.linux-x86_64-3.5/sklearn/svm/src/liblinear/linear.o build/temp.linux-x86_64-3.5/sklearn/svm/src/liblinear/tron.o -L/usr/lib64/atlas -Lbuild/temp.linux-x86_64-3.5 -lcblas -lm -o build/lib.linux-x86_64-3.5/sklearn/svm/liblinear.cpython-35m-x86_64-linux-gnu.so" failed with exit status 1
/usr/bin/ld: cannot find -lcblas
collect2: error: ld returned 1 exit status

When checking the get_info, I see:

get_info('blas_opt', 0)
/local/workspace/master-thesis-2015/flickr-crawl/env/lib/python3.5/site-packages/numpy/distutils/system_info.py:635: UserWarning: Specified path is invalid.
warnings.warn('Specified path %s is invalid.' % d)
{'language': 'c', 'library_dirs': ['/usr/lib64/atlas'], 'define_macros': [('HAVE_CBLAS', None), ('NO_ATLAS_INFO', -1)], 'include_dirs': ['/usr/include'], 'libraries': ['tatlas']}

Which indicates that NO_ATLAS_INFO is -1 so scikit-learn doesn't add its own CBLAS implementation but HAVE_CBLAS, None is indicating that it should.

Changing line 64 in sklearn/setup.py to

    if (not blas_info) or (
            ('NO_ATLAS_INFO', 1) in blas_info.get('define_macros', [])) or (
            ('HAVE_CBLAS', None) in blas_info.get('define_macros', [])):

fixes the problem. HAVE_CBLAS was only added in the latest numpy 1.10.1.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions