[Cython] Multiple modules in one compilation unit

Dag Sverre Seljebotn d.s.seljebotn at astro.uio.no
Wed Mar 2 16:37:16 CET 2011

On 03/02/2011 04:11 PM, Lisandro Dalcin wrote:
> On 2 March 2011 08:35, Stefan Behnel<stefan_ml at behnel.de>  wrote:
>> Dag Sverre Seljebotn, 02.03.2011 11:54:
>>> Problem is that Fortran code often has...interesting...programming
>>> practices. Global variables abound, and are often initialised between
>>> modules. Imagine:
>>> settings_mod.set_alpha(0.34)
>>> print compute_mod.get_alpha_squared()
>>> This behaves quite differently with two static versions rather than one...
>> Then I'd suggest always linking dynamically.
> And where are you going to put your fortran shared libraries? Dynamic
> linking details varies wildly across platforms... I'm very much
> understand Dag's use case and concerns, and I do think that some
> research in all this is worth it.

I'm not sure if there's much more to research at the moment -- Stefan 
says it is possible, and that's what I wanted to know at this stage. If 
I want it, I obviously need to implement it myself. (And if such a patch 
implements PEP 3121 and there's a demonstrated need for it with some 
users, I really can't see it getting rejected just out of it being in 
"poor taste").

I.e., I'm going to make Fwrap spit out multiple pyx files and worry 
about this later. If multiple .pyx in one .so was fundamentally 
impossible, I might have gone another route with Fwrap. That was all.

Thanks Stefan!,

Dag Sverre

More information about the cython-devel mailing list