Are you giving the building a big enough value? If you give a building 5% science with Iron, or any small value, the AI will only value it as 1.05 * current science rate. Either that or the AI doesn't have the resource, and so it won't benefit from the building.
Try setting the building to a high rate, like 500% gold with wheat, and make sure the AI has access to wheat. See what happens. If the AI doesn't build it quickly, we know there is a problem.
I think that's a good idea to test the modcomp. If it turns out that the AI still doesn't build the buildings I'm afraid I might be not of much help, because this is the only SDK work I've done so far. To make the AI regonize the bonus I've basically searched the whole CvCityAI for 'getCommerceModifier' and added the same code with 'getBonusCommerceModifier' and a loop for all bonuses. For example, this
becomes this:
Now looking at the code again I see two things that could explain wrong behavior of the AI. The first part of the new code was completely excluded by me:
I think the problem here was that the loop didn't worked and I had no clue how to correct it. However, I think this part is only important if the AI is looking for buildings to build in oder to reach a cultural victory, so this might not be that important.
The second thing is that I haven't put the information in the code that the last part is a replacement of the original code, not an addition.
(At least I'm pretty sure it is, really should have added a comment here
)
I hope this helps in some way, and I'm really happy that my modcomp is of some use.