[Python-Dev] distutils mixes 32/64bit binaries (original) (raw)
Alexander Belopolsky alexander.belopolsky at gmail.com
Wed Apr 18 03:10:43 CEST 2007
- Previous message: [Python-Dev] Access to Python SVN
- Next message: [Python-Dev] minidom -> new-style classes?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On the platforms that can run both 32 and 64bit python, such as x86_64, distutils builds both 32 and 64 bit libraries in the same directory such as build/lib.linux-x86_64-2.5.
This can be easily fixed by placing 64 bit libraries in build/lib64.linux-x86_64-2.5 instead.
On the other hand it may be time to revisit use of os.uname in distutils' get_platform to determine the target directory. In the environments that can run python interpreters compiled for different architectures, distutils' get_platform should return the platform for which the interpreter was built, not the platform on which it runs.
Similar problem exists with the default install directory $prefix/lib/python2.5/lib-dynload. 64-bit libraries should probably go to $prefix/lib/python2.5/lib64-dynload instead.
I've noticed that there was a similar proposal to use $prefix/lib64 for 64bit binary components, but it was quickly rejected:
http://mail.python.org/pipermail/python-dev/2006-November/070044.html
In my view, following LSB spirit would suggest splitting pythonX.Y tree into platform dependent part (.so) that would go under prefix/liborprefix/lib or prefix/liborprefix/lib64 and a platform independent part (.py{,c,o}) that would go under $prefix/share. This, of course, would be a much bigger change than the lib64-dynload band aid that I am proposing here.
PS: As a data point, the R project has made the following changes to their program to deal with this issue:
""" o LDFLAGS now defaults to -L/usr/local/lib64 on most Linux 64-bit OSes (but not ia64). The use of lib/lib64 can be overridden by the new variable LIBnn.
o The default installation directory is now <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mi>p</mi><mi>r</mi><mi>e</mi><mi>f</mi><mi>i</mi><mi>x</mi></mrow><mi mathvariant="normal">/</mi></mrow><annotation encoding="application/x-tex">{prefix}/</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal">p</span><span class="mord mathnormal">re</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">i</span><span class="mord mathnormal">x</span></span><span class="mord">/</span></span></span></span>{LIBnn}/R,
/usr/local/lib64/R on most 64-bit Linux OSes and /usr/local/lib/R
elsewhere.
""" <https://stat.ethz.ch/pipermail/r-announce/2005/000802.html>
- Previous message: [Python-Dev] Access to Python SVN
- Next message: [Python-Dev] minidom -> new-style classes?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]