Matplotlib Installation Question on Centos 7

Hi Peter,

I'm working on a CentOS 7 system. I can't answer your question directly,
but I would advise installing anaconda. It makes all this stuff much
simpler and keeps your local environment cleanly separated from the system
wide one.

Regards,
Jon

···

Date: Thu, 7 Mar 2019 11:36:09 +0000
From: Peter Chiu - UKRI STFC <peter.chiu at stfc.ac.uk>
To: "matplotlib-users at python.org" <matplotlib-users at python.org>
Subject: [Matplotlib-users] Matplotlib Installation Question on Centos
        7
Message-ID: <f9072eaff66a4015b6117b295bc06da3 at stfc.ac.uk>
Content-Type: text/plain; charset="us-ascii"

Hello,

This is a novice question and hopefully someone can advise.

In order to support a software package for the LOFAR project,
I am trying to install Matplotlib on a centos 7 system:

   python setup.py build_ext
--include-dirs=/usr/local/lofar3_2/local/release/include

it complains at the point:

g++ -pthread -shared build/temp.linux-x86_64-2.7/src/_ttconv.o \
build/temp.linux-x86_64-2.7/ttconv/pprdrv_tt.o \
build/temp.linux-x86_64-2.7/ttconv/pprdrv_tt2.o \
build/temp.linux-x86_64-2.7/ttconv/ttutil.o \
-L/usr/local/lib -L/usr/lib -L/usr/local/lib64 -L/usr/lib64 \
-L/usr/local/lofar3_2/local/release/lib -lpython2.7 \
-o build/lib.linux-x86_64-2.7/matplotlib/ttconv.so
/usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_tmpnam':
/usr/local/lofar/python/src/Python-2.7.8/./Modules/posixmodule.c:7575:
warning:
the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_tempnam':
/usr/local/lofar/python/src/Python-2.7.8/./Modules/posixmodule.c:7522:
warning:
the use of `tempnam' is dangerous, better use `mkstemp'
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): \
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when
making a shared object; recompile with -fPIC
...
/usr/bin/ld: /usr/local/lib/libpython2.7.a(getcompiler.o): \
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

Prior to that, I have already installed a local version of python in a
separate folder.
If I then manually move the switch

-L/usr/local/lofar3_2/local/release/lib \

before

-L/usr/local/lib

it will then pick up the local library, and it will compile okay.

So my question is how to specify a local version of python library
to be used as preference as part of the python setup.py build_ext command.

I have tried the switch -library-dirs=..., --library=, and -rpath=
but none of them will make my local python library in preference
to that under /usr/local/lib.

Much grateful for any advice can be given.

Regards,

Peter

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

------------------------------

Subject: Digest Footer

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

------------------------------

End of Matplotlib-users Digest, Vol 44, Issue 3
***********************************************

--
Jonathan D. Slavin
Astrophysicist - High Energy Astrophysics Division
Center for Astrophysics | Harvard & Smithsonian
Office: (617) 496-7981 | Cell: (781) 363-0035
60 Garden Street | MS 83 | Cambridge, MA 02138
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20190307/a76c28bc/attachment.html>

Can you use the local version of python to run setup.py? It is not clear
to me what version of python you are compiling with.

Does the patch in https://github.com/matplotlib/matplotlib/pull/13064 help?

Failing that, as it looks like you are building matplotlib as part of an
integrated enviroment, I suggest patching `setup.py` and `setup_ext.py`
until it works...

Tom

···

On Thu, Mar 7, 2019 at 12:13 PM Slavin, Jonathan <jslavin at cfa.harvard.edu> wrote:

Hi Peter,

I'm working on a CentOS 7 system. I can't answer your question directly,
but I would advise installing anaconda. It makes all this stuff much
simpler and keeps your local environment cleanly separated from the system
wide one.

Regards,
Jon

Date: Thu, 7 Mar 2019 11:36:09 +0000
From: Peter Chiu - UKRI STFC <peter.chiu at stfc.ac.uk>
To: "matplotlib-users at python.org" <matplotlib-users at python.org>
Subject: [Matplotlib-users] Matplotlib Installation Question on Centos
        7
Message-ID: <f9072eaff66a4015b6117b295bc06da3 at stfc.ac.uk>
Content-Type: text/plain; charset="us-ascii"

Hello,

This is a novice question and hopefully someone can advise.

In order to support a software package for the LOFAR project,
I am trying to install Matplotlib on a centos 7 system:

   python setup.py build_ext
--include-dirs=/usr/local/lofar3_2/local/release/include

it complains at the point:

g++ -pthread -shared build/temp.linux-x86_64-2.7/src/_ttconv.o \
build/temp.linux-x86_64-2.7/ttconv/pprdrv_tt.o \
build/temp.linux-x86_64-2.7/ttconv/pprdrv_tt2.o \
build/temp.linux-x86_64-2.7/ttconv/ttutil.o \
-L/usr/local/lib -L/usr/lib -L/usr/local/lib64 -L/usr/lib64 \
-L/usr/local/lofar3_2/local/release/lib -lpython2.7 \
-o build/lib.linux-x86_64-2.7/matplotlib/ttconv.so
/usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_tmpnam':
/usr/local/lofar/python/src/Python-2.7.8/./Modules/posixmodule.c:7575:
warning:
the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_tempnam':
/usr/local/lofar/python/src/Python-2.7.8/./Modules/posixmodule.c:7522:
warning:
the use of `tempnam' is dangerous, better use `mkstemp'
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): \
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when
making a shared object; recompile with -fPIC
...
/usr/bin/ld: /usr/local/lib/libpython2.7.a(getcompiler.o): \
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

