public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: "F. Heitkamp" <heitkamp@ameritech.net>
Cc: gcc-help@gcc.gnu.org
Subject: Re: g++ libstdc++ linker question.
Date: Mon, 30 Apr 2012 17:47:00 -0000	[thread overview]
Message-ID: <CAH6eHdShx2azvV34N35Lv-ra=KWbF3fti3zJFkUEKK3wUN9MBQ@mail.gmail.com> (raw)
In-Reply-To: <CAH6eHdTKUTYEvhS1mHGGS5LV7K6h+N5_qi1iyKXmNiXCLMpBYw@mail.gmail.com>

On 30 April 2012 18:28, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 30 April 2012 13:39, F. Heitkamp wrote:
>> People will tell me to ask on matplotlib list but I believe this a more
>> generic GNU C++ question.
>> I have been trying to run matplotlib that I built from source on my linux
>> from scratch like box.
>>
>> When I try to run an example I get:
>>
>> bash-4.2$ python2.6 matplotlib-ex1.py
>> Traceback (most recent call last):
>>  File "matplotlib-ex1.py", line 13, in <module>
>>    import matplotlib.pyplot as plt
>>  File "/usr/lib/python2.6/site-packages/matplotlib/pyplot.py", line 23, in
>> <module>
>>    from matplotlib.figure import Figure, figaspect
>>  File "/usr/lib/python2.6/site-packages/matplotlib/figure.py", line 16, in
>> <module>
>>    import artist
>>  File "/usr/lib/python2.6/site-packages/matplotlib/artist.py", line 6, in
>> <module>
>>    from transforms import Bbox, IdentityTransform, TransformedBbox,
>> TransformedPath
>>  File "/usr/lib/python2.6/site-packages/matplotlib/transforms.py", line 34,
>> in <module>
>>    from matplotlib._path import affine_transform
>> ImportError: /usr/lib/python2.6/site-packages/matplotlib/_path.so: undefined
>> symbol:
>> _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_i
>>
>> I see this symbol is in 32 bits libstdc++ library, but does not seem to
>> appear in 64 bits versions.
>
> Right, the equivalent symbol in the 64-bit lib ends in _l instead of _i
>
>> bash-4.2$ ldd /usr/lib/python2.6/site-packages/matplotlib/_path.so
>>    linux-gate.so.1 =>  (0xffffe000)
>>    libpython2.6.so.1.0 => /usr/lib/libpython2.6.so.1.0 (0xf74f7000)
>>    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf74de000)
>>    libpthread.so.0 => /lib/libpthread.so.0 (0xf74c4000)
>>    libc.so.6 => /lib/libc.so.6 (0xf7367000)
>>    libdl.so.2 => /lib/libdl.so.2 (0xf7362000)
>>    libutil.so.1 => /lib/libutil.so.1 (0xf735e000)
>>    libm.so.6 => /lib/libm.so.6 (0xf7338000)
>>    /lib/ld-linux.so.2 (0xf77d1000)
>>
>> libstdc++ is not shown as being linked with _path.so
>>
>> Any thoughts?
>
> Is _path.so a 32-bit or 64-bit library?  From the missing symbol I'm
> asuming 32-bit.
>
> It would appear it wasn't correctly linked, so its dependency on
> libstdc++.so isn't recorded in the library by a DT_NEEDED entry.

P.S. you can check the DT_NEEDED tags by running:

readelf -d  /usr/lib/python2.6/site-packages/matplotlib/_path.so


> Does it help if you tell the dynamic linker to preload libstdc++.so?
>
> LD_PRELOAD=/usr/lib/libstdc++.so python2.6 matplotlib-ex1.py

The matplotlib I use is built with:

python setupegg.py build_ext \
  --rpath=/opt/gcc-4.4.3/lib64
python setupegg.py build
python setupegg.py install --user

The --rpath option ensures the right libstdc++.so is found at runtime
(we have several installed).  That build works here, and is linked to
libstdc++.so.  Unfortunately it builds matplotlib as a python egg,
which is a very annoying package format.  I'd rather not install it
via egg, but have no experience doing so and can't suggest why your
build was not linked to libstdc++.

  reply	other threads:[~2012-04-30 17:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30 12:40 F. Heitkamp
2012-04-30 17:28 ` Jonathan Wakely
2012-04-30 17:47   ` Jonathan Wakely [this message]
2012-05-02 11:14     ` F. Heitkamp
2012-05-02 11:37       ` Andrew Haley
2012-05-02 11:02   ` F. Heitkamp
2012-05-03 12:14   ` F. Heitkamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH6eHdShx2azvV34N35Lv-ra=KWbF3fti3zJFkUEKK3wUN9MBQ@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=heitkamp@ameritech.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).