On Wed, Jan 30, 2019 at 5:19 PM Charles R Harris <charlesr.harris@gmail.com> wrote:


On Wed, Jan 30, 2019 at 5:28 PM Marc F Paterno <paterno@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 libopenblasp-r0.3.5.dev.dylib
-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.

I suspect it's a leftover from when we were using ATLAS, we did need a Fortran runtime library at some point. The cause will be somewhere in the numpy-wheel build scripts, there is a gfortran-install git submodule: https://github.com/MacPython/numpy-wheels
 

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 that.

Chuck
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion