Skip to content

Library can't be installed for Python 3.12 on Darwin (macos with Apple Silicon) #85

@jonadaly

Description

@jonadaly

Specifications

  • OS: MacOS Sonoma 14.4.1 (23E224)
  • SCS version: 3.2.4.post1
  • Python version: 3.12.2
  • Numpy version: 1.26.4
  • Scipy version: 1.13.0
  • Output of get_info print commands as above (if applicable):

Doesn't work on python 3.12, but here's the output from 3.11:

>>> print(get_info("blas_opt"))  # best blas install
{'extra_compile_args': ['-I/System/Library/Frameworks/vecLib.framework/Headers'], 'extra_link_args': ['-Wl,-framework', '-Wl,Accelerate'], 'define_macros': [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None), ('ACCELERATE_NEW_LAPACK', None)]}
>>> print(get_info("lapack_opt"))  # best lapack install
{'extra_compile_args': ['-I/System/Library/Frameworks/vecLib.framework/Headers'], 'extra_link_args': ['-Wl,-framework', '-Wl,Accelerate'], 'define_macros': [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None), ('ACCELERATE_NEW_LAPACK', None)]}
>>> print(get_info("blas"))  # fall back blas install
{}
>>> print(get_info("lapack"))  # fall back lapack install
{}
  • Data file location dumped with write_data_filename (if applicable): N/A

Description

I can't seem to install scs on an Apple Silicon (M1) macbook due to a missing dependency Accelerate.

How to reproduce

I have openblas installed, and have tried installing while explicitly setting the path to it:

brew install openblas
OPENBLAS="$(brew --prefix openblas)" pip install scs

Additional information

This line of the meson build appears to be the source of the problem.

Does this library support installation on Apple Silicon with the latest version of Python? I can see in the CI that we don't try with the macos-14 runner.

Output

Here's the output from the pip install scs command on a fresh venv:

$ OPENBLAS="$(brew --prefix openblas)" pip install scs
Collecting scs
  Using cached scs-3.2.4.post1.tar.gz (1.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      + meson setup /private/var/folders/zh/c5mj4lqj3_zfd439bg37n7hc0000gn/T/pip-install-5o8e458r/scs_2ee27b829fe4411a878f32b4bd919ee7 /private/var/folders/zh/c5mj4lqj3_zfd439bg37n7hc0000gn/T/pip-install-5o8e458r/scs_2ee27b829fe4411a878f32b4bd919ee7/.mesonpy-1ud88kl6 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/private/var/folders/zh/c5mj4lqj3_zfd439bg37n7hc0000gn/T/pip-install-5o8e458r/scs_2ee27b829fe4411a878f32b4bd919ee7/.mesonpy-1ud88kl6/meson-python-native-file.ini
      The Meson build system
      Version: 1.4.0
      Source dir: /private/var/folders/zh/c5mj4lqj3_zfd439bg37n7hc0000gn/T/pip-install-5o8e458r/scs_2ee27b829fe4411a878f32b4bd919ee7
      Build dir: /private/var/folders/zh/c5mj4lqj3_zfd439bg37n7hc0000gn/T/pip-install-5o8e458r/scs_2ee27b829fe4411a878f32b4bd919ee7/.mesonpy-1ud88kl6
      Build type: native build
      Project name: scs
      Project version: undefined
      C compiler for the host machine: cc (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.3.9.4)")
      C linker for the host machine: cc ld64 1053.12
      Host machine cpu family: aarch64
      Host machine cpu: aarch64
      Program python found: YES (/Users/jondaly/.pyenv/versions/3.12.2/envs/scs-python/bin/python3.12)
      Found pkg-config: YES (/opt/homebrew/bin/pkg-config) 0.29.2
      Found CMake: /opt/homebrew/bin/cmake (3.29.3)
      Run-time dependency accelerate found: NO (tried pkgconfig, framework and cmake)

      ../meson.build:8:15: ERROR: Dependency "Accelerate" not found, tried pkgconfig, framework and cmake

      A full log can be found at /private/var/folders/zh/c5mj4lqj3_zfd439bg37n7hc0000gn/T/pip-install-5o8e458r/scs_2ee27b829fe4411a878f32b4bd919ee7/.mesonpy-1ud88kl6/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions