[Numpy-discussion] Does numpy depend upon a Fortran library?

Charles R Harris charlesr.harris at gmail.com
Wed Jan 30 20:18:41 EST 2019

On Wed, Jan 30, 2019 at 5:28 PM Marc F Paterno <paterno at fnal.gov> wrote:

> Hello,
> I have encountered a problem with a binary incompatibility between the
> Fortran runtime library installed with numpy when using 'pip install --user
> numpy', and that used by the rest of my program, which is built using
> gfortran from GCC 8.2.  The numpy installation uses libgfortran.5.dylib,
> and GCC 8.2 provides libgfortran.5.dylib.
> While investigating the source of this problem, I downloaded the numpy
> source
> (
> https://files.pythonhosted.org/packages/04/b6/d7faa70a3e3eac39f943cc6a6a64ce378259677de516bd899dd9eb8f9b32/numpy-1.16.0.zip
> ),
> and tried building it. The resulting libraries have no coupling to any
> Fortran library that I can find.  I can find no Fortran source code files
> in the numpy source,
> except in tests or documentation.
> I am working on a MacBook laptop, running macOS Mojave, and so am using
> the Accelerate framework to supply BLAS.
> I do not understand why the pip installation of numpy includes a Fortran
> runtime library. Can someone explain to me what I am missing?
That's interesting, it looks like the wheel includes four libraries:

-rw-r--r--. 1 charris charris   273072 Jan  1  1980 libgcc_s.1.dylib
-rwxr-xr-x. 1 charris charris  1550456 Jan  1  1980 libgfortran.3.dylib
-rwxr-xr-x. 1 charris charris 63433364 Jan  1  1980
-rwxr-xr-x. 1 charris charris   279932 Jan  1  1980 libquadmath.0.dylib

I thought we only needed the openblas, but that in turn probably depends on
libgcc. But why we have the fortran library and quadmath escapes me.
Perhaps someone else knows.

Note that compiling from source is different and will generally use
different libraries. We don't use Accelerate because it is buggy, not
thread safe, and it appears Apple is not interested in doing anything about

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20190130/ff1754dc/attachment.html>

More information about the NumPy-Discussion mailing list