You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu18.04下Open3D与Armadillo联编触发Intel MKL参数错误排查

问题:链接Open3D后Armadillo的MKL相关线性代数函数报错

现象描述

  • 在Ubuntu 18.04环境下开发C++项目,同时使用Open3D和Armadillo库。当将Open3D::Open3D加入链接库后,Armadillo中依赖Intel MKL的arma::inv(A)、arma::solve(X, A, B)等线性代数函数无法正常执行,抛出错误:

    Intel MKL ERROR: Parameter 7 was incorrect on entry to DGELSD

  • 编写仅调用Armadillo函数的独立测试程序,只要在CMakeLists中链接Open3D,就会触发完全相同的错误。

测试代码

#include <iostream>
#include <armadillo>
#include <unordered_map>
#include <utility>

using namespace std;
using namespace arma;
using namespace std::chrono;

#define AVG_LEN (5ULL)

int main(int argc, char const *argv[])
{
    std::unordered_map<std::string, std::pair<size_t, arma::dmat::fixed<AVG_LEN, 3ULL>>> upload_info; 
    upload_info["A1b"].second.fill(1.0);
    auto it = upload_info.find("A1b");
    for (int i=0; i<AVG_LEN; ++i) {
        it->second.second(i, 0) = i*2;
        it->second.second(i, 2) = i+10;
        it->second.first++;
    }
    arma::vec2 X;
    arma::dmat::fixed<AVG_LEN, 3ULL> info(it->second.second);
    bool status = arma::solve(X, info.cols(0, 1), info.col(2));
    if (status)
        cout << "X: \n" << X << endl;
    return 0;
}

未链接Open3D时的正确输出

X: 
   0.5000
  10.0000

环境与编译配置

  • 系统:Ubuntu 18.04
  • Open3D版本:0.16.1,源码编译命令:
    cmake -DBUILD_SHARED_LIBS=OFF \
        -DBUILD_GUI=OFF -DBUILD_WEBRTC=OFF -DBUILD_PYTHON_MODULE=OFF \
        -DGLIBCXX_USE_CXX11_ABI=ON -DWITH_OPENMP=ON \
        -DCMAKE_INSTALL_PREFIX=$O3D_INSTALL_DIR ..
    
  • Armadillo安装:通过apt-get install -y liblapack-dev libarmadillo-dev安装,使用Blas加速计算
  • CMakeLists链接配置:
    foreach(_target
      demo)
      add_executable(${_target} "${_target}.cpp")
      target_link_libraries(${_target} Open3D::Open3D
      ${ARMADILLO_LIBRARIES})
    endforeach()
    

疑问

编译Open3D时需指定哪些编译选项,或该问题的可能原因是什么?


内容的提问来源于stack exchange,提问作者Xueshen Liu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.10 17:50:44