Trouble building p14p v10 on Mac OSX

54 views
Skip to first unread message

Brad Minch

unread,
Apr 24, 2013, 8:06:43 PM4/24/13
to python-o...@googlegroups.com
Hi everyone,

I have been following the development of python-on-a-chip for a couple of years now and would like to get started with it.  I would eventually like to work with p14p v10 on a pic24 platform, but because I am new to p14p and to SCons, I wanted to start out with the posix64 platform.  I am working on a MacBook Air running Mac OSX version 10.7.5.  When I run SCons to build the posix64 platform, I get "AssertionError: P14p REQUIRES CPython 2.6.x in order to support the correct bytecodes" when it gets to line 30 of src/tools/pmCoCreator.py.  When I print sys.version_info[0] and sys.version_info[1], I get '2' and '7', so apparently a version of Python 2.7 is running at that point in the build process.

I was well aware that Python 2.6 is required by p14p, so, prior to running SCons, I had switched my default version of Python from 2.7.1 to 2.6.7 by setting an the VERSIONER_PYTHON_VERSION environment variable to 2.6, as described in Apple's Python man page.  I had also added the line

env = Environment(ENV = os.environ)

to the default SConstruct file in an effort to propagate my entire external environment to the build commands, as described in the SCons FAQ located here in the answer to the question "Why doesn't SCons find my compiler/linker/etc.? I can execute it just fine from the command line."  If I import sys and print sys.version_info[0] and sys.version_info[1] in the SConstruct file, I get '2' and '6', so apparently Python 2.6 is running at the top level of the build process.

Last June, I had started down this road and had a similar issue on my old Mac under OSX version 10.5.8, only at that time, SCons was defaulting to Python 2.5 instead of Python 2.7.  I corresponded briefly with Dean, and he suggested it was probably because SCons creates its own build environment and that I would probably need to propagate my environment variable to SCons, which is why I added the line to SConstruct file.  I switched computers soon thereafter and never got back around to p14p.

Does anyone out there have any ideas what might be going on here and any suggestions as to how I might proceed?  Also, has anyone gotten the pic24 platform to build in p14p v10?

Thanks,
Brad Minch.

Brad Minch

unread,
Apr 24, 2013, 8:52:39 PM4/24/13
to python-o...@googlegroups.com
P.S. - Sorry for the nearly duplicate post.  I thought I had lost the first one.

Brad.

Brad Minch

unread,
Apr 30, 2013, 3:16:00 PM4/30/13
to python-o...@googlegroups.com
Hi everyone,

As an update, I made my way through the SCons users guide and figured out how to add the VERSIONER_PYTHON_VERSION environment variable to the execution environment of the build commands.  Once I did that, it got part way through the build process for the posix64 platform.  It crapped out during the build of srtobj.c, with the following output:

src/platform/posix64/build/vm/strobj.c: In function 'string_format':
src/platform/posix64/build/vm/strobj.c:339:13: error: variable 'smallfmtcstr' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
scons: *** [src/platform/posix64/build/vm/strobj.o] Error 1
scons: building terminated because of errors.

I removed the -Werror option and the build went all the way through successfully.  

Another issue that came up during this build, which may be of more general interest is that with SCons v.2.3.0, support for pre-2.7.0 versions of Python has been deprecated.  I received the following warning during the build:

scons: warning: Support for pre-2.7.0 Python version (2.6.7) is deprecated.
    If this will cause hardship, contact d...@scons.tigris.org.

If p14p is going to continue requiring Python 2.6, it may get more difficult to build with the most recent release of SCons.  Perhaps someone should contact the SCons developers...

Now I am off to see if I can get the pic24 platform to build with SCons and MPLAB X...  If anyone has done so successfully, I would love to hear about it!

Best,
Brad Minch.

pir...@gmail.com

unread,
Apr 30, 2013, 3:44:24 PM4/30/13
to python-o...@googlegroups.com
> If p14p is going to continue requiring Python 2.6, it may get more difficult
> to build with the most recent release of SCons. Perhaps someone should
> contact the SCons developers...
>
I find it way better to improve P14p to support Python 2.7. The
problem was that Python 2.7 was building some bytecodes that PyMite,
based on v2.6, found them as garbage and crashed. Dean, can we help
you in something with this?


--
"Si quieres viajar alrededor del mundo y ser invitado a hablar en un
monton de sitios diferentes, simplemente escribe un sistema operativo
Unix."
– Linus Tordvals, creador del sistema operativo Linux
Reply all
Reply to author
Forward
0 new messages