[Pyrex] compiling more .pyx and .pxd files into one .so
Alexander Belchenko
bialix at ukr.net
Sat Sep 15 13:43:56 CEST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Gustavo Sverzut Barbieri пишет:
> On 9/14/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>> Stefano Esposito wrote:
>>> Is it possible to write several pyx and pxd files and have 'em
>> > compiled into an unique shared object?
>>
>> It ought to be possible, but would need a bit of hacking.
>> One possibility that comes to mind is to choose one of the
>> .pyx files to be the "main" one that you import from Python,
>> and put explicit calls to the module initialisation functions
>> of the other modules in it. Then link all the .o files together
>> into a single shared object named after the main module.
>>
>> I'm not sure whether you could do this with distutils --
>> you might need to use a makefile or some such to do the
>> compiling and linking.
>>
>> I may add support for this kind of thing to Pyrex at some
>> point.
>
> It would be great.
>
> Right now I do "include 'file.pyx'", but it sucks due lack of
> dependency tracking and I have to "touch main.pyx" to get it rebuilt.
Much worse is namespace pollution that you have in this case.
[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFG68V8zYr338mxwCURAgg/AKCTsF/RKDZ6wIfEnCZW4i4ChCzr5ACfdMxM
WtXkp4B/iSXXUJfrXFfk1iI=
=+a/6
-----END PGP SIGNATURE-----
More information about the Pyrex
mailing list