0

I'm adding scikit-learn package in buildroot, but it needs scipy denpendency in the building step, so I add host-python-scipy in python-scipy.mk as follows,

HOST_PYTHON_SCIPY_DEPENDENCIES += \
        host-python-numpy \
        host-python-pythran \
        zlib \
        lapack \
        python-numpy \
        python-pybind

then I rebuild scikit-learn, but it gaves another error No BLAS/LAPACK libraries found:

/xxx/buildroot/output/host/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py:196: UserWarning: `install_requires` overwritten in `pyproject.toml` (dependencies)
  warnings.warn(msg)
INFO: lapack_opt_info:
INFO: lapack_armpl_info:
INFO: customize UnixCCompiler
INFO:   libraries armpl_lp64_mp not found in ['/xxx/buildroot/output/host/lib']
INFO:   NOT AVAILABLE
INFO:
INFO: lapack_mkl_info:
INFO:   libraries mkl_rt not found in ['/xxx/buildroot/output/host/lib']
INFO:   NOT AVAILABLE
INFO:
INFO: openblas_lapack_info:
INFO:   libraries openblas not found in ['/xxx/buildroot/output/host/lib']
INFO:   NOT AVAILABLE
INFO:
INFO: openblas_clapack_info:
INFO:   libraries openblas,lapack not found in ['/xxx/buildroot/output/host/lib']
INFO:   NOT AVAILABLE
INFO:
INFO: flame_info:
INFO:   libraries flame not found in ['/xxx/buildroot/output/host/lib']
INFO:   NOT AVAILABLE

...

numpy.distutils.system_info.NotFoundError: No BLAS/LAPACK libraries found.
To build Scipy from sources, BLAS & LAPACK libraries need to be installed.

...

Does Buildroot has MKL library? How can I add it?

I followed the suggestion from the answer, but I run into another problem:

Traceback (most recent call last):
  File "/home/xxx/buildroot/output/build/python-scikit-learn-1.1.2/setup.py", line 329, in <module>
    setup_package()
  File "/home/xxx/buildroot/output/build/python-scikit-learn-1.1.2/setup.py", line 325, in setup_package
    setup(**metadata)
  File "/home/xxx/buildroot/output/host/lib/python3.10/site-packages/numpy/distutils/core.py", line 135, in setup
    config = configuration()
...
FileNotFoundError: [Errno 2] No such file or directory: './test_program'
make: *** [package/pkg-generic.mk:293: /home/xxx/buildroot/output/build/python-scikit-learn-1.1.2/.stamp_built] Error 1

What is the pkg-generic used for? Is there a way to solve this without avoiding the test execution? Can I get some help, pls?

kinder chen
  • 1,371
  • 5
  • 15
  • 25

1 Answers1

2

Please check the patch series at https://patchwork.ozlabs.org/project/buildroot/list/?series=314036 which adds scikit-learn to Buildroot (but which hasn't been reviewed/merged) yet.

scikit-learn and scipy are pretty complex to package, so it's not surprising that you run into troubles while doing this.

Thomas Petazzoni
  • 5,636
  • 17
  • 25
  • Thanks a lot, I re-edited the question and do you mind taking a look, pls? Can I add `MKL` library in Buildroot and how? What is the `pkg-generic` used for? Can I add SKlearn with enabling the test execution? – kinder chen Nov 01 '22 at 04:19