Prior to that, I have already installed a local version of python in a
separate folder.
If I then manually move the switch

-L/usr/local/lofar3_2/local/release/lib \

before

-L/usr/local/lib

it will then pick up the local library, and it will compile okay.

So my question is how to specify a local version of python library
to be used as preference as part of the python setup.py build_ext command.

I have tried the switch -library-dirs=..., --library=, and -rpath=
but none of them will make my local python library in preference
to that under /usr/local/lib.

Much grateful for any advice can be given.

Regards,

Peter

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

------------------------------

Subject: Digest Footer

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

------------------------------

End of Matplotlib-users Digest, Vol 44, Issue 3
***********************************************

--
Jonathan D. Slavin
Astrophysicist - High Energy Astrophysics Division
Center for Astrophysics | Harvard & Smithsonian
Office: (617) 496-7981 | Cell: (781) 363-0035
60 Garden Street | MS 83 | Cambridge, MA 02138

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

--
Thomas Caswell
tcaswell at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20190313/de5109cc/attachment-0001.html>

The patch at https://github.com/matplotlib/matplotlib/pull/13064 will
likely not work on old matplotlibs/py2, but perhaps patching get_base_dirs
to return an empty list (as suggested in
https://github.com/matplotlib/matplotlib/issues/9737) (and then fixing any
downstream breakage) will...
Antony

···

On Wed, Mar 13, 2019 at 2:23 PM Thomas Caswell <tcaswell at gmail.com> wrote:

Can you use the local version of python to run setup.py? It is not clear
to me what version of python you are compiling with.

Does the patch in https://github.com/matplotlib/matplotlib/pull/13064
help?

Failing that, as it looks like you are building matplotlib as part of an
integrated enviroment, I suggest patching `setup.py` and `setup_ext.py`
until it works...

Tom

On Thu, Mar 7, 2019 at 12:13 PM Slavin, Jonathan <jslavin at cfa.harvard.edu> > wrote:

Hi Peter,

I'm working on a CentOS 7 system. I can't answer your question directly,
but I would advise installing anaconda. It makes all this stuff much
simpler and keeps your local environment cleanly separated from the system
wide one.

Regards,
Jon

Date: Thu, 7 Mar 2019 11:36:09 +0000
From: Peter Chiu - UKRI STFC <peter.chiu at stfc.ac.uk>
To: "matplotlib-users at python.org" <matplotlib-users at python.org>
Subject: [Matplotlib-users] Matplotlib Installation Question on Centos
        7
Message-ID: <f9072eaff66a4015b6117b295bc06da3 at stfc.ac.uk>
Content-Type: text/plain; charset="us-ascii"

Hello,

This is a novice question and hopefully someone can advise.

In order to support a software package for the LOFAR project,
I am trying to install Matplotlib on a centos 7 system:

   python setup.py build_ext
--include-dirs=/usr/local/lofar3_2/local/release/include

it complains at the point:

g++ -pthread -shared build/temp.linux-x86_64-2.7/src/_ttconv.o \
build/temp.linux-x86_64-2.7/ttconv/pprdrv_tt.o \
build/temp.linux-x86_64-2.7/ttconv/pprdrv_tt2.o \
build/temp.linux-x86_64-2.7/ttconv/ttutil.o \
-L/usr/local/lib -L/usr/lib -L/usr/local/lib64 -L/usr/lib64 \
-L/usr/local/lofar3_2/local/release/lib -lpython2.7 \
-o build/lib.linux-x86_64-2.7/matplotlib/ttconv.so
/usr/local/lib/libpython2.7.a(posixmodule.o): In function `posix_tmpnam':
/usr/local/lofar/python/src/Python-2.7.8/./Modules/posixmodule.c:7575:
warning:
the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/local/lib/libpython2.7.a(posixmodule.o): In function
`posix_tempnam':
/usr/local/lofar/python/src/Python-2.7.8/./Modules/posixmodule.c:7522:
warning:
the use of `tempnam' is dangerous, better use `mkstemp'
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): \
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when
making a shared object; recompile with -fPIC
...
/usr/bin/ld: /usr/local/lib/libpython2.7.a(getcompiler.o): \
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1

Prior to that, I have already installed a local version of python in a
separate folder.
If I then manually move the switch

-L/usr/local/lofar3_2/local/release/lib \

before

-L/usr/local/lib

it will then pick up the local library, and it will compile okay.

So my question is how to specify a local version of python library
to be used as preference as part of the python setup.py build_ext
command.

I have tried the switch -library-dirs=..., --library=, and -rpath=
but none of them will make my local python library in preference
to that under /usr/local/lib.

Much grateful for any advice can be given.

Regards,

Peter

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

------------------------------

Subject: Digest Footer

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

------------------------------

End of Matplotlib-users Digest, Vol 44, Issue 3
***********************************************

--
Jonathan D. Slavin
Astrophysicist - High Energy Astrophysics Division
Center for Astrophysics | Harvard & Smithsonian
Office: (617) 496-7981 | Cell: (781) 363-0035
60 Garden Street | MS 83 | Cambridge, MA 02138

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

--
Thomas Caswell
tcaswell at gmail.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/20190313/6f2f678e/attachment.html>