On 28/10/14 06:46 AM, Wintersberger, Eugen wrote:
> Hi Stefan
>
> On Fri, 2014-10-24 at 07:12 -0400, Stefan Seefeld wrote:
>> ....
>>>> Alternatively you could try to reduce the
>>>> dependency to only exist at the Python interface level, such that using
>>>> 'b' requires 'a' being loaded (for example to enable type converters
>>>> defined in 'a' but used in 'b'), but without any direct ABI dependencies
>>>> between 'a' and 'b'.
>>> This is interesting as it is much closer to my real problem. Extension
>>> 'a' provides some converters from numpy objects to my own C++ types and
>>> back. And these guys I would like to use in 'b' (along with some other
>>> numpy utility functions).
>> And why is that approach then not working for you ?
>>
>>     Stefan
>>
> Well, I think I found a solution. However, I have no idea how to do this
> with distutils. As you suggested I will build a shared library with the
> common code but bound to a particular Python version. It should be
> installed in 
>
> $PREFIX/lib/pythonX.Y/some more directories
>
> and header files to 
>
> $PREFIX/include/pythonX.Y/some more directories
>
> What I still do not know is how to build the extension module along with
> the shared library with distutils ;). I guess I will put this question
> on the Python list - or maybe someone at this list has an idea how to do
> this. 
> Thanks for all your efforts so far. 

Eugen,

For avoidance of doubt, I don't think I'm able to help you with that. I
have used distutils in the past, but found it pretty limited in its
support of extension modules.
I ended up adding a few custom commands to build pure C++ libraries
(specifically for dependencies shared by multiple extension modules).
That was never particularly elegant or generic, and so I don't think
it's worth reusing this.

An example of this you can find in
https://github.com/stefanseefeld/synopsis/tree/master/Synopsis/dist (in
case you are brave enough :-) ). I haven't touched that code in quite a
while, and there may be much better solutions these days using more
modern substitutes for the distutils package.

Regards,
        Stefan


-- 

      ...ich hab' noch einen Koffer in Berlin...

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to