Skip to contentSkip to conversation

Question regarding python, _sysconfigdata.py, and building C extension modules on the target...

DISCUSSION Bob Cochran 1 participant 2 messages Jun 2, 2015 – Jun 3, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

While building a python 2.7 C extension module on the target (e.g., python setup.py build) I found that I needed to modify /usr/lib64/python2.7/_sysconfigdata.py to successfully build the module.

I modified both CC and LDSHARE. For both, I removed --sysroot=/build/yocto/<project>/tmp/sysroots/<machine>'. And for LDSHARE, I added -L/lib64, so gcc_s could be found.

I'm wondering whether this is expected behavior or perhaps a bug. Perhaps I should have setup my environment differently for building a C extension module on the target?

I would appreciate any advice on the best way to rectify this so I can use a non-modified, generated rootfs to build C extension modules on my target.

I'm using poky fido (508c4cac320d) and building with a Freescale t1040 64bit (meta-fsl-ppc).

Thanks

Bob

#1 lore raw
Quoted 10 lines · Bob Cochran

Hi,

While building a python 2.7 C extension module on the target (e.g., python setup.py build) I found that I needed to modify /usr/lib64/python2.7/_sysconfigdata.py to successfully build the module.

I modified both CC and LDSHARE. For both, I removed --sysroot=/build/yocto/<project>/tmp/sysroots/<machine>'. And for LDSHARE, I added -L/lib64, so gcc_s could be found.

Quoted 7 lines

I'm wondering whether this is expected behavior or perhaps a bug. Perhaps I should have setup my environment differently for building a C extension module on the target?

I would appreciate any advice on the best way to rectify this so I can use a non-modified, generated rootfs to build C extension modules on my target.

For now, I modified my setup.py to include the following in my call to Extension():

                    include_dirs=['/usr/include'],
                    library_dirs=['/lib64'])

However, I don't think I should need to do this, and I didn't have to do this on targets (rootfs) generated by earlier poky releases. I'll keep digging...

Quoted 7 lines

I'm using poky fido (508c4cac320d) and building with a Freescale t1040 64bit (meta-fsl-ppc).

Thanks

Bob