[Matplotlib-users] Matplotlib Installation Question on Centos 7

Peter Chiu - UKRI STFC peter.chiu at stfc.ac.uk
Thu Mar 7 06:36:09 EST 2019


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.html>


More information about the Matplotlib-users mailing list