[MacPorts] #59616: py37-numpy: Symbol not found: _environ, Referenced from: libgfortran.5.dylib, Expected in: flat namespace

MacPorts noreply at macports.org
Sat Jul 11 07:47:55 UTC 2020


#59616: py37-numpy: Symbol not found: _environ, Referenced from:
libgfortran.5.dylib, Expected in: flat namespace
-------------------------+-----------------------
  Reporter:  ryandesign  |      Owner:  michaelld
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.6.2
Resolution:              |   Keywords:
      Port:  py-numpy    |
-------------------------+-----------------------

Comment (by ryandesign):

 > {{{
 > ImportError:
 dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7
 /site-packages/numpy/core/_multiarray_umath.cpython-37m-darwin.so, 2):
 Symbol not found: _environ
 >   Referenced from: /opt/local/lib/libgcc/libgfortran.5.dylib
 >   Expected in: flat namespace
 > }}}

 I think now that this is a gfortran problem.

 `environ` used to be a thing that you weren't allowed to access from
 dylibs. Instead, you were supposed to use `*_NSGetEnviron()`.

 It looks like `environ` may have become available in 10.8, so software
 written by developers who don't test on older systems anymore may not know
 or remember that they were supposed to do it a different way before.

 See
 https://gitlab.haskell.org/ghc/ghc/-/commit/43d12dc65e3bf974751486e7ec6be623831f705e
 for an example of how another project solved this. Something like that may
 need to be patched into the gfortran code somewhere.

 If it's not that, then it could be an SDK-related issue. On 10.7 we use
 Xcode 4.6.3 which contains both the 10.7 and 10.8 SDKs. Maybe gfortran has
 found the 10.8 SDK and is trying to use symbols from it that are not
 available when running on 10.7. See #60637 for another instance where I
 suspect that may be the case.

-- 
Ticket URL: <https://trac.macports.org/ticket/59616#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list