Bug 1200 - ./waf install doesn't install Python bindings properly
./waf install doesn't install Python bindings properly
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: python bindings
pre-release
All All
: P5 normal
Assigned To: Gustavo J. A. M. Carneiro
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-26 08:15 UTC by Vedran Miletić
Modified: 2011-07-12 06:03 UTC (History)
1 user (show)

See Also:


Attachments
Non-working attempt at making a patch (2.73 KB, patch)
2011-06-26 08:23 UTC, Vedran Miletić
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vedran Miletić 2011-06-26 08:15:01 UTC
Currently doing ./waf install doesn't install Python bindings properly, *.so files get copied into /usr/lib instead of copying contents of build/release/bindings/python to /usr/lib64/python2.X/site-packages/ (or dist-packages or something similar).
Comment 1 Vedran Miletić 2011-06-26 08:23:29 UTC
Created attachment 1175 [details]
Non-working attempt at making a patch
Comment 2 Gustavo J. A. M. Carneiro 2011-07-05 14:17:07 UTC
changeset:   7348:9372b57a6ce4
tag:         tip
user:        Gustavo J. A. M. Carneiro  <gjc@inescporto.pt>
date:        Tue Jul 05 19:16:47 2011 +0100
summary:     Bug 1200 - ./waf install doesn't install Python bindings properly
Comment 3 Vedran Miletić 2011-07-07 14:26:24 UTC
It works much better now, but still not perfect. Namely, regardless of libdir setting, Python bindings get installed into {prefix}/lib/python2.7/site-packages. Fedora puts all Python bindings that have arch-dependant .so files under lib64.
Comment 4 Gustavo J. A. M. Carneiro 2011-07-07 19:17:15 UTC
I think I know how to fix it.
Comment 5 Vedran Miletić 2011-07-08 03:35:11 UTC
Great.
Comment 6 Gustavo J. A. M. Carneiro 2011-07-11 09:26:38 UTC
I think this should fix it; please test, reopen if not fixed.

changeset:   7363:0f96f5beb8c7
tag:         tip
user:        Gustavo J. A. M. Carneiro  <gjc@inescporto.pt>
date:        Mon Jul 11 14:24:59 2011 +0100
summary:     Bug 1200 - ./waf install doesn't install Python bindings properly
Comment 7 Vedran Miletić 2011-07-11 09:43:07 UTC
They still get installed into lib instead of lib64. I'm using

./waf configure --prefix=/usr --libdir /usr/lib64

and Python bindings get installed into /usr/lib/python2.7/site-packages/ns

As before, that works, but it will not be acceptable for RPM package.

Couldn't sys.path help somehow?
Comment 8 Gustavo J. A. M. Carneiro 2011-07-11 13:21:53 UTC
Could you please test this change and see if it helps?  Basically, just add the parameter plat_specific=1 to the get_python_lib() call...


diff -r 0f96f5beb8c7 bindings/python/wscript
--- a/bindings/python/wscript	Mon Jul 11 14:24:59 2011 +0100
+++ b/bindings/python/wscript	Mon Jul 11 18:20:50 2011 +0100
@@ -121,7 +121,7 @@
         pydir = conf.environ['PYTHONDIR']
     else:
         (pydir,) = _get_python_variables(conf.env['PYTHON'],
-                                         ["get_python_lib(standard_lib=0, prefix=%r)" % conf.env['PREFIX']],
+                                         ["get_python_lib(plat_specific=1, standard_lib=0, prefix=%r)" % conf.env['PREFIX']],
                                          ['from distutils.sysconfig import get_python_lib'])
     if hasattr(conf, 'define'): # conf.define is added by the C tool, so may not exist
         conf.define('PYTHONDIR', pydir)
Comment 9 Vedran Miletić 2011-07-11 15:04:13 UTC
Yes, this one works.
Comment 10 Gustavo J. A. M. Carneiro 2011-07-12 06:03:01 UTC
changeset:   7364:80940903b711
tag:         tip
user:        Gustavo J. A. M. Carneiro  <gjc@inescporto.pt>
date:        Tue Jul 12 11:02:40 2011 +0100
summary:     Bug 1200 again: fix pyext install path on fedora x86_64