Skip to contentSkip to conversation

cross-compiling lttng-ust and python version

DISCUSSION Jérémie Galarneau 2 participants 3 messages May 12, 2014 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · Gerlando Falauto

Hi,

I am trying to cross-compile lttng-ust for a powerpc platform.

Quoted 9 lines

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

Quoted 47 lines

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

(quoted diff) +1 -1
-#!/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
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Signature · 8 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): CA+jJMxtgFuLxCSLUNp=b7RqXsLJkvz+n+5rVZHz-1DYZRpvKdg@mail.gmail.com

#3 lore raw

Hi Jérémie,

Quoted 16 lines · Jérémie Galarneau
Quoted 4 lines · Gerlando Falauto

Hi,

I am trying to cross-compile lttng-ust for a powerpc platform.

Quoted 9 lines

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__

Quoted 3 lines

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)
Quoted 2 lines

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

Quoted 43 lines

Thanks,
Jérémie

Quoted 40 lines

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

(quoted diff) +1 -1
-#!/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.

Quoted 10 lines
Quoted 7 lines

Thank you!
Gerlando

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 56 lines · Gerlando Falauto

Hi Jérémie,

Quoted 18 lines · Jérémie Galarneau
Quoted 5 lines · Gerlando Falauto

Hi,

I am trying to cross-compile lttng-ust for a powerpc platform.

Quoted 9 lines

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__

Quoted 5 lines

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)
Quoted 2 lines

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
Quoted 6 lines
$ 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.

Make sure you also set the PYTHONPATH variable to search for the target's Python modules.

Regards,
Jérémie

Quoted 61 lines

Thank you,
Gerlando

Quoted 55 lines

Thanks,
Jérémie

Quoted 48 lines

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

(quoted diff) +1 -1
-#!/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
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Signature · 8 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev