Bug 1218

Summary: Supply a mechanism to build python binding for multi-version of python
Product: ns-3 Reporter: YunQiang Su <wzssyqa>
Component: build systemAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: RESOLVED WORKSFORME    
Severity: normal CC: ns-bugs
Priority: P5    
Version: pre-release   
Hardware: All   
OS: All   

Description YunQiang Su 2011-07-14 02:15:14 EDT
For users, they may want to build python binding for non-default version of python.

For example, now 2.6 is the default version on Debian Unstable, but many users may want to build for python 2.7 or python 3.2.

I believe that we can supply a option that like:

  --build-for-python-version=2.6,2.7,3.2
or 
  --build-for-python-version=2.6:2.7:3.2

Note that, python 2.6.x are binary compatible, the same to python 2.7 and python 3.2.
Comment 1 Gustavo J. A. M. Carneiro 2011-08-01 10:20:22 EDT
Doesn't this work?

PYTHON=/usr/bin/pythonX.Y ./waf configure ...
Comment 2 Gustavo J. A. M. Carneiro 2011-08-18 11:35:29 EDT
(In reply to comment #1)
> Doesn't this work?
> 
> PYTHON=/usr/bin/pythonX.Y ./waf configure ...

I assume this works, if not reopen.
Comment 3 YunQiang Su 2011-08-18 11:44:23 EDT
I haven't test it.

Even if it works, and I believe that it is only called workaround not resolved.

It will caused much more bother when build and install.
Comment 4 Gustavo J. A. M. Carneiro 2011-08-18 11:49:49 EDT
(In reply to comment #3)
> I haven't test it.
> 
> Even if it works, and I believe that it is only called workaround not resolved.
> 
> It will caused much more bother when build and install.

This is not a workaround, it's the way all build systems work.  Even in autoconf based packages, you select the python version via PYTHON=/usr/bin/pythonX.Y ./configure ...  so I fail to see why this is an inconvenience just for ns-3.
Comment 5 YunQiang Su 2011-08-18 12:03:06 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > I haven't test it.
> > 
> > Even if it works, and I believe that it is only called workaround not resolved.
> > 
> > It will caused much more bother when build and install.
> 
> This is not a workaround, it's the way all build systems work.  Even in
> autoconf based packages, you select the python version via

Maybe it should be provided by autoconf,cmake,waf etc.

> PYTHON=/usr/bin/pythonX.Y ./configure ...  so I fail to see why this is an
> inconvenience just for ns-3.

Not just for ns-3, all of these are lack of this feather.


See here please: http://wiki.debian.org/SummerOfCode2011/PythonMultibuild
Comment 6 Gustavo J. A. M. Carneiro 2011-08-18 12:13:03 EDT
This is a different issue, to build for multiple python versions with a single command.

However, I remember how much effort it was to do the --enable-static-and-shared option, I'll hardly find time to do it again for the python bindings.  I'm sure it's great for distro maintainers to have all these nifty options, but it's hell for upstream maintainers :-/