Skip to content

Dependency "OpenBLAS" not found when mvn package #495

Closed
@ziyilin

Description

@ziyilin

I prepared a maven project with graalpy. But failed to mvn package the project.
This is my pom settings:

 <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <graalpy.version>24.1.2</graalpy.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.graalvm.python</groupId>
                <artifactId>graalpy-maven-plugin</artifactId>
                <version>${graalpy.version}</version>
                <configuration>
                    <packages>
                        <package>optuna==3.2.0</package>
                        <package>pandas==1.5.2</package>
                        <package>scikit-learn==1.2.2</package>
                        <package>numpy==1.24.3</package>
                    </packages>
                    <externalDirectory>
                        ${project.basedir}/python-resources
                    </externalDirectory>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>process-graalpy-resources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

mvn package process failed with the following error message:

[INFO] --- graalpy-maven-plugin:24.1.2:process-graalpy-resources (default) @ tuning-driver ---
[INFO] Creating GraalPy 24.1.2 venv
[INFO] /home/cengfeng.lzy/codebase/mljava/tuning-driver/target/classes/org.graalvm.python.vfs/venv/bin/graalpy -m pip install scikit-learn==1.2.2 pandas==1.5.2 numpy==1.24.3 optuna==3.2.0
Looking in indexes: http://yum.tbsite.net/pypi/simple/, https://www.graalvm.org/python/wheels/
Collecting scikit-learn==1.2.2
  Using cached http://yum.tbsite.net/pypi/packages/c9/fa/8e158d81e3602da1e7bafbd4987938bc003fe4b0f44d65681e7f8face95a/scikit-learn-1.2.2.tar.gz (7.3 MB)
