Windows 安装 及解决 tvm 无法打开 源 文件 “dmlc/logging.h“

 如果你在编译 TVM 时遇到 `dmlc/logging.h` 文件缺失的问题,很可能是因为在克隆 TVM 仓库时没有包含其子模块,而这些子模块(如 `dmlc-core`)是通过 Git 管理的。

解决步骤

  1. 安装 Git:

    • 如果你还没有安装 Git,需要先安装它。根据你的操作系统选择合适的安装方法:
      • Ubuntu/Debian:
        sudo apt-get install git
        
      • CentOS/Fedora:
        sudo yum install git
        
      • macOS:
        brew install git
        
      • Windows:
        • 你可以从 Git官网 下载并安装 Git。
  2. 克隆 TVM 仓库并包含子模块:
    请按照以下步骤重新克隆 TVM 仓库并确保所有子模块都正确初始化:
    1. 通过以下命令带有 --recursive 选项重新克隆 TVM 仓库:

     git clone --recursive https://github.com/apache/tvm.git
    
    2. 如果你不想重新克隆整个仓库,也可以在现有的 TVM 仓库中更新子模块:
    
    git submodule update --init --recursive
    
    - 无论是重新克隆还是更新子模块,都应该可以解决相关的问题。
    

在这里插入图片描述

  1. 检查子模块的状态:

    • 确保所有子模块都已成功拉取:
      git submodule status
      
    • 如果一切正常,你会看到所有子模块的状态信息,并且它们的前面不会有负号 -(表示未初始化)。
  2. 重新编译 TVM:

    • 在确认所有子模块都已正确拉取后,重新进行编译:
    	cd 3rdparty\tvm
    	mkdir build
    	cp cmake\config.cmake build
    	cd build
    	cmake .. -A x64
    	cmake --build . --config Release -- /m
    

这样做之后,你应该能够成功编译 TVM,并解决 dmlc/logging.h 文件无法找到的问题。如果在此过程中遇到其他问题,随时可以向我寻求帮助!

在这里插入图片描述
安装遇见 问题

Downloading
https://files.pythonhosted.org/packages/dd/50/17ab8a66d66bdf55ff6dea6fe2df424061cee65c6d772abc871bb563f91b/ml_dtypes-0.4.0.tar.gz#sha256=eaf197e72f4f7176a19fe3cb8b61846b38c6757607e7bf9cd4b1d84cd3e74deb
Best match: ml-dtypes 0.4.0 Processing ml_dtypes-0.4.0.tar.gz Writing
C:\Users\11540\AppData\Local\Temp\easy_install-z_ifevqc\ml_dtypes-0.4.0\setup.cfg
Running ml_dtypes-0.4.0\setup.py -q bdist_egg --dist-dir
C:\Users\11540\AppData\Local\Temp\easy_install-z_ifevqc\ml_dtypes-0.4.0\egg-dist-tmp-af9eb1sx
dtypes.cc
C:\Users\11540\AppData\Local\Temp\easy_install-z_ifevqc\ml_dtypes-0.4.0\third_party\eigen\Eigen\src/Core/arch/Default/Half.h(1): warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\Users\11540\AppData\Local\Temp\easy_install-z_ifevqc\ml_dtypes-0.4.0\third_party\eigen\Eigen\src/Core/arch/Default/BFloat16.h(1):
warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\Users\11540\AppData\Local\Temp\easy_install-z_ifevqc\ml_dtypes-0.4.0\third_party\eigen\Eigen\src/Core/arch/Default/GenericPacketMathFunctions.h(666):
warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
C:\Users\11540\AppData\Local\Temp\easy_install-z_ifevqc\ml_dtypes-0.4.0\third_party\eigen\Eigen\src/Core/SkewSymmetricMatrix3.h(1):
warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
ml_dtypes_src/custom_float.h(942): error C3861: “Py_SET_TYPE”: 找不到标识符
ml_dtypes_src/custom_float.h(942): note: 模板实例化上下文(最早的实例化上下文)为
ml_dtypes/_src/dtypes.cc(226): note: 查看对正在编译的函数 模板 实例化“bool
ml_dtypes::RegisterFloatDtype<ml_dtypes::bfloat16>(PyObject *)”的引用
ml_dtypes_src/int4_numpy.h(842): error C3861: “Py_SET_TYPE”: 找不到标识符
ml_dtypes_src/int4_numpy.h(842): note: 模板实例化上下文(最早的实例化上下文)为
ml_dtypes/_src/dtypes.cc(245): note: 查看对正在编译的函数 模板 实例化“bool
ml_dtypes::RegisterInt4Dtype<ml_dtypes::int4>(PyObject *)”的引用 error:
Setup script exited with error: command
‘D:\VS2022\IDE\VC\Tools\MSVC\14.40.33807\bin\HostX86\x64\cl.exe’
failed with exit status 2

解决方式

pip install ml-dtypes
  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值