Hi Stefan > Python extension modules may not depend on each other in that way. > (Arguably that is a Good Thing, as it avoids possible ABI compatibility > issues.) > What I suggest you do is either refactor the code such that your > extensions 'a' and 'b' both link to a shared library 'c' which provides > the symbols used by both.
If the real problem would be as in the example I would definitely go with this approach (I even tried to do so). However, the real problem is more complex. The functions in 'a' call Python API and numpy API functions. Thus, when distutils builds the code it does this according to a particular Python version. So building a single shared library would not help too much. > 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). regards Eugen
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org https://mail.python.org/mailman/listinfo/cplusplus-sig