windows10 x86_64 编译错误
问题描述 Issue Description
使用如下命令编译paddle
- cmake .. -GNinja -DWITH_GPU=OFF cmake .. -GNinja -DWITH_GPU=OFF -- Found Paddle host system: win32, version: -- Found Paddle host system's CPU: 6 cores -- The CXX compiler identification is MSVC 19.16.27048.0 -- The C compiler identification is MSVC 19.16.27048.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: D:/CodeTools/VisualStudio/community2017/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: D:/CodeTools/VisualStudio/community2017/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- CXX compiler: D:/CodeTools/VisualStudio/community2017/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe, version: MSVC 19.16.27048.0 -- C compiler: D:/CodeTools/VisualStudio/community2017/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe, version: MSVC 19.16.27048.0 -- AR tools: D:/CodeTools/VisualStudio/community2017/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/lib.exe -- Use static C runtime time, refer to https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=vs-2019 -- Found Git: D:/CodeTools/git/git2.35.3/bin/git.exe (found version "2.35.3.windows.1") -- Looking for pthread.h -- Looking for pthread.h - not found -- Found Threads: TRUE -- Performing Test MMX_FOUND -- Performing Test MMX_FOUND - Failed -- Performing Test SSE2_FOUND -- Performing Test SSE2_FOUND - Success -- Performing Test SSE3_FOUND -- Performing Test SSE3_FOUND - Success -- Performing Test AVX_FOUND -- Performing Test AVX_FOUND - Success -- Performing Test AVX2_FOUND -- Performing Test AVX2_FOUND - Success -- Performing Test AVX512F_FOUND -- Performing Test AVX512F_FOUND - Failed CMake Warning at CMakeLists.txt:253 (MESSAGE): Disable NCCL when compiling for Windows. Force WITH_NCCL=OFF.
CMake Warning at CMakeLists.txt:308 (MESSAGE): Disable RCCL when compiling without ROCM. Force WITH_RCCL=OFF.
-- Disable XBYAK in Windows and MacOS
-- Looking for C++ include shlwapi.h
-- Looking for C++ include shlwapi.h - found
-- BOOST_VERSION: 1.41.0, BOOST_URL: http://paddlepaddledeps.bj.bcebos.com/boost_1_41_0.tar.gz
-- warp-ctc library: E:/Paddle/build/third_party/install/warpctc/bin/warpctc.dll
-- MKLML_VER: mklml_win_2019.0.5.20190502, MKLML_URL: https://paddlepaddledeps.bj.bcebos.com/mklml_win_2019.0.5.20190502.zip
-- Found cblas and lapack in MKLML (include: E:/Paddle/build/third_party/install/mklml/include, library: E:/Paddle/build/third_party/install/mklml/lib/mklml.lib)
-- CBLAS_PROVIDER: MKLML
-- Set E:/Paddle/build/third_party/install/mkldnn/lib to runtime path
-- MKLDNN library: E:/Paddle/build/third_party/install/mkldnn/bin/mkldnn.lib
-- Protobuf protoc executable: E:/Paddle/build/third_party/install/protobuf/bin/protoc.exe
-- Protobuf-lite library: E:/Paddle/build/third_party/install/protobuf/lib/libprotobuf-lite.lib
-- Protobuf library: E:/Paddle/build/third_party/install/protobuf/lib/libprotobuf.lib
-- Protoc library: E:/Paddle/build/third_party/install/protobuf/lib/libprotoc.lib
-- Protobuf version: 3.1.0
-- Found PythonInterp: D:/CodeTools/anaconda/anaconda3/envs/paddle/python.exe (found suitable version "3.8.13", minimum required is "3.6")
-- Found PythonLibs: D:/CodeTools/anaconda/anaconda3/envs/paddle/libs/python38.lib (found suitable version "3.8.13", minimum required is "3.6")
-- Found PY_pip: D:\CodeTools\anaconda\anaconda3\envs\paddle\lib\site-packages\pip_init_.py
-- Found PY_numpy: D:\CodeTools\anaconda\anaconda3\envs\paddle\lib\site-packages\numpy_init_.py
-- Found PY_wheel: D:\CodeTools\anaconda\anaconda3\envs\paddle\lib\site-packages\wheel_init_.py
-- Found PY_google.protobuf: D:\CodeTools\anaconda\anaconda3\envs\paddle\lib\site-packages\google\protobuf_init_.py
CMake Deprecation Warning at cmake/FindNumPy.cmake:6 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument
-- Found NumPy: D:/CodeTools/anaconda/anaconda3/envs/paddle/Lib/site-packages/numpy/core/include POCKETFFT_INCLUDE_DIR is E:/Paddle/build/third_party/pocketfft/src -- Looking for UINT64_MAX -- Looking for UINT64_MAX - found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of pthread_spinlock_t -- Check size of pthread_spinlock_t - failed -- Check size of pthread_barrier_t -- Check size of pthread_barrier_t - failed -- Paddle version is 0.0.0 -- Enable Intel OpenMP with E:/Paddle/build/third_party/install/mklml/lib/libiomp5md.lib CMake Warning at CMakeLists.txt:402 (message): On inference mode, will take place some specific optimization. Turn on the ON_INFER flag when building inference_lib only.
-- commit: 0ee230a7d3 -- branch: release/2.2 WITH_DLNNE: -- MESSAGE: This is just a message for publishing release. You are building AVX version without NOAVX core. So the wheel package may fail on NOAVX machine. You can add -DNOAVX_CORE_FILE=/path/to/your/core_noavx.* in cmake command to get a full wheel package to resolve this warning. While, this version will still work on local machine. -- Configuring done -- Generating done -- Build files have been written to: E:/Paddle/build
- ninja 部分错误信息如下: Unknown compiler version - please run the configure tests and report the results [809/1880] Building CXX object paddle\fluid\operators\CMakeFiles\margin_rank_loss_op.dir\margin_rank_loss_op.cc.obj Unknown compiler version - please run the configure tests and report the results [810/1880] Building CXX object paddle\fluid\operators\CMakeFiles\marker_op.dir\marker_op.cc.obj Unknown compiler version - please run the configure tests and report the results [811/1880] Building CXX object paddle\fluid\operators\CMak...margin_cross_entropy_op.dir\margin_cross_entropy_op.cc.obj Unknown compiler version - please run the configure tests and report the results [812/1880] Building CXX object paddle\fluid\operators\CMakeFiles\masked_select_op.dir\masked_select_op.cc.obj Unknown compiler version - please run the configure tests and report the results [813/1880] Building CXX object paddle\fluid\operators\CMak...s\match_matrix_tensor_op.dir\match_matrix_tensor_op.cc.obj Unknown compiler version - please run the configure tests and report the results [814/1880] Building CXX object paddle\fluid\operators\CMakeFiles\matmul_op.dir\matmul_op.cc.obj Unknown compiler version - please run the configure tests and report the results [815/1880] Building CXX object paddle\fluid\operators\CMakeFiles\matmul_v2_op.dir\matmul_v2_op.cc.obj FAILED: paddle/fluid/operators/CMakeFiles/matmul_v2_op.dir/matmul_v2_op.cc.obj D:\CodeTools\VisualStudio\community2017\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\cl.exe /nologo /TP -DBOOST_HAS_STATIC_ASSERT -DEIGEN_STRONG_INLINE=inline -DGOOGLE_GLOG_DLL_DECL="" -DHPPL_STUB_FUNC -DLAPACK_FOUND -DPADDLE_DISABLE_PROFILER -DPADDLE_DLL_EXPORT -DPADDLE_DLL_INFERENCE -DPADDLE_VERSION=0.0.0 -DPADDLE_VERSION_INTEGER=0 -DPADDLE_WITH_AVX -DPADDLE_WITH_CRYPTO -DPADDLE_WITH_MKLDNN -DPADDLE_WITH_MKLML -DPADDLE_WITH_POCKETFFT -DPADDLE_WITH_SSE3 -DUTF8PROC_STATIC -D_XKEYCHECK_H -IE:\Paddle\build -IE:\Paddle\paddle\fluid\framework\io -IE:\Paddle\build\third_party\install\zlib\include -IE:\Paddle\build\third_party\install -IE:\Paddle\build\third_party\install\gflags\include -IE:\Paddle\build\third_party\install\glog\include -IE:\Paddle\build\third_party\boost\src\extern_boost -IE:\Paddle\build\third_party\eigen3\src\extern_eigen3 -IE:\Paddle\build\third_party\threadpool\src\extern_threadpool -IE:\Paddle\build\third_party\dlpack\src\extern_dlpack\include -IE:\Paddle\build\third_party\install\xxhash\include -IE:\Paddle\build\third_party\install\warpctc\include -IE:\Paddle\build\third_party\install\utf8proc\include -IE:\Paddle\build\third_party\install\mklml\include -IE:\Paddle\build\third_party\install\mkldnn\include -IE:\Paddle\build\third_party\install\protobuf\include -ID:\CodeTools\anaconda\anaconda3\envs\paddle\include -ID:\CodeTools\anaconda\anaconda3\envs\paddle\Lib\site-packages\numpy\core\include -IE:\Paddle\build\third_party\pybind\src\extern_pybind\include -IE:\Paddle\build\third_party\install\cryptopp\include -IE:\Paddle\build\third_party\pocketfft\src -IE:\Paddle /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++14 /showIncludes /Fopaddle\fluid\operators\CMakeFiles\matmul_v2_op.dir\matmul_v2_op.cc.obj /Fdpaddle\fluid\operators\CMakeFiles\matmul_v2_op.dir\matmul_v2_op.pdb /FS -c E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc Unknown compiler version - please run the configure tests and report the results E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): error C2589: “(”:“::”右边的非法标记 E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): error C2144: 语法错误:“unknown-type”的前面应有“)” E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): error C2661: “std::vector<Eigen::DenseIndex,std::allocator<_Ty>>::push_back”: 没有重载函数接受 0 个参数 with [ _Ty=Eigen::DenseIndex ] E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): error C2144: 语法错误:“unknown-type”的前面应有“;” E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): error C2131: 表达式的计算结果不是常数 E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): note: 因读取超过生命周期的变量而失败 E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): note: 请参见“i”的用法 E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): error C2143: 语法错误: 缺少“)”(在“>”的前面) E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): error C2143: 语法错误: 缺少“;”(在“>”的前面) E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): error C2059: 语法错误:“>” E:\Paddle\paddle\fluid\operators\matmul_v2_op.cc(80): error C2059: 语法错误:“)” [816/1880] Building CXX object paddle\fluid\operators\CMakeFiles\max_sequence_len_op.dir\max_sequence_len_op.cc.obj Unknown compiler version - please run the configure tests and report the results [817/1880] Building CXX object paddle\fluid\operators\CMakeFiles\matmul_v2_op.dir\mkldnn\matmul_v2_mkldnn_op.cc.obj Unknown compiler version - please run the configure tests and report the results [818/1880] Building CXX object paddle\fluid\operators\CMakeFiles\matmul_op.dir\mkldnn\matmul_mkldnn_op.cc.obj Unknown compiler version - please run the configure tests and report the results [819/1880] Building CXX object paddle\fluid\operators\controlflow\CMakeFiles\while_op_helper.dir\while_op_helper.cc.obj Unknown compiler version - please run the configure tests and report the results [820/1880] Building CXX object paddle\fluid\operators\cont...keFiles\recurrent_op_helper.dir\recurrent_op_helper.cc.obj Unknown compiler version - please run the configure tests and report the results [821/1880] Building CXX object paddle\fluid\operators\CMakeFiles\matrix_power_op.dir\matrix_power_op.cc.obj Unknown compiler version - please run the configure tests and report the results [822/1880] Building CXX object paddle\fluid\operators\CMakeFiles\matrix_rank_op.dir\matrix_rank_op.cc.obj Unknown compiler version - please run the configure tests and report the results ninja: build stopped: subcommand failed.
版本&环境信息 Version & Environment Information
Paddle version: 2.2 Paddle With CUDA: no
OS: win10 Python version: conda python3.8 CMake version: 3.23.1 Git version: 2.35.3 MSVC version: 19.16.27048.0
CUDA version: cuDNN version: Nvidia driver version:
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
你好,这应该是paddle中的函数模板max与Visual C++中的全局的宏max冲突导致的,可以通过在Paddle\paddle\fluid\operators\matmul_v2_op.cc(80)第80行用括号将std::max括起来解决,即new_dims.push_back(std::max(dims_x[i], dims_y[i])); --> new_dims.push_back((std::max)(dims_x[i], dims_y[i]));
你好,这应该是paddle中的函数模板max与Visual C++中的全局的宏max冲突导致的,可以通过在Paddle\paddle\fluid\operators\matmul_v2_op.cc(80)第80行用括号将std::max括起来解决,即
new_dims.push_back(std::max(dims_x[i], dims_y[i]));-->new_dims.push_back((std::max)(dims_x[i], dims_y[i]));
你好,修改这行代码可以编译成功了。谢谢解答!
你好,现在Paddle已经有编译好的安装包了,请问你在什么任务场景下需要编译Paddle呀?比如是需要新增算子、还是需要修改飞桨源代码,或者有什么其他的用途呢?