CVS Version (Linking?) Errors

Help
bnwatkins
2007-10-07
2013-04-16
  • bnwatkins

    bnwatkins - 2007-10-07

    Hello all,

    First, many thanks to those who have worked to keep this project going! 

    Anyway, I have the most recent "official" release of PNL installed on linux ubuntu 7.10, and my program deploying it is compiled and working (with a couple of hand-inserted bug patches pointed out by others with respect to running simultaneous nets using the high wrapper).

    I am experimenting with thread safety, which is dismal with the high wrapper.  I wanted to see if the CVS version made any difference, but when I try to make install into a clean /usr/local directory, I get a large number of error messages (set out below) at linking, using the same header files and linker flags as before.

    It is clear that I have either installed the CVS version incorrectly (I have simply checked it out into a new directory, and run ./configure.gcc followed by make followed by make install), or I am linking/including the wrong libraries/headers.  From reading the bug reports, I know there is a move to the latest opencv source files with this revision, but I thought those were already included... 

    I have tried including all or some combination of the following:
    #include "pnlHigh.hpp"
    #include "cxcore.h" (<- just to check)
    #include "cxcore.hpp"
    #include "WInner.hpp"
    #include "pnlWProbabilisticNet.hpp"
    #include "pnlWGraph.hpp"
    #include "pnl_dll.hpp"

    And I am linking to: -lpnl -lhigh -lcxcore /usr/local/lib/libcxcore.a  (<-just to check)

    And I get the following errors at compile, which were not there before:

    <snip>
    /usr/local/lib/libhigh.a(BNet.o): In function `pnlw::BayesNet::GetPTabular(pnlw::TokArr, pnlw::TokArr)':
    /home/brian/PNL/high/source/BNet.cpp:507: undefined reference to `pnl::CFactor::GetMatrix(pnl::EMatrixType, int, int const*) const'
    /usr/local/lib/libhigh.a(BNet.o): In function `pnlw::BayesNet::GetPNLEvidence()':
    /home/brian/PNL/high/source/BNet.cpp:1528: undefined reference to `pnl::CEvidence::Create(pnl::CModelDomain const*, int, int const*, pnl::pnlVector<pnl::Value, pnl::GeneralAllocator<pnl::Value> > const&)'
    /usr/local/lib/libhigh.a(BNet.o): In function `pnlw::BayesNet::Learning()':
    /home/brian/PNL/high/source/BNet.cpp:1257: undefined reference to `typeinfo for pnl::CEMLearningEngine'
    /home/brian/PNL/high/source/BNet.cpp:1257: undefined reference to `typeinfo for pnl::CStaticLearningEngine'
    /home/brian/PNL/high/source/BNet.cpp:1241: undefined reference to `typeinfo for pnl::CEMLearningEngine'
    /home/brian/PNL/high/source/BNet.cpp:1241: undefined reference to `typeinfo for pnl::CStaticLearningEngine'
    /home/brian/PNL/high/source/BNet.cpp:1266: undefined reference to `pnl::CEMLearningEngine::Create(pnl::CStaticGraphicalModel*, pnl::CInfEngine*)'
    /home/brian/PNL/high/source/BNet.cpp:1225: undefined reference to `typeinfo for pnl::CBayesLearningEngine'
    /home/brian/PNL/high/source/BNet.cpp:1225: undefined reference to `typeinfo for pnl::CStaticLearningEngine'
    /home/brian/PNL/high/source/BNet.cpp:1234: undefined reference to `pnl::CBayesLearningEngine::Create(pnl::CStaticGraphicalModel*)'
    /usr/local/lib/libhigh.a(BNet.o): In function `pnlw::BayesNet::GetEMLearningCriterionValue()':
    /home/brian/PNL/high/source/BNet.cpp:1506: undefined reference to `typeinfo for pnl::CEMLearningEngine'
    /home/brian/PNL/high/source/BNet.cpp:1506: undefined reference to `typeinfo for pnl::CStaticLearningEngine'
    /usr/local/lib/libhigh.a(BNet.o): In function `pnlw::BayesNet::SetParamLearningProperties()':
    /home/brian/PNL/high/source/BNet.cpp:732: undefined reference to `typeinfo for pnl::CEMLearningEngine'
    /home/brian/PNL/high/source/BNet.cpp:732: undefined reference to `typeinfo for pnl::CStaticLearningEngine'
    /home/brian/PNL/high/source/BNet.cpp:748: undefined reference to `pnl::CEMLearningEngine::SetTerminationToleranceEM(float)'
    /home/brian/PNL/high/source/BNet.cpp:740: undefined reference to `pnl::CEMLearningEngine::SetMaxIterEM(int)'
    /usr/local/lib/libhigh.a(BNet.o): In function `pnlw::BayesNet::GetSoftMaxWeights(pnlw::TokArr, pnlw::TokArr)':
    /home/brian/PNL/high/source/BNet.cpp:241: undefined reference to `pnl::CFactor::GetMatrix(pnl::EMatrixType, int, int const*) const'
    /home/brian/PNL/high/source/BNet.cpp:245: undefined reference to `pnl::CFactor::GetMatrix(pnl::EMatrixType, int, int const*) const'
    /usr/local/lib/libhigh.a(BNet.o): In function `pnlw::BayesNet::LearnStructure(pnlw::TokArr*, int)':
    /home/brian/PNL/high/source/BNet.cpp:804: undefined reference to `pnl::CMlStaticStructLearnHC::Create(pnl::CStaticGraphicalModel*, pnl::ELearningTypes, pnl::EOptimizeTypes, pnl::EScoreFunTypes, int, pnl::pnlVector<int, pnl::GeneralAllocator<int> >&, pnl::pnlVector<int, pnl::GeneralAllocator<int> >&, int)'
    <snip>

    And the list goes on.  There would appear to be something fairly serious (and probably fairly obvious) that I have omitted.
    What am I missing?  What else do I need to disclose?

    Thanks in advance for your help,
    Brian

     
    • Brian Milch

      Brian Milch - 2007-10-18

      Hi Brian,

      I haven't looked into thread safety for PNL, but I doubt the changes in CVS will make any difference on that issue.  As to the build problem, it looks like the linker isn't able to find the functions defined in libpnl.  Can you tell whether this is happening at the stage where libhigh is being built from its constituent object files?  It may be that even though your program is being linked with libpnl, the linker is not including libpnl when it builds libhigh.  Can you post the last command that "make" issues before all these errors appear? 

      Thanks,
      --Brian

       
      • iniverno

        iniverno - 2007-12-05

        Just edit libtool file
        and in the two lines under "# Commands used to build and install a shared archive." you should delete \$predep_objects and \$postdep_objects

         
        • iniverno

          iniverno - 2007-12-05

          Ups, it goes in a different window
          (sic)

           

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks