Skip to content

Installation issue: py-scipy has a dependency on libgfortran on macOS?  #43905

@pranav-sivaraman

Description

@pranav-sivaraman

Steps to reproduce the issue

Following Environment

spack:
  specs:
  - py-scipy
  view: true
  concretizer:
    unify: true
    os_compatible: {sonoma: [ventura], ventura: [sonoma]}
  mirrors:
    develop-ml-darwin-aarch64-mps: https://binaries.spack.io/develop/ml-darwin-aarch64-mps
  compilers:
  - compiler:
      spec: apple-clang@=15.0.0
      paths:
        cc: /usr/bin/clang
        cxx: /usr/bin/clang++
        f77: null
        fc: null
      flags: {}
      operating_system: sonoma
      target: aarch64
      modules: []
      environment: {}
      extra_rpaths: []

Produces the following spec where all the specs are from the ML buildcache

$ spack spec
Input spec
--------------------------------
 -   py-scipy

Concretized
--------------------------------
[+]  [email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected]~bignuma~consistent_fpcsr+dynamic_dispatch~fortran~ilp64+locking+pic+shared build_system=makefile symbol_suffix=none threads=none arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]~guile build_system=generic arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]+cpanm+opcode+open+shared+threads build_system=generic patches=714e4d1 arch=darwin-ventura-aarch64
[+]              ^[email protected]%[email protected]+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected] build_system=autotools arch=darwin-ventura-aarch64
[-]          ^gnuconfig@2022-09-17%[email protected] build_system=generic arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected] build_system=generic arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected] build_system=python_pip patches=0f0b1bd arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]              ^[email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]                  ^[email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected] build_system=python_pip patches=873745d arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected] build_system=generic arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected]~ipo build_system=cmake build_type=Release generator=ninja arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]~doc+ncurses+ownlibs build_system=generic build_type=Release arch=darwin-ventura-aarch64
[+]              ^[email protected]%[email protected]~gssapi~ldap~libidn2~librtmp~libssh~libssh2+nghttp2 build_system=autotools libs=shared,static tls=secure_transport arch=darwin-ventura-aarch64
[+]                  ^[email protected]%[email protected] build_system=autotools arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]+re2c build_system=generic arch=darwin-ventura-aarch64
[+]              ^[email protected]%[email protected] build_system=generic arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]~ipo+multicompat build_system=cmake build_type=Release generator=make arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected] build_system=python_pip arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected] build_system=generic arch=darwin-ventura-aarch64
[+]      ^[email protected]%[email protected]+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=13fa8bf,b0615b2,ebdca64,f2fd060 arch=darwin-ventura-aarch64
[e]          ^[email protected]%[email protected] build_system=bundle arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]~debug~pic+shared build_system=generic arch=darwin-ventura-aarch64
[-]              ^[email protected]%[email protected] build_system=autotools arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]~libbsd build_system=autotools arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected] build_system=autotools arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]+bzip2+curses+git~libunistring+libxml2+pic+shared+tar+xz build_system=autotools arch=darwin-ventura-aarch64
[+]              ^[email protected]%[email protected] build_system=autotools libs=shared,static arch=darwin-ventura-aarch64
[+]              ^[email protected]%[email protected]+pic~python+shared build_system=autotools arch=darwin-ventura-aarch64
[+]              ^[email protected]%[email protected] build_system=autotools zip=pigz arch=darwin-ventura-aarch64
[+]                  ^[email protected]%[email protected] build_system=makefile arch=darwin-ventura-aarch64
[+]                  ^[email protected]%[email protected]+programs build_system=makefile compression=none libs=shared,static arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected] build_system=autotools arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]~obsolete_api build_system=autotools patches=4885da3 arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]~symlinks+termlib abi=none build_system=autotools patches=7a351bc arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]~docs+shared build_system=generic certs=mozilla arch=darwin-ventura-aarch64
[-]              ^ca-certificates-mozilla@2023-05-30%[email protected] build_system=generic arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected] build_system=autotools patches=bbf97f1 arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]~pic build_system=autotools libs=shared,static arch=darwin-ventura-aarch64
[+]          ^[email protected]%[email protected]+compat+new_strategies+opt+pic+shared build_system=autotools arch=darwin-ventura-aarch64

With the simple python file

from scipy.sparse import issparse

Tagging Maintainers: @adamjstewart @rgommers

Error message

Produces the following error message when running the python file.

Error message
Traceback (most recent call last):
  File "/Users/pranav/Documents/Research/embeddings-playground/scikit.py", line 1, in 
    from scipy.sparse import issparse
  File "/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib/python3.11/site-packages/scipy/sparse/__init__.py", line 308, in 
    from . import csgraph
  File "/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib/python3.11/site-packages/scipy/sparse/csgraph/__init__.py", line 185, in 
    from ._laplacian import laplacian
  File "/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib/python3.11/site-packages/scipy/sparse/csgraph/_laplacian.py", line 7, in 
    from scipy.sparse.linalg import LinearOperator
  File "/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib/python3.11/site-packages/scipy/sparse/linalg/__init__.py", line 132, in 
    from ._eigen import *
  File "/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib/python3.11/site-packages/scipy/sparse/linalg/_eigen/__init__.py", line 9, in 
    from .arpack import *
  File "/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib/python3.11/site-packages/scipy/sparse/linalg/_eigen/arpack/__init__.py", line 20, in 
    from .arpack import *
  File "/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib/python3.11/site-packages/scipy/sparse/linalg/_eigen/arpack/arpack.py", line 48, in 
    from . import _arpack
ImportError: dlopen(/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib/python3.11/site-packages/scipy/sparse/linalg/_eigen/arpack/_arpack.cpython-311-darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib
  Referenced from: <6458719B-5FE1-3B6F-AB87-C774827AB0BD> /Users/pranav/spack/opt/spack/darwin-ventura-aarch64/apple-clang-15.0.0/py-scipy-1.13.0-tidaecalxzhlt23to377oa6ocgk576lb/lib/python3.11/site-packages/scipy/sparse/linalg/_eigen/arpack/_arpack.cpython-311-darwin.so
  Reason: tried: '/opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib' (no such file), '/opt/homebrew/opt/gcc/lib/gcc/current/libgfortran.5.dylib' (no such file), '/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib/libgfortran.5.dylib' (no such file), '/Users/pranav/spack/var/spack/environments/repro/.spack-env/view/lib64/libgfortran.5.dylib' (no such file), './libgfortran.5.dylib' (no such file)

I am not sure if there is something lingering from homebrew since I have deleted it. But I would think this error indicates py-scipy has a gfortran dependency?

Information on your system

  • Spack: 0.22.0.dev0 (3c57440)
  • Python: 3.9.6
  • Platform: darwin-sonoma-m1
  • Concretizer: clingo

Additional information

No response

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have run spack maintainers <name-of-the-package> and @mentioned any maintainers
  • I have uploaded the build log and environment files
  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions