PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.13k stars 5.55k forks source link

Windows 10下源码编译报语法错误 #68558

Open PlumBlossomMaid opened 2 days ago

PlumBlossomMaid commented 2 days ago

请提出你的问题 Please ask your question

Windows下对paddle进行源码编译报错

安装步骤和官网步骤一致,cmake指令执行的是

cmake .. -GNinja -DWITH_GPU=OFF -DWITH_UNITY_BUILD=ON

cmake成功执行并且生成build.ninja文件

之后执行:

ninja

然后, 控制台打印信息:

E:\code\Paddle\build>ninja
[9/2346] Running utility command for pslib_py_proto
已复制         1 个文件。
[12/2346] Running utility command for ps_py_proto
已复制         1 个文件。
[14/2346] Running utility command for profiler_py_proto
profiler_pb2.py
__init__.py
已复制         2 个文件。
[24/2346] Building CXX object paddle\pir\CMakeFiles\pir.dir\core\parser\ir_parser.cc.obj
FAILED: paddle/pir/CMakeFiles/pir.dir/core/parser/ir_parser.cc.obj
"D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64\cl.exe"  /nologo /TP -DEIGEN_STRONG_INLINE=inline -DGOOGLE_GLOG_DLL_DECL="" -DHPPL_STUB_FUNC -DIR_LIBRARY -DLAPACK_FOUND -DNOMINMAX -DPADDLE_DISABLE_PROFILER -DPADDLE_DLL_EXPORT -DPADDLE_DLL_INFERENCE -DPADDLE_ON_INFERENCE -DPADDLE_VERSION=0.0.0 -DPADDLE_VERSION_INTEGER=0 -DPADDLE_WITH_AVX -DPADDLE_WITH_CRYPTO -DPADDLE_WITH_DNNL -DPADDLE_WITH_MKLML -DPADDLE_WITH_POCKETFFT -DPADDLE_WITH_SSE3 -DSTATIC_IR -DUTF8PROC_STATIC -DWIN32_LEAN_AND_MEAN -D_XKEYCHECK_H -IE:\code\Paddle\build -IE:\code\Paddle\paddle\fluid\framework\io -IE:\code\Paddle\build\third_party\install\zlib\include -IE:\code\Paddle\build\third_party\install -IE:\code\Paddle\build\third_party\install\gflags\include -IE:\code\Paddle\build\third_party\install\glog\include -IE:\code\Paddle\third_party\eigen3 -IE:\code\Paddle\third_party\threadpool -IE:\code\Paddle\third_party\dlpack\include -IE:\code\Paddle\build\third_party\install\xxhash\include -IE:\code\Paddle\build\third_party\install\warpctc\include -IE:\code\Paddle\build\third_party\install\warprnnt\include -IE:\code\Paddle\build\third_party\install\utf8proc\include -IE:\code\Paddle\build\third_party\install\mklml\include -IE:\code\Paddle\build\third_party\install\mkldnn\include -IE:\code\Paddle\build\third_party\install\protobuf\include -I"C:\Program Files\Python39\include" -IC:\Users\姊呰姳涓夊紕鍐嶅洖棣朶AppData\Roaming\Python\Python39\site-packages\numpy\core\include -IE:\code\Paddle\build\third_party\pybind\src\extern_pybind\include -IE:\code\Paddle\build\third_party\install\cryptopp\include -IE:\code\Paddle\build\third_party\pocketfft\src -IE:\code\Paddle\build\third_party\dirent\src\extern_dirent\include -IE:\code\Paddle -IE:\code\Paddle\build\..\paddle\fluid\framework\io /DWIN32 /D_WINDOWS  /W0  /GR /EHsc /w /wd4068 /wd4129 /wd4244 /wd4267 /wd4297 /wd4530 /wd4577 /wd4819 /wd4838  /arch:AVX /MT /O2 /Ob2 /DNDEBUG /bigobj /Zc:inline -std:c++17 /showIncludes /Fopaddle\pir\CMakeFiles\pir.dir\core\parser\ir_parser.cc.obj /Fdpaddle\pir\CMakeFiles\pir.dir\pir.pdb /FS -c E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc
E:\code\Paddle\paddle/pir/core/ir_context.h(37): error C2039: "string": 不是 "std" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\set(23): note: 参见“std”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(37): error C2065: “string”: 未声明的标识符
E:\code\Paddle\paddle/pir/core/ir_context.h(37): error C2923: "std::unordered_map": "string" 不是参数 "_Kty" 的有效 模板 类型参数
E:\code\Paddle\paddle/pir/core/ir_context.h(37): note: 参见“string”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(37): error C2976: “std::unordered_map'”: 模板 参数太少
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(122): error C2039: "string": 不是 "std" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\set(23): note: 参见“std”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(122): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\code\Paddle\paddle/pir/core/ir_context.h(122): error C2143: 语法错误: 缺少“,”(在“&”的前面)
E:\code\Paddle\paddle/pir/core/ir_context.h(127): error C2955: “std::unordered_map”: 使用 类 模板 需要 模板 参数列表
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(156): error C2039: "string": 不是 "std" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\set(23): note: 参见“std”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(156): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\code\Paddle\paddle/pir/core/ir_context.h(156): error C2143: 语法错误: 缺少“,”(在“&”的前面)
E:\code\Paddle\paddle/pir/core/ir_context.h(173): error C2039: "string": 不是 "std" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\set(23): note: 参见“std”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(173): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\code\Paddle\paddle/pir/core/ir_context.h(173): error C2143: 语法错误: 缺少“,”(在“&”的前面)
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(112): error C2664: “pir::Dialect *pir::IrContext::GetRegisteredDialect(const int)”: 无法将参数 1 从“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”转换为“const int”
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(112): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
E:\code\Paddle\paddle/pir/core/ir_context.h(173): note: 参见“pir::IrContext::GetRegisteredDialect”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(182): note: 可能是“T *pir::IrContext::GetRegisteredDialect(void)”
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(112): note: “T *pir::IrContext::GetRegisteredDialect(void)”: 应输入 0 个参数,却提供了 1 个
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(112): note: 尝试匹配参数列表“(std::basic_string<char,std::char_traits<char>,std::allocator<char>>)”时
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(113): error C3536: “dialect”: 初始化之前无法使用
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(175): error C2664: “pir::Dialect *pir::IrContext::GetRegisteredDialect(const int)”: 无法将参数 1 从“std::basic_string<char,std::char_traits<char>,std::allocator<char>>”转换为“const int”
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(175): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
E:\code\Paddle\paddle/pir/core/ir_context.h(173): note: 参见“pir::IrContext::GetRegisteredDialect”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(182): note: 可能是“T *pir::IrContext::GetRegisteredDialect(void)”
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(175): note: “T *pir::IrContext::GetRegisteredDialect(void)”: 应输入 0 个参数,却提供了 1 个
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(175): note: 尝试匹配参数列表“(std::basic_string<char,std::char_traits<char>,std::allocator<char>>)”时
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(176): error C3536: “dialect”: 初始化之前无法使用
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(264): error C2664: “pir::OpInfo pir::IrContext::GetRegisteredOpInfo(const int)”: 无法将参数 1 从“std::string”转换为“const int”
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(264): note: 没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
E:\code\Paddle\paddle/pir/core/ir_context.h(122): note: 参见“pir::IrContext::GetRegisteredOpInfo”的声明
E:\code\Paddle\paddle\pir\core\parser\ir_parser.cc(264): note: 尝试匹配参数列表“(std::string)”时
[26/2346] Building CXX object paddle\pir\CMakeFiles\pir.dir\core\ir_context.cc.obj
FAILED: paddle/pir/CMakeFiles/pir.dir/core/ir_context.cc.obj
"D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\Hostx64\x64\cl.exe"  /nologo /TP -DEIGEN_STRONG_INLINE=inline -DGOOGLE_GLOG_DLL_DECL="" -DHPPL_STUB_FUNC -DIR_LIBRARY -DLAPACK_FOUND -DNOMINMAX -DPADDLE_DISABLE_PROFILER -DPADDLE_DLL_EXPORT -DPADDLE_DLL_INFERENCE -DPADDLE_ON_INFERENCE -DPADDLE_VERSION=0.0.0 -DPADDLE_VERSION_INTEGER=0 -DPADDLE_WITH_AVX -DPADDLE_WITH_CRYPTO -DPADDLE_WITH_DNNL -DPADDLE_WITH_MKLML -DPADDLE_WITH_POCKETFFT -DPADDLE_WITH_SSE3 -DSTATIC_IR -DUTF8PROC_STATIC -DWIN32_LEAN_AND_MEAN -D_XKEYCHECK_H -IE:\code\Paddle\build -IE:\code\Paddle\paddle\fluid\framework\io -IE:\code\Paddle\build\third_party\install\zlib\include -IE:\code\Paddle\build\third_party\install -IE:\code\Paddle\build\third_party\install\gflags\include -IE:\code\Paddle\build\third_party\install\glog\include -IE:\code\Paddle\third_party\eigen3 -IE:\code\Paddle\third_party\threadpool -IE:\code\Paddle\third_party\dlpack\include -IE:\code\Paddle\build\third_party\install\xxhash\include -IE:\code\Paddle\build\third_party\install\warpctc\include -IE:\code\Paddle\build\third_party\install\warprnnt\include -IE:\code\Paddle\build\third_party\install\utf8proc\include -IE:\code\Paddle\build\third_party\install\mklml\include -IE:\code\Paddle\build\third_party\install\mkldnn\include -IE:\code\Paddle\build\third_party\install\protobuf\include -I"C:\Program Files\Python39\include" -IC:\Users\姊呰姳涓夊紕鍐嶅洖棣朶AppData\Roaming\Python\Python39\site-packages\numpy\core\include -IE:\code\Paddle\build\third_party\pybind\src\extern_pybind\include -IE:\code\Paddle\build\third_party\install\cryptopp\include -IE:\code\Paddle\build\third_party\pocketfft\src -IE:\code\Paddle\build\third_party\dirent\src\extern_dirent\include -IE:\code\Paddle -IE:\code\Paddle\build\..\paddle\fluid\framework\io /DWIN32 /D_WINDOWS  /W0  /GR /EHsc /w /wd4068 /wd4129 /wd4244 /wd4267 /wd4297 /wd4530 /wd4577 /wd4819 /wd4838  /arch:AVX /MT /O2 /Ob2 /DNDEBUG /bigobj /Zc:inline -std:c++17 /showIncludes /Fopaddle\pir\CMakeFiles\pir.dir\core\ir_context.cc.obj /Fdpaddle\pir\CMakeFiles\pir.dir\pir.pdb /FS -c E:\code\Paddle\paddle\pir\core\ir_context.cc
E:\code\Paddle\paddle/pir/core/ir_context.h(37): error C2039: "string": 不是 "std" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\set(23): note: 参见“std”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(37): error C2065: “string”: 未声明的标识符
E:\code\Paddle\paddle/pir/core/ir_context.h(37): error C2923: "std::unordered_map": "string" 不是参数 "_Kty" 的有效 模板 类型参数
E:\code\Paddle\paddle/pir/core/ir_context.h(37): note: 参见“string”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(37): error C2976: “std::unordered_map'”: 模板 参数太少
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(122): error C2039: "string": 不是 "std" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\set(23): note: 参见“std”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(122): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\code\Paddle\paddle/pir/core/ir_context.h(122): error C2143: 语法错误: 缺少“,”(在“&”的前面)
E:\code\Paddle\paddle/pir/core/ir_context.h(127): error C2955: “std::unordered_map”: 使用 类 模板 需要 模板 参数列表
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(156): error C2039: "string": 不是 "std" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\set(23): note: 参见“std”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(156): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\code\Paddle\paddle/pir/core/ir_context.h(156): error C2143: 语法错误: 缺少“,”(在“&”的前面)
E:\code\Paddle\paddle/pir/core/ir_context.h(173): error C2039: "string": 不是 "std" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\set(23): note: 参见“std”的声明
E:\code\Paddle\paddle/pir/core/ir_context.h(173): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
E:\code\Paddle\paddle/pir/core/ir_context.h(173): error C2143: 语法错误: 缺少“,”(在“&”的前面)
E:\code\Paddle\paddle\pir\core\ir_context.cc(124): error C2955: “std::unordered_map”: 使用 类 模板 需要 模板 参数列表
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(180): error C2955: “std::unordered_map”: 使用 类 模板 需要 模板 参数列表
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): error C2672: “begin”: 未找到匹配的重载函数
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(1589): note: 可能是“_Ty *std::begin(_Ty (&)[_Size]) noexcept”
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: “_Ty *std::begin(_Ty (&)[_Size]) noexcept”: 无法从“pir::OpInfoMap”推导出“_Ty (&)[_Size]”的 模板 参数
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(1571): note: 或    “unknown-type std::begin(const _Container &) noexcept(<expr>)”
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: 未能使函数模板“unknown-type std::begin(const _Container &) noexcept(<expr>)”专用化
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: 用下列模板参数:
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: “_Container=pir::OpInfoMap”
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(1565): note: 或    “unknown-type std::begin(_Container &) noexcept(<expr>)”
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: 未能使函数模板“unknown-type std::begin(_Container &) noexcept(<expr>)”专用化
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: 用下列模板参数:
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: “_Container=pir::OpInfoMap”
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\initializer_list(55): note: 或    “const _Elem *std::begin(std::initializer_list<_Elem>) noexcept”
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: “const _Elem *std::begin(std::initializer_list<_Elem>) noexcept”: 无法从“pir::OpInfoMap”推导出“std::initializer_list<_Elem>”的 模板 参数
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): error C2672: “end”: 未找到匹配的重载函数
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(1594): note: 可能是“_Ty *std::end(_Ty (&)[_Size]) noexcept”
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: “_Ty *std::end(_Ty (&)[_Size]) noexcept”: 无法从“pir::OpInfoMap”推导出“_Ty (&)[_Size]”的 模板 参数
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(1583): note: 或    “unknown-type std::end(const _Container &) noexcept(<expr>)”
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: 未能使函数模板“unknown-type std::end(const _Container &) noexcept(<expr>)”专用化
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: 用下列模板参数:
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: “_Container=pir::OpInfoMap”
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(1577): note: 或    “unknown-type std::end(_Container &) noexcept(<expr>)”
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: 未能使函数模板“unknown-type std::end(_Container &) noexcept(<expr>)”专用化
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: 用下列模板参数:
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: “_Container=pir::OpInfoMap”
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\initializer_list(60): note: 或    “const _Elem *std::end(std::initializer_list<_Elem>) noexcept”
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): note: “const _Elem *std::end(std::initializer_list<_Elem>) noexcept”: 无法从“pir::OpInfoMap”推导出“std::initializer_list<_Elem>”的 模板 参数
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): error C3536: “<begin>$L3”: 初始化之前无法使用
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): error C3536: “<end>$L3”: 初始化之前无法使用
E:\code\Paddle\paddle\pir\core\ir_context.cc(51): error C2100: 非法的间接寻址
E:\code\Paddle\paddle\pir\core\ir_context.cc(54): error C2039: "clear": 不是 "std::unordered_map" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(103): error C2039: "find": 不是 "std::unordered_map" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(103): error C2039: "end": 不是 "std::unordered_map" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(110): error C2039: "emplace": 不是 "std::unordered_map" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(115): error C2039: "find": 不是 "std::unordered_map" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(116): error C3536: “iter”: 初始化之前无法使用
E:\code\Paddle\paddle\pir\core\ir_context.cc(116): error C2039: "end": 不是 "std::unordered_map" 的成员
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(32): error C2512: “std::unordered_map”: 没有合适的默认构造函数可用
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(193): note: 参见对函数 "pir::IrContextImpl::IrContextImpl(void)" 的引用
E:\code\Paddle\paddle\pir\core\ir_context.cc(248): error C2511: “pir::Dialect *pir::IrContext::GetOrRegisterDialect(const std::string &,std::function<pir::Dialect *(void)>)”:“pir::IrContext”中没有找到重载的成员函数
E:\code\Paddle\paddle/pir/core/op_info.h(23): note: 参见“pir::IrContext”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(252): error C2352: “pir::IrContext::impl”: 调用非静态成员函数需要一个对象
E:\code\Paddle\paddle/pir/core/ir_context.h(59): note: 参见“pir::IrContext::impl”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(255): error C2352: “pir::IrContext::impl”: 调用非静态成员函数需要一个对象
E:\code\Paddle\paddle/pir/core/ir_context.h(59): note: 参见“pir::IrContext::impl”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(257): error C2352: “pir::IrContext::impl”: 调用非静态成员函数需要一个对象
E:\code\Paddle\paddle/pir/core/ir_context.h(59): note: 参见“pir::IrContext::impl”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(268): error C2511: “pir::Dialect *pir::IrContext::GetRegisteredDialect(const std::string &)”:“pir::IrContext”中没有找到重载的成员函数
E:\code\Paddle\paddle/pir/core/op_info.h(23): note: 参见“pir::IrContext”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(269): error C2352: “pir::IrContext::impl”: 调用非静态成员函数需要一个对象
E:\code\Paddle\paddle/pir/core/ir_context.h(59): note: 参见“pir::IrContext::impl”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(269): error C2530: “dialect_map”: 必须初始化引用
E:\code\Paddle\paddle\pir\core\ir_context.cc(269): error C3531: “dialect_map”: 类型包含“auto”的符号必须具有初始值设定项
E:\code\Paddle\paddle\pir\core\ir_context.cc(269): error C2143: 语法错误: 缺少“;”(在“:”的前面)
E:\code\Paddle\paddle\pir\core\ir_context.cc(269): error C2352: “pir::IrContext::impl”: 调用非静态成员函数需要一个对象
E:\code\Paddle\paddle/pir/core/ir_context.h(59): note: 参见“pir::IrContext::impl”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(269): error C2143: 语法错误: 缺少“;”(在“)”的前面)
E:\code\Paddle\paddle\pir\core\ir_context.cc(313): error C2511: “pir::OpInfo pir::IrContext::GetRegisteredOpInfo(const std::string &)”:“pir::IrContext”中没有找到重载的成员函数
E:\code\Paddle\paddle/pir/core/op_info.h(23): note: 参见“pir::IrContext”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(314): error C2352: “pir::IrContext::impl”: 调用非静态成员函数需要一个对象
E:\code\Paddle\paddle/pir/core/ir_context.h(59): note: 参见“pir::IrContext::impl”的声明
E:\code\Paddle\paddle\pir\core\ir_context.cc(317): error C2955: “std::unordered_map”: 使用 类 模板 需要 模板 参数列表
D:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\unordered_map(67): note: 参见“std::unordered_map”的声明
[37/2346] Building CXX object paddle\pir\CMakeFiles\pir.dir\dialect\shape\ir\shape_attribute.cc.obj
ninja: build stopped: subcommand failed.
engineer1109 commented 2 days ago

