• visp库中解决lapack库的问题


    解决的办法是——绕过去,不要用这个库:

    使用中发现如下代码抛出异常:

      //vpTemplateTracker.cpp
      try {
        initHessienDesired(I);
        ptTemplateSuppPyr[0] = ptTemplateSupp;
        ptTemplateCompoPyr[0] = ptTemplateCompo;
        HdesirePyr[0] = Hdesire;
        HLMdesirePyr[0] = HLMdesire;
        HLMdesireInversePyr[0] = HLMdesireInverse;
      } catch (const vpException &e) {
        ptTemplateSuppPyr[0] = ptTemplateSupp;
        ptTemplateCompoPyr[0] = ptTemplateCompo;
        HdesirePyr[0] = Hdesire;
        HLMdesirePyr[0] = HLMdesire;
        HLMdesireInversePyr[0] = HLMdesireInverse;
        throw(e);
      }  

    调用栈是:

    #5  0x00007ffff7b33b93 in __cxa_throw () from /lib64/libstdc++.so.6
    #6  0x0000000000416b80 in vpTemplateTracker::initHessienDesiredPyr (this=0x7fffffffd470, I=...)
        at /data/ahfu/visp/modules/tracker/tt/src/vpTemplateTracker.cpp:756
    #7  0x0000000000416603 in vpTemplateTracker::initFromPoints (this=0x7fffffffd470, I=..., v_ip=..., 
        delaunay=false) at /data/ahfu/visp/modules/tracker/tt/src/vpTemplateTracker.cpp:704
    #8  0x0000000000406a47 in main (argc=1, argv=0x7fffffffe358) at test.cpp:148  

    不太清楚究竟为何抛异常,于是注释掉try catch,重新编译链接执行。

    看到了如下异常信息:

    #5  0x00007ffff7b33b93 in __cxa_throw () from /lib64/libstdc++.so.6
    #6  0x00000000004519b9 in vpMatrix::inverseByLULapack (this=0x7fffffffc390)
        at /data/ahfu/visp/modules/core/src/math/matrix/vpMatrix_lu.cpp:385
    #7  0x00000000004514ff in vpMatrix::inverseByLU (this=0x7fffffffc390)
        at /data/ahfu/visp/modules/core/src/math/matrix/vpMatrix_lu.cpp:133
    #8  0x000000000040d477 in vpTemplateTrackerSSDInverseCompositional::initCompInverse (
        this=0x7fffffffd470)
        at /data/ahfu/visp/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDInverseCompositional.cpp:79
    #9  0x000000000040d7c3 in vpTemplateTrackerSSDInverseCompositional::initHessienDesired (
        this=0x7fffffffd470, I=...)
        at /data/ahfu/visp/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDInverseCompositional.cpp:103
    #10 0x00000000004167b1 in vpTemplateTracker::initHessienDesiredPyr (this=0x7fffffffd470, I=...)
        at /data/ahfu/visp/modules/tracker/tt/src/vpTemplateTracker.cpp:744
    #11 0x0000000000416603 in vpTemplateTracker::initFromPoints (this=0x7fffffffd470, I=..., v_ip=..., 
        delaunay=false) at /data/ahfu/visp/modules/tracker/tt/src/vpTemplateTracker.cpp:704
    #12 0x0000000000406a47 in main (argc=1, argv=0x7fffffffe358) at test.cpp:148  

    更换了最新的lapack库,仍然无法解决。

    查看visp/modules/core/src/math/matrix/vpMatrix_lu.cpp 发现了这样的注释:

        111   std::cout << "Inverse by LU ";
        112 #if defined(VISP_HAVE_LAPACK)
        113   std::cout << "(using Lapack)";
        114 #elif defined(VISP_HAVE_EIGEN3)
        115   std::cout << "(using Eigen3)";
        116 #elif (VISP_HAVE_OPENCV_VERSION >= 0x020101)
        117   std::cout << "(using OpenCV)";
        118 #elif defined (VISP_HAVE_GSL)
        119   std::cout << "(using GSL)";
        120 #endif  

    说明编译选项可以选择不同的库。

    于是:

    cd /data/ahfu/visp/

    mkdir build

    cd build

    ccmake ..  #在界面中把 WITH_LAPACK设置为OFF

    cmake ..

    make -j

    make install

    重新编译测试程序运行,一切正常。

  • 相关阅读:
    8.SpringMVC参数传递
    9.SpringMVC和json结合传递参数
    20160815命令行进入其他盘
    5.SpringMVC静态文件的访问
    6.SpringMVC注解启用
    7.SpringMVC注解优化
    3.SpringMVC修改配置文件路径和给界面传递数据
    rails
    SVN Merge合并 Patch打补丁
    Windows环境下怎么在文件夹下打开cmd命令行
  • 原文地址:https://www.cnblogs.com/ahfuzhang/p/10274043.html
Copyright © 2020-2023  润新知