Matplotlib 1.4.2 / 1.4.3 doesn't install from source

Hello,

I have Matplotlib 1.3.1 installed on my Ubuntu 14.04 system and thought it
was time to upgrade to 1.4.2. I never get the latest version for
compatibility reasons (some packages that use Matplotlib might stop
working). I then downloaded the tarball, uncompressed its contents into a
folder and executed "sudo python setup.py build". However, I got the
following error (last few lines only):

c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g
-fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g
-fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
build/temp.linux-x86_64-2.7/src/ft2font.o
build/temp.linux-x86_64-2.7/src/mplutils.o
build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o
build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o
build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o
build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o -L/usr/local/lib
-L/usr/local/lib64 -lfreetype -lstdc++ -lm -o
build/lib.linux-x86_64-2.7/matplotlib/ft2font.so
/usr/bin/ld: /usr/local/lib64/libstdc++.a(si_class_type_info.o): relocation
R_X86_64_32S against `_ZTVN10__cxxabiv120__si_class_type_infoE' can not be
used when making a shared object; recompile with -fPIC
/usr/local/lib64/libstdc++.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1

I then tried the same with Matplotlib 1.4.3 (why not?) and got the same
results.

What's going on here?

Thanks so much for any help.

Fausto

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-1-4-2-1-4-3-doesn-t-install-from-source-tp46170.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

The issue is that python c-extensions (which mpl uses to provide some of
the underlying rendering logic) are basically shared libraries (*.so), the
version of libstdc++ that your compiler is finding is a static library
(/usr/local/lib64/libstdc++.a) which is not suitable for linking into a
so. Are you sure you have all the development packages installed for your
OS?

I also strongly suggest against doing `sudo python setup.py install` unless
you are absolutely sure you know what you are doing. It is much safer to
use virtual envs / conda envs so that you can compile/install into user
space.

Tom

···

On Fri, Oct 9, 2015 at 7:19 AM fbarbuto <fausto_barbuto at yahoo.ca> wrote:

Hello,

I have Matplotlib 1.3.1 installed on my Ubuntu 14.04 system and thought it
was time to upgrade to 1.4.2. I never get the latest version for
compatibility reasons (some packages that use Matplotlib might stop
working). I then downloaded the tarball, uncompressed its contents into a
folder and executed "sudo python setup.py build". However, I got the
following error (last few lines only):

c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g
-fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g
-fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security
build/temp.linux-x86_64-2.7/src/ft2font.o
build/temp.linux-x86_64-2.7/src/mplutils.o
build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o
build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o
build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o
build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o -L/usr/local/lib
-L/usr/local/lib64 -lfreetype -lstdc++ -lm -o
build/lib.linux-x86_64-2.7/matplotlib/ft2font.so
/usr/bin/ld: /usr/local/lib64/libstdc++.a(si_class_type_info.o): relocation
R_X86_64_32S against `_ZTVN10__cxxabiv120__si_class_type_infoE' can not be
used when making a shared object; recompile with -fPIC
/usr/local/lib64/libstdc++.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1

I then tried the same with Matplotlib 1.4.3 (why not?) and got the same
results.

What's going on here?

Thanks so much for any help.

Fausto

--
View this message in context:
http://matplotlib.1069221.n5.nabble.com/Matplotlib-1-4-2-1-4-3-doesn-t-install-from-source-tp46170.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20151012/22566f8c/attachment-0001.html>

The issue is that python c-extensions (which mpl uses to provide some of
the underlying rendering logic) are basically shared libraries (*.so),
the version of libstdc++ that your compiler is finding is a static
library (/usr/local/lib64/libstdc++.a) which is not suitable for linking
into a so. Are you sure you have all the development packages installed
for your OS?

It's odd that something like libstdc++ is being found in /usr/local.
This is not the ubuntu version. It sounds like the basic problem is that
some earlier manual installation of software has messed up your
development environment; files in /usr/local are masking the files from
the ubuntu distro.

Eric

···

On 2015/10/11 4:54 PM, Thomas Caswell wrote:

I also strongly suggest against doing `sudo python setup.py install`
unless you are absolutely sure you know what you are doing. It is much
safer to use virtual envs / conda envs so that you can compile/install
into user space.

Tom

On Fri, Oct 9, 2015 at 7:19 AM fbarbuto <fausto_barbuto at yahoo.ca > <mailto:fausto_barbuto at yahoo.ca>> wrote:

    Hello,

    I have Matplotlib 1.3.1 installed on my Ubuntu 14.04 system and
    thought it
    was time to upgrade to 1.4.2. I never get the latest version for
    compatibility reasons (some packages that use Matplotlib might stop
    working). I then downloaded the tarball, uncompressed its contents
    into a
    folder and executed "sudo python setup.py build". However, I got the
    following error (last few lines only):

    c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
    -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g
    -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g
    -fstack-protector --param=ssp-buffer-size=4 -Wformat
    -Werror=format-security
    build/temp.linux-x86_64-2.7/src/ft2font.o
    build/temp.linux-x86_64-2.7/src/mplutils.o
    build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o
    build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o
    build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o
    build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o -L/usr/local/lib
    -L/usr/local/lib64 -lfreetype -lstdc++ -lm -o
    build/lib.linux-x86_64-2.7/matplotlib/ft2font.so
    /usr/bin/ld: /usr/local/lib64/libstdc++.a(si_class_type_info.o):
    relocation
    R_X86_64_32S against `_ZTVN10__cxxabiv120__si_class_type_infoE' can
    not be
    used when making a shared object; recompile with -fPIC
    /usr/local/lib64/libstdc++.a: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    error: command 'c++' failed with exit status 1

    I then tried the same with Matplotlib 1.4.3 (why not?) and got the same
    results.

    What's going on here?

    Thanks so much for any help.

    Fausto

    --
    View this message in context:
    http://matplotlib.1069221.n5.nabble.com/Matplotlib-1-4-2-1-4-3-doesn-t-install-from-source-tp46170.html
    Sent from the matplotlib - users mailing list archive at Nabble.com.
    _______________________________________________
    Matplotlib-users mailing list
    Matplotlib-users at python.org <mailto:Matplotlib-users at python.org>
    https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

Hi,

It's odd that something like libstdc++ is being found in /usr/local.
This is not the ubuntu version. It sounds like the basic problem is that
some earlier manual installation of software has messed up your
development environment; files in /usr/local are masking the files from
the ubuntu distro.

There are indeed two "versions" of libstdc++.a on my computer, and they're
different in size:

fausto at fausto:/$ sudo find -name "libstdc++.a" -print
./usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a
./usr/local/lib64/libstdc++.a
fausto at fausto:/$ ls -la /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a
-rw-r--r-- 1 root root 2900518 Mai 14 15:45 /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a
fausto at fausto:/$ ls -la /usr/local/lib64/libstdc++.a
-rw-r--r-- 1 root root 16713082 Abr 21 18:55 /usr/local/lib64/libstdc++.a

I wonder what package placed the 2nd version into /usr/local/lib64 and how
to get rid of it (I'm not even sure if I should do that). Apparently, all

is working fine here (aside from the aforementioned problems with Matplotlib
1.43/1.4.2).

Fausto

···

On Monday, October 12, 2015 1:48 PM, Eric Firing [via matplotlib] <ml-node+s1069221n46319h88 at n5.nabble.com> wrote:

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Matplotlib-1-4-2-1-4-3-doesn-t-install-from-source-tp46170p46321.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20151013/17f7a183/attachment.html>