math/py-numpy is broken on 9.2-STABLE by the change of the default gcc version to 4.7. I tried to compile everything related to numpy with gcc48 as recommended by someone, but the error stays the same (sans version in the path in ImportError line below): $ python -c "import numpy" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 153, in <module> from . import add_newdocs File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module> from numpy.lib import add_newdoc File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 18, in <module> from .polynomial import * File "/usr/local/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 19, in <module> from numpy.linalg import eigvals, lstsq, inv File "/usr/local/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 50, in <module> from .linalg import * File "/usr/local/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 29, in <module> from numpy.linalg import lapack_lite, _umath_linalg ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc48/libgfortran.so.3 not found I have seen the discussions in December in preparations for the GCC version change. It seems the patch proposed in there, is in place (/usr/ports/math/py-numpy/files/patch-numpy-distutils-fcompiler-gnu.py), but apparently it's not enough... I also tried to rebuild all my ports. I did it with portmaster in-place method, though, which is not totally free from inheriting problems of previous builds. How-To-Repeat: I see the discussions of the same bug, e.g. as py-scipy build problems. So I guess it's easy to reproduce with fresh ports on 9.2-STABLE...
Responsible Changed From-To: freebsd-ports-bugs->freebsd-python Over to maintainer (via the GNATS Auto Assign Tool)
There is a workaround given in the discussions of similar problem with ipython. Just define an environment variable: LD_LIBRARY_PATH=/usr/local/lib/gcc48 python -c "import numpy" No errors. This is an indication that the problem might be easier to solve in lang/gcc* ports or in Mk/bsd.gcc.mk -- Vladimir Chukharev
Note a related PR ports/188327 'math/py-numpy: Numpy is broken'. Seems that setting LD_LIBRARY_PATH variable helps in 10.0-RELEASE too. -- Vladimir Chukharev
*** Bug 192598 has been marked as a duplicate of this bug. ***
Canonicalize assignee, add gerald@ to CC for help/expertise
*** Bug 188327 has been marked as a duplicate of this bug. ***
Is LDFLAGS properly used by this port?
Same problem with the port math/py-matplotlib: $ python -c "import matplotlib as m; print(m.__version__); print(m.__path__[0]);" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/matplotlib/__init__.py", line 151, in <module> from matplotlib.rcsetup import (defaultParams, File "/usr/local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 20, in <module> from matplotlib.colors import is_color_like File "/usr/local/lib/python2.7/site-packages/matplotlib/colors.py", line 52, in <module> import numpy as np File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 153, in <module> from . import add_newdocs File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module> from numpy.lib import add_newdoc File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 18, in <module> from .polynomial import * File "/usr/local/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 19, in <module> from numpy.linalg import eigvals, lstsq, inv File "/usr/local/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 50, in <module> from .linalg import * File "/usr/local/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 29, in <module> from numpy.linalg import lapack_lite, _umath_linalg ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc48/libgfortran.so.3 not found
Created attachment 147418 [details] This patch re-adds LDFLAGS to fix the problem. $LDFLAGS was intentionally removed with the hereunder comment: # ignore LDFLAGS from env, as it overrides internal flags (e.g. -shared) for some reason This proposed patch re-adds it (with the needed '-shared'), so that it takes the value set by 'USES= fortran', which fixes the reported problem. Indirectly this fixes some dependent ports like math/py-matplotlib and cad/freecad (resurrection in progress).
(In reply to Thierry Thomas from comment #9) > $LDFLAGS was intentionally removed with the hereunder comment: > > # ignore LDFLAGS from env, as it overrides internal flags (e.g. -shared) for > some reason Ouch! That was a truely bad move. No wonder this port, and some related ones, have been causing troubles for user various times since then. Thank you so much for catching and fixing this, Thierry!
A commit references this bug: Author: demon Date: Sun Sep 28 10:40:55 UTC 2014 New revision: 369447 URL: https://svnweb.freebsd.org/changeset/ports/369447 Log: Fix ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc48/libgfortran.so.3 not found error when importing numpy module. PR: 188114 Patch by Thierry Thomas <thierry@FreeBSD.org> Changes: head/math/py-numpy/Makefile