[lttng-dev] cross-compiling lttng-ust and python version

Gerlando Falauto gerlando.falauto at keymile.com
Mon May 12 10:24:14 EDT 2014


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__

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



More information about the lttng-dev mailing list