[lttng-dev] cross-compiling lttng-ust and python version
Gerlando Falauto
gerlando.falauto at keymile.com
Mon May 12 13:57:10 EDT 2014
Hi Jérémie,
On 05/12/2014 07:31 PM, Jérémie Galarneau wrote:
> On Mon, May 12, 2014 at 10:24 AM, Gerlando Falauto
> <gerlando.falauto at keymile.com> wrote:
>> Hi,
>>
>> I am trying to cross-compile lttng-ust for a powerpc platform.
>>
>> I get the following error during make:
>>
>> ../../../tools/lttng-gen-tp -o sample_tracepoint.h sample_tracepoint.tp
>> 'import site' failed; use -v for traceback
>> Traceback (most recent call last):
>> File "../../../tools/lttng-gen-tp", line 19, in <module>
>> from __future__ import print_function
>> ImportError: No module named __future__
>>
>
> This module should be present in Python 2.7.
> Which versions are
> installed on your host system and on which distribution is this?
I only have Python 2.6:
$ python<tab>
python python2 python2.6 python2.6-config
python-config
$ python
python
Python 2.6.6 (r266:84292, Jan 22 2014, 05:06:49)
$ cat /etc/redhat-release
Scientific Linux release 6.5 (Carbon)
> Can you confirm the __future__.py file is present under
> /lib/python2.7/ on your system?
The point is, I'm not using a python version natively installed on my
system. I have a python2.7 available as soon as I enter the environment
for cross-compiling.
$ python2.7
Python 2.7.3 (default, Aug 2 2013, 20:37:10)
[GCC 4.7.2] on linux2
$ which python2.7
/opt/eldk/powerpc/sysroots/i686-eldk-linux/usr/bin/python2.7
and PYTHON=python2.7 is what I specified at the configure phase
(see my previous email at the bottom).
But this doesn't seem to help.
Thank you,
Gerlando
> Thanks,
> Jérémie
>
>> I believe the wrong python version is called ("python" instead of
>> "python2.7"), as the first line of tools/gen-tp reads:
>>
>> #!/usr/bin/env python
>>
>> Notice how I explicitly set the python version in my configure script:
>>
>> ac_cv_header_linux_perf_event_h=no PYTHON=python2.7 ./configure
>> --target=powerpc-linux --host=powerpc-linux --build=i686-linux
>> --with-libtool-sysroot=/opt/eldk/powerpc/sysroots/powerpc-linux
>> --prefix=/usr
>>
>> MAKEFLAGS= && DESTDIR=/opt/eldk/powerpc/sysroots/powerpc-linux make all
>> install install-strip pkgconfigdir=/tmp pkgconfig_DATA=
>>
>> Which doesn't seem to help in this case though.
>> Any idea how to fix this?
>>
>> I temporarily tried patching
>> -#!/usr/bin/env python
>> +#!/usr/bin/env python2.7
>>
>> which partially solves my problem; as a matter of fact, I get this new
>> error:
>>
>> File "../../../tools/lttng-gen-tp", line 24, in <module>
>> import subprocess
>> ImportError: No module named subprocess
>>
>> which is a somwhat different issue, as I'm now running python2.7 from the
>> sysroot of my cross-compiler environment (which doesn't apparently have
>> subprocess.py).
>>
>> $ which python2.7
>> /opt/eldk/powerpc/sysroots/i686-eldk-linux/usr/bin/python2.7
>>
>> Any suggestions here?
>> Even though it might look like the easiest solution, I'd rather not install
>> a native 2.7 (or higher) python version on my build machine.
>>
>> Thank you!
>> Gerlando
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev at lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
>
>
More information about the lttng-dev
mailing list