E:\code\Paddle\paddle/pir/core/ir_context.h 缺少

#include <string>
#include <unordered_map>
PlumBlossomMaid commented 2 days ago

啊?那需要我手动把源码改过来吗?这样的话岂不是每次编译我都需要手动改代码了?

发呆

engineer1109 commented 2 days ago

@PlumBlossomMaid 这是编译器默认头文件引用不一致问题。官方不太关注windows的各种情况,用户少。只能氪服一下。

PlumBlossomMaid commented 2 days ago

如果我针对这个问题提交PR的话你们会接受吗 还有就是好奇你们是怎么编译Windows版本的,也是这么氪服的吗( 思考

xuxinyi389 commented 23 hours ago

首先回答你关于内部的编译问题:内部Windows版本的编译对于GPU使用的VS2019,CPU版本使用的VS2017,因此使用相应版本的VS肯定是没有问题的。 关于PR本身的问题:报错信息是一些基础的STL组件没有正确include。你可以打开VS的UI,创建一个.cpp文件,去包含 string 等头文件,看是否能成功编译,从而排除本地编译环境中库路径的问题。如果简单文件也无法编译成功,需要你自己检查自己的本地环境。如果可以编译成功,应该是VS2022的适配问题,可以向我们报告,后续我们会适配VS2022.