[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IMP-dev] cross module dependencies



Daniel Russel wrote:
> How are cross-module python dependencies handled in the current build  
> system? If I just %import core.i in misc.i then swig tries to load a  
> module IMP_core rather than IMP.core. Changing the module name to  
> IMP.core in core.i doesn't work since swig declares macros using the  
> name and macros can't have "." in then.

I'm surprised Keren wasn't able to answer this one, because she ran into
the same problem a little while ago with Assembler. Yes, it's exactly as
you state. SWIG does the right thing at wrapping the modules and all of
the C++ inheritance is handled correctly, except for one point - any
Python inheritance results in an 'import IMP_core' in the Python code
rather than the correct 'import IMP.core', and we can't use "." in the
module names for various reasons (another is that I've never seen a DLL
or so with "." in the name, and it would probably cause problems
somewhere - underscores are almost always used for delimiters, e.g. in
the Boost shared objects). Keren currently handles this with a simple
sed of the generated Python module to replace IMP_core with IMP.core.
This obviously isn't a permanent solution, but I will look into better
long term fixes.

	Ben
-- 
                      http://salilab.org/~ben/
"It is a capital mistake to theorize before one has data."
	- Sir Arthur Conan Doyle