Thursday, July 30, 2009

Bug in Bio++

I'm pretty sure that that's the reason for the failure to compile. There are two overloaded functions in TreeTemplateTools--one is called searchNodeWithId, and the other is searchNodeWithName. They're both pretty similar. Each one has two versions. One returns a list of Nodes, the other returns void and has the list of Nodes as one of the arguments, returning the value by reference.  Except...the argument-returned searchNodeWithName calls the return-value-returned searchNodeWithId, and it does it using the name as an argument. I believe this was just cut-and-pasted from the argument-returned searchNodeWithId.

The code is in TreeTemplateTools.h. If I modify it using the above assumption (that one version of searchNodeWithName should call the other version of the same), everything compiles wonderfully. However, I'm reluctant to call a bug report into the project, since I've only been looking through this code for a few months. I sent a query to the mailing list, asking if this is indeed a bug. Hopefully someone will get back to me.

Anyway, I managed to get everything in PhylLib to compile. There are warnings, but I believe that they're fine. A lot of the functions call one particular function, that throws exceptions. And it throws a more general exception before a more specific one. But I looked through the code, and there seem to be good reasons for doing it this way. However, it does mean that the wrapper C++ files complain vociferously, since this appears to be the "wrong way around." I believe it's fine.

Last step with PhylLib is to make sure that it runs within Python. That should be straight-forward. Basically, I just need to make sure that every function binding that should be defined, is. This means that I'll have to slightly modify the interface files for some of the static functions (basically, anything called *Tools.i), but it should be pretty easy. Then, on to PopGenLib. Hopefully that'll go much more quickly, since it has 1/3 the number of .h files (and therefore SWIG .i files).

No comments:

Post a Comment