From owner-freebsd-python@freebsd.org Tue Jan 5 10:42:08 2016 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79682A61594 for ; Tue, 5 Jan 2016 10:42:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 5FD3C122B for ; Tue, 5 Jan 2016 10:42:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 5D715A61592; Tue, 5 Jan 2016 10:42:08 +0000 (UTC) Delivered-To: python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D070A61590 for ; Tue, 5 Jan 2016 10:42:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2B9E122A for ; Tue, 5 Jan 2016 10:42:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u05AfrPX098138 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 5 Jan 2016 12:41:53 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u05AfrPX098138 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u05Afqo4098137; Tue, 5 Jan 2016 12:41:52 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 5 Jan 2016 12:41:52 +0200 From: Konstantin Belousov To: "Mikhail T." Cc: Olivier Duchateau , python@FreeBSD.org Subject: Re: SOLVED: numpy would not load: libgcc_s vs. libgfortran Message-ID: <20160105104152.GF3625@kib.kiev.ua> References: <568AA168.5090400@aldan.algebra.com> <20160104193453.2ae62e7a01ab0a0cd845e296@gmail.com> <568AC046.8040300@aldan.algebra.com> <20160104213150.4e47df03583e70cef356a51d@gmail.com> <568AE454.6010604@aldan.algebra.com> <568AEB8C.2000805@aldan.algebra.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <568AEB8C.2000805@aldan.algebra.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 10:42:08 -0000 On Mon, Jan 04, 2016 at 05:00:44PM -0500, Mikhail T. wrote: > On 04.01.2016 16:29, Mikhail T. wrote: > > ImportError: > > /opt/lib/python2.7/site-packages/numpy/core/multiarray.so: Undefined > > symbol "cblas_cdotc_sub" > Ok, the above went away, when I rebuilt all of the Fortran-using > dependencies of numpy with gfortran5. Don't know, if they were built > incorrectly somehow, or if something is wrong with gfortran48. > > My one-liner test script now "works", but the original problem is still > here -- only now it complains about gcc5's libgfortran: > > File "/opt/lib/python2.7/site-packages/numpy/core/__init__.py", > line 14, in > from . import multiarray > ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by > /opt/lib/gcc5/libgfortran.so.3 not found > > I wonder, if this has something to do with my setting PYTHONPATH -- I > need the not-yet-installed mediagoblin packages to be found in ${WRKSRC} > by the tests. What is the proper way of to do this? Some shared object in your process is linked to libgcc_s.so.1, and does not have the DT_RPATH set. You might try to verify this by procstat -v and seeing /lib/libgcc_s.so.1 loaded. There are two ways you could find which dso is linked to libgcc_s.so.1. Either examine the output of readelf -d for each object involved. Or, recompile your ld-elf.so.1 with debugging enabled, like cd src/libexec/rtld-elf && make clean all install DEBUG=-DDEBUG and run your binary with LD_DEBUG=yes env variable set. You will see the run-time linker decisions about loaded objects. An easy way out of this issue is to set LD_PRELOAD=/usr/local/lib/gcc/libgcc_s.so.1 variable in your environment, but this could have some other consequences and leaves the cause undiagnosed.