Looking for GraalPy patches for scikit-learn
Patching package scikit-learn using /home/cengfeng.lzy/.cache/org.graalvm.polyglot/python/python-home/7f99e649dc51b21db2b83ce56bc9742e402b87c1/lib/graalpy24.1/patches/scikit-learn/scikit-learn-1.2.2.patch
patching file pyproject.toml
patching file sklearn/_build_utils/__init__.py
patching file sklearn/datasets/_svmlight_format_fast.pyx
  Installing build dependencies: started
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: still running...
  Installing build dependencies: finished with status 'error'
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [92 lines of output]
      Looking in indexes: http://yum.tbsite.net/pypi/simple/, https://www.graalvm.org/python/wheels/, https://www.graalvm.org/python/wheels/
      Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Windows" and platform_python_implementation != "PyPy"' don't match your environment
      Collecting setuptools
        Using cached http://yum.tbsite.net/pypi/packages/54/21/f43f0a1fa8b06b32812e0975981f4677d28e0f3271601dc88ac5a5b83220/setuptools-78.1.0-py3-none-any.whl (1.3 MB)
      Collecting wheel
        Using cached http://yum.tbsite.net/pypi/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl (65 kB)
      Collecting Cython<3,>=0.29.24
        Using cached http://yum.tbsite.net/pypi/packages/7e/26/9d8de10005fedb1eceabe713348d43bae1dbab1786042ca0751a2e2b0f8c/Cython-0.29.37-py2.py3-none-any.whl (989 kB)
      Collecting oldest-supported-numpy
        Using cached http://yum.tbsite.net/pypi/packages/dc/5c/e3c84cfdd488701aa074b22cf5bd227fb15d26e1d55a66d9088c39afa123/oldest_supported_numpy-2023.12.21-py3-none-any.whl (4.9 kB)
      Collecting scipy>=1.3.2
        Using cached http://yum.tbsite.net/pypi/packages/84/a9/2bf119f3f9cff1f376f924e39cfae18dec92a1514784046d185731301281/scipy-1.10.1.tar.gz (42.4 MB)
      auto-patching C API usages in /tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24/scipy/_lib/boost/boost/python/suite/indexing/detail/indexing_suite_detail.hpp
      auto-patching C API usages in /tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24/scipy/_lib/boost/boost/python/detail/wrap_python.hpp
      auto-patching C API usages in /tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24/scipy/_lib/boost/boost/mpi/python/skeleton_and_content.hpp
      auto-patching C API usages in /tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24/scipy/_lib/boost/boost/mpi/python/serialize.hpp
      Looking for GraalPy patches for scipy
      Patching package scipy using /home/cengfeng.lzy/.cache/org.graalvm.polyglot/python/python-home/7f99e649dc51b21db2b83ce56bc9742e402b87c1/lib/graalpy24.1/patches/scipy/scipy-1.10.1.patch
      patching file meson.build
      patching file mesonpy_wrapper.py
      patching file pyproject.toml
      patching file scipy/_lib/_ccallback_c.pyx
      patching file scipy/_lib/setup.py
      patching file scipy/_lib/src/messagestream_config.h.in
      patching file scipy/sparse/linalg/meson.build
      patching file scipy/special/meson.build
      patching file tools/cythonize.py
        Installing build dependencies: started
        Installing build dependencies: still running...
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): still running...
        Preparing metadata (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        × Preparing metadata (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [42 lines of output]
            + meson setup --prefix=/home/cengfeng.lzy/.cache/org.graalvm.polyglot/python/python-home/7f99e649dc51b21db2b83ce56bc9742e402b87c1 /tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24 /tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24/mesonbuild-graalpy --native-file=/tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
            The Meson build system
            Version: 1.2.2
            Source dir: /tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24
            Build dir: /tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24/mesonbuild-graalpy
            Build type: native build
            Project name: SciPy
            Project version: 1.10.1
            C compiler for the host machine: cc (gcc 10.2.1 "cc (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32)")
            C linker for the host machine: cc ld.bfd 2.35-12
            C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32)")
            C++ linker for the host machine: c++ ld.bfd 2.35-12
            Cython compiler for the host machine: cython (cython 0.29.37)
            Host machine cpu family: x86_64
            Host machine cpu: x86_64
            Compiler for C supports arguments -Wno-unused-but-set-variable: YES
            Compiler for C supports arguments -Wno-unused-function: YES
            Compiler for C supports arguments -Wno-conversion: YES
            Compiler for C supports arguments -Wno-misleading-indentation: YES
            Compiler for C supports arguments -Wno-incompatible-pointer-types: YES
            Library m found: YES
            Fortran compiler for the host machine: gfortran (gcc 10.2.1 "GNU Fortran (GCC) 10.2.1 20200825 (Alibaba 10.2.1-3.8 2.32)")
            Fortran linker for the host machine: gfortran ld.bfd 2.35-12
            Compiler for Fortran supports arguments -Wno-conversion: YES
            Compiler for Fortran supports arguments -fallow-argument-mismatch: YES
            Checking if "-Wl,--version-script" : links: YES
            Program cython found: YES (/tmp/pip-build-env-3v8a54ez/overlay/bin/cython)
            Program python found: YES (/home/cengfeng.lzy/codebase/mljava/tuning-driver/target/classes/org.graalvm.python.vfs/venv/bin/graalpy)
            Run-time dependency python found: YES 3.11
            Program pythran found: YES (/tmp/pip-build-env-3v8a54ez/overlay/bin/pythran)
            Run-time dependency threads found: YES
            Library npymath found: YES
            Library npyrandom found: YES
            Found pkg-config: /usr/bin/pkg-config (1.4.2)
            Found CMake: /usr/bin/cmake (3.26.5)
            WARNING: CMake Toolchain: Failed to determine CMake compilers state
            Run-time dependency openblas found: NO (tried pkgconfig and cmake)
            Run-time dependency openblas found: NO (tried pkgconfig and cmake)

            ../scipy/meson.build:134:7: ERROR: Dependency "OpenBLAS" not found, tried pkgconfig and cmake

            A full log can be found at /tmp/pip-install-lg_sqgji/scipy_61e5a5affd64483386ee2d3ee0995d24/mesonbuild-graalpy/meson-logs/meson-log.txt
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: metadata-generation-failed

      × Encountered error while generating package metadata.
      ╰─> See above for output.

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for details.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

But I have installed openblas:

$sudo yum install openblas
Last metadata expiration check: 1:19:54 ago on Thu 10 Apr 2025 01:51:08 PM CST.
Package openblas-0.3.15-6.al8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

$ldconfig -p | grep openblas
        libopenblas.so.0 (libc6,x86-64) => /lib64/libopenblas.so.0

How can I get this fixed? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions