[lttng-dev] cross-compiling lttng-ust and python version
Jérémie Galarneau
jeremie.galarneau at efficios.com
Mon May 12 13:31:19 EDT 2014
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?
Can you confirm the __future__.py file is present under
/lib/python2.7/ on your system?
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
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list