Window10 ONNX Runtime 源码编译静态库 + MMDeploy源码编译动态库

编译环境:

        windows 10

        vs2019

        cmake 3.18 

        python 3.8.10

   一、ONNX Runtime(v1.12.0)源码编译

        1、源码下载

                管理员运行cmd ->cd /d  D:/develop/onnxruntime

                执行下面下载源码命令:

                git clone -b rel-1.12.0 --recursive https://gitee.com/mirrors_microsoft/onnxruntime

        2、管理员运行命令行进入onnxruntime目录

                .\build.bat --config=Release --cmake_generator="Visual Studio 16 2019" --parallel

        3、用vs2019打开生成的onnxruntime项目

                正常编译会生成很多lib库

        

        4、使用vs2019命令工具的lib.exe命令来把多个lib打包成一个lib

                lib /out:onnxruntime.lib *.lib

二、MMDeploy源码编译动态库

        尝试过编译静态库,编译成功,但是在运行中出现model加载失败未找到原因,就放弃了。

        

git clone -b main https://github.com/open-mmlab/mmdeploy.git MMDeploy
cd MMDeploy
git submodule update --init --recursive
  • 如果由于网络等原因导致拉取仓库子模块失败,可以尝试通过如下指令手动再次安装子模块:

    git clone git@github.com:NVIDIA/cub.git third_party/cub
    cd third_party/cub
    git checkout c3cceac115
    
    # 返回至 third_party 目录, 克隆 pybind11
    cd ..
    git clone git@github.com:pybind/pybind11.git pybind11
    cd pybind11
    git checkout 70a58c5
    
    cd ..
    git clone git@github.com:gabime/spdlog.git spdlog
    cd spdlog
    git checkout 9e8e52c048

采用Cmake配置vs2019编译:

  • 10
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值