Closed GoogleCodeExporter closed 9 years ago
Are you trying to install "gmpy" or "gmpy2" ? gmpy is the mature version and
gmpy2 is the new/next version. The current version of gmpy is included in the
Fedora Core 16 repositories.
Anyway, I tried using pip. Even though I specified "gmpy", it still downloaded
the "gmpy2" source code. This is a bug in pip. It believes gmpy2-x.x.x is a
later version than gmpy-x.x.x. It doesn't understand that they are different
libraries.
If you are trying to install gmpy2, it requires later versions of GMP (5.0.x)
and MPFR (3.1.0) than the versions included with Fedora Core 16 (4.3.2/3.0.0).
Can you try the installation instructions at
http://readthedocs.org/docs/gmpy2/en/latest/intro.html#installing-gmpy2-on-unix-
linux ?
I haven't figured out how to make pip pass custom build options to my setup.py
so the above instructions are the only way I know to build gmpy2.
Original comment by casevh
on 15 Apr 2012 at 6:08
Original comment by casevh
on 15 Apr 2012 at 6:08
I entered "pip install gmpy" as "gmpy2" doesn't find any package.
Hm. Good to know about the GMP library incompatibilities. However, I doubt that
this is the issue at hand, because it seems to me that it tries to compile for
32 bit machines whereas I'm building on a 64bit machine.
Original comment by 4tmue...@gmail.com
on 15 Apr 2012 at 6:16
I can get gmpy2 to start building and then it fails due to missing mpfr.h file.
But prior to that, I have the following output:
building 'gmpy2' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DWITHMPFR=1 -DWITHMPC=1 -I/usr/include/python2.7 -c src/gmpy2.c -o build/temp.linux-x86_64-2.7/src/gmpy2.o
I'm on a 64-bit Fedora system. Are you sure your version of Python is a 64-bit
version? What is the output of:
python-config --cflags
All the compiler flags should come from there. gmpy2 doesn't change any of the
compiler flags.
Original comment by casevh
on 15 Apr 2012 at 6:29
$ python-config --cflags
-I/usr/include/python2.7 -I/usr/include/python2.7 -fno-strict-aliasing -O2 -g
-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv
-DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE
-fPIC -fwrapv
$
So something mangles the CFLAGS.
And I am pretty sure that I have a 64bit python, but I lack any more
sophisticated tests than the following:
$ type -a python
python is /usr/bin/python
$ file /usr/bin/python
/usr/bin/python: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped
$
Original comment by 4tmue...@gmail.com
on 15 Apr 2012 at 6:36
Strange. The pip build line also includes -mtune=atom.
Is there any helpful information in ~/.pip/pip.log ?
Original comment by casevh
on 15 Apr 2012 at 6:47
nope, but it might be interesting for you to debug the versioning issue as it
seems to scan the googlecode website. But I couldn't find anything regarding
this compiling issue.
Original comment by 4tmue...@gmail.com
on 15 Apr 2012 at 6:50
Attachments:
I notice that it is calling /tmp/tmpweek5/bin/python . On my system, it calls
/usr/bin/python. I'm not using virtualenv so I don't know if that is causing
the issue. After I installed the gmp 4.3.2 development package, the following
worked to install gmpy 1.15:
sudo pip install --upgrade gmpy==1.15
At the moment, I think the only way to build gmpy2 is use python's native build
tools as in the documentation link I included earlier.
I'll file a bug report with pip regarding their logic for finding versions.
Original comment by casevh
on 15 Apr 2012 at 7:06
I submitted a big report for the version finding login to pip and it should be
fixed in the next release. I've added comments to
http://code.google.com/p/gmpy/ with comments on how to build with pip. I was
able to build both gmpy 1.15 and gmpy2 2.0.0b1 by following those instructions
on a 64-bit Fedora Core 16 system.
Original comment by casevh
on 19 Apr 2012 at 7:37
I had the same problem with psycopg2 and lxml and after a lot of effort tracked
the problem down.
PYTHONPATH=/usr/lib64/python2.7 pip install <package name>
Obviously the PYTHONPATH is set to my 64 bit python installation. You will need
to change that to point to your one.
This forces the 64bit version of all python packages to the front of pythons
search path.
What I found from strace() was that it looked for a match under
/usr/lib/python2.7/<whatever>
/usr/lib64/python2.7/<whatever>
If, like me, you have both a 32bit and 64bit version of python installed on
your machine then the 32bit version of some files get picked up.
Specifically in this case the /usr/lib/python2.7/config/Makefile is being
picked up. And that is setting the CFLAGS to "-mtune=atom -m32" etc
Hope that helps someone out there from having to fire up strace! ;-)
Cheers
johnoc
Original comment by joh...@gmail.com
on 2 May 2012 at 4:21
hm interestingly enough, I had the file:
$ rpm -qf /usr/lib/python2.7/config/Makefile
python-libs-2.7.2-5.2.fc16.i686
$ rpm -q --whatrequires python-libs-2.7.2-5.2.fc16.i686
no package requires python-libs-2.7.2-5.2.fc16.i686
$
I deleted that orphaned package and it looks better now.
Original comment by 4tmue...@gmail.com
on 9 May 2012 at 3:03
johnoc, thanks for your help!
4tmuelle, thanks for reporting that it's working!
Original comment by casevh
on 10 May 2012 at 4:42
Original issue reported on code.google.com by
4tmue...@gmail.com
on 15 Apr 2012 at 5:10