Hi Greg,

I now have a working version of mol_to_ctab() - except when I add in depiction generation. There is a linking issue I don't understand.

In adapter.cpp I have added this function that implements the C++ part of mol_to_ctab():

   extern "C" char *
   makeCtabText(CROMol data, int *len, bool createDepictionIfMissing) {
      ROMol   *mol = (ROMol*)data;

      try {
        if (createDepictionIfMissing && mol->getNumConformers() == 0) {
          RDDepict::compute2DCoords(*mol);
        }
        StringData = MolToMolBlock(*mol);
      } catch (...) {
        ereport(WARNING,
                (errcode(ERRCODE_WARNING),
                 errmsg("makeCtabText: problems converting molecule to
   CTAB")));
        StringData="";
      }

      *len = StringData.size();
      return (char*)StringData.c_str();
   }


But, postgres then won't start (I preload the 'rdkit' library) and in the postgres startup log I see a complaint about unresolved symbols. Those are caused by the RDDepict::compute2DCoords() call. If I compile without the RDDepict::... line, all is well, and the cartridge loads.

I check the built rdkit.so (with the depiction call):

   [jhje@bcfregbuild rdkit]$ nm -D rdkit.so | grep " U "|grep RD
                     U
   _ZN6RDGeom11Transform2D12SetTransformERKNS_7Point2DES3_S3_S3_
                     U
   _ZN6RDGeom11Transform2D12SetTransformERKNS_7Point2DEd
                     U
   _ZNK6RDGeom11Transform2D14TransformPointERNS_7Point2DE
   [jhje@bcfregbuild rdkit]$


So I do a naive search for those unresolved symbols in rdkit's lib directory to see what libs are needed:

   [jhje@bcfregbuild lib]$ grep
   _ZN6RDGeom11Transform2D12SetTransformERKNS_7Point2DES3_S3_S3_ *.a
   Binary file libDepictor_static.a matches
   Binary file libRDGeometryLib_static.a matches
   [jhje@bcfregbuild lib]$ grep
   _ZN6RDGeom11Transform2D12SetTransformERKNS_7Point2DEd *.a
   Binary file libDepictor_static.a matches
   Binary file libRDGeometryLib_static.a matches
   [jhje@bcfregbuild lib]$ grep
   _ZNK6RDGeom11Transform2D14TransformPointERNS_7Point2DE *.a
   Binary file libDepictor_static.a matches
   Binary file libRDGeometryLib_static.a matches
   [jhje@bcfregbuild lib]$


I have added Depictor to the RDKLIBS in the Makefile - RDGeometryLib was already there:

RDKLIBS = ${INCHILIBS} [...] -lDataStructs -lRDGeometryLib -lRDGeneral *-lDepictor*

So I would have thought that all was well. But I still have these three unlinked symbols after adding the Depictor lib and rebuilding. Some secondary dependencies ... ? I hope that I can slap my forehead and say "DUH" when I am told the reason why...

Cheers
-- Jan
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to