Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win10 编译Paddle报错 #54850

Closed
xingmingyyj opened this issue Jun 25, 2023 · 11 comments
Closed

Win10 编译Paddle报错 #54850

xingmingyyj opened this issue Jun 25, 2023 · 11 comments
Assignees
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/close 已关闭 type/bug-report 报bug

Comments

@xingmingyyj
Copy link
Contributor

bug描述 Describe the Bug

环境
OS:Win10
Visual Studio:2017
cmake version 3.17.0
cmake 选项 :cmake .. -GNinja -DWITH_PYTHON=ON -DWITH_TESTING=ON

错误信息
[3082/3348] Linking CXX executable test\cpp\imperative\test_prepare_op.exe
FAILED: test/cpp/imperative/test_prepare_op.exe
cmd.exe /C "cd . && E:\AIC\AIC_env\cmake\bin\cmake.exe -E vs_link_exe --intdir=test\cpp\imperative\CMakeFiles\test_prepare_op.dir --rc=E:\WINDOW1\10\bin\1001771.0\x64\rc.exe --mt=E:\WINDOW1\10\bin\1001771.0\x64\mt.exe --manifests -- E:\AIC\AIC_env\VisualStudio2017\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\test_prepare_op.rsp /out:test\cpp\imperative\test_prepare_op.exe /implib:test\cpp\imperative\test_prepare_op.lib /pdb:test\cpp\imperative\test_prepare_op.pdb /version:0.0 /machine:x64 /ignore:4049 /ignore:4217 /ignore:4006 /ignore:4221 /NODEFAULTLIB:MSVCRT.LIB /INCREMENTAL:NO /subsystem:console && cd ."
LINK: command "E:\AIC\AIC_env\VisualStudio2017\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\test_prepare_op.rsp /out:test\cpp\imperative\test_prepare_op.exe /implib:test\cpp\imperative\test_prepare_op.lib /pdb:test\cpp\imperative\test_prepare_op.pdb /version:0.0 /machine:x64 /ignore:4049 /ignore:4217 /ignore:4006 /ignore:4221 /NODEFAULTLIB:MSVCRT.LIB /INCREMENTAL:NO /subsystem:console /MANIFEST /MANIFESTFILE:test\cpp\imperative\test_prepare_op.exe.manifest" failed (exit code 1120) with the following output:
正在创建库 test\cpp\imperative\test_prepare_op.lib 和对象 test\cpp\imperative\test_prepare_op.exp
test_prepare_op.cc.obj : error LNK2019: 无法解析的外部符号 "int __cdecl TouchOpRegistrar_relu(void)" (?TouchOpRegistrar_relu@@yahxz),该符号在函数 "void _cdecl `dynamic initializer for 'use_op_itself_relu''(void)" (??_Euse_op_itself_relu@@yaxxz) 中被引用
test\cpp\imperative\test_prepare_op.exe : fatal error LNK1120: 1 个无法解析的外部命令
[3085/3348] Linking CXX static library paddle\fluid\inference\libpaddle_inference_dummy_9.lib
Microsoft (R) Library Manager Version 14.16.27050.0
Copyright (C) Microsoft Corporation. All rights reserved.

删除发生错误的代码继续编译,最后编译成功。
执行命令:ctest -VV -R program_translator_test

E:\AIC\Paddle\build\test\cpp\ir\core>ctest -VV -R program_translator_test
UpdateCTestConfiguration from :E:/AIC/Paddle/build/test/cpp/ir/core/DartConfiguration.tcl
UpdateCTestConfiguration from :E:/AIC/Paddle/build/test/cpp/ir/core/DartConfiguration.tcl
Test project E:/AIC/Paddle/build/test/cpp/ir/core
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 10
Start 10: program_translator_test

10: Test command: E:\AIC\Paddle\build\test\cpp\ir\core\program_translator_test.exe
10: Environment variables:
10: FLAGS_cudnn_deterministic=true
10: Test timeout computed to be: 150
1/1 Test #10: program_translator_test ..........Exit code 0xc0000135
***Exception: 0.33 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) = 0.35 sec

The following tests FAILED:
10 - program_translator_test (Exit code 0xc0000135
)
Errors while running CTest

其他补充信息 Additional Supplementary Information

No response

@thisjiang
Copy link
Contributor

thisjiang commented Jun 25, 2023

删除发生错误的代码继续编译,最后编译成功

是指将文件test\cpp\imperative\test_prepare_op 删除了么?

cmake version 3.17.0

请问Paddle版本是?最新develop下推荐cmake版本为3.18.0

@thisjiang
Copy link
Contributor

thisjiang commented Jun 25, 2023

Visual Studio:2017

此外,Paddle develop最新分支CPP代码编译已采用C++17标准,VS2017版本编译develop最新代码可能会有标准支持不完全问题

@xingmingyyj
Copy link
Contributor Author

对,直接删除了对应的文件夹。Paddle是最新的develop版本。我更新一下环境再试一下。谢谢

@xingmingyyj
Copy link
Contributor Author

环境
OS:Win11
Visual Studio:2019
cmake version 3.18.0
Paddle版本:develop最新版
cmake 选项 :cmake .. -GNinja -DWITH_PYTHON=ON -DWITH_TESTING=ON
错误信息
[13/1285] Building CXX object paddle\fluid\platform\CMakeFiles\enforce_test.dir\enforce_test.cc.obj
FAILED: paddle/fluid/platform/CMakeFiles/enforce_test.dir/enforce_test.cc.obj
D:\MY_PROGRAME\VisualStutdio2019\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe /nologo /TP -DEIGEN_STRONG_INLINE=inline -DGOOGLE_GLOG_DLL_DECL="" -DHPPL_STUB_FUNC -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_MKLDNN -DPADDLE_WITH_MKLML -DPADDLE_WITH_POCKETFFT -DPADDLE_WITH_SSE3 -DPADDLE_WITH_TESTING -DUTF8PROC_STATIC -DWIN32_LEAN_AND_MEAN -D_XKEYCHECK_H -I. -I..\paddle\fluid\framework\io -Ithird_party\install\zlib\include -Ithird_party\install -Ithird_party\install\gflags\include -Ithird_party\install\glog\include -I..\third_party\eigen3 -I..\third_party\threadpool -I..\third_party\dlpack\include -Ithird_party\install\xxhash\include -Ithird_party\install\warpctc\include -Ithird_party\install\warprnnt\include -Ithird_party\install\utf8proc\include -Ithird_party\install\mklml\include -Ithird_party\install\mkldnn\include -Ithird_party\install\protobuf\include -ID:\MY_PROGRAME\anaconda\include -ID:\MY_PROGRAME\anaconda\Lib\site-packages\numpy\core\include -Ithird_party\pybind\src\extern_pybind\include -Ithird_party\install\gtest\include -Ithird_party\install\cryptopp\include -Ithird_party\pocketfft\src -Ithird_party\dirent\src\extern_dirent\include -I..\ -I..\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\fluid\platform\CMakeFiles\enforce_test.dir\enforce_test.cc.obj /Fdpaddle\fluid\platform\CMakeFiles\enforce_test.dir\ /FS -c ..\paddle\fluid\platform\enforce_test.cc
..\paddle\fluid\platform\enforce_test.cc(603): fatal error C1001: 内部编译器错误。
(编译器文件“msc1.cpp”,第 1603 行)
要解决此问题,请尝试简化或更改上面所列位置附近的程序。
如果可以,请在此处提供重现步骤: https://developercommunity.visualstudio.com
请选择 Visual C++
“帮助”菜单上的“技术支持”命令,或打开技术支持帮助文件来获得详细信息。
“D:\MY_PROGRAME\VisualStutdio2019\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe”中的内部编译器错误
请选择 Visual C++
“帮助”菜单上的“技术支持”命令,或打开技术支持帮助文件来获得详细信息
[26/1285] Building CXX object paddle\fluid\framework\CMakeFiles\lod_tensor_test.dir\lod_tensor_test.cc.obj
ninja: build stopped: subcommand failed.

@zhwesky2010
Copy link
Contributor

是不是 https://baijiahao.baidu.com/s?id=1746635674717445829&wfr=spider&for=pc 要重装下NetFramework

@paddle-bot paddle-bot bot added status/following-up 跟进中 and removed status/new-issue 新建 labels Jun 27, 2023
@xingmingyyj
Copy link
Contributor Author

Exit code 0xc0000135好像是因为找不到dll文件 将对应的dll放到对应exe文件夹下 错误就没了

@thisjiang
Copy link
Contributor

@xingmingyyj Hi~请问这个问题已经解决了么?如果解决了的话我就close这个issue了

@xingmingyyj
Copy link
Contributor Author

VS2019编译还有错误
环境
OS:Win11
Visual Studio:2019
cmake version 3.18.0
Paddle版本:develop最新版
cmake 选项 :cmake .. -GNinja -DWITH_PYTHON=ON -DWITH_TESTING=ON
错误信息
[13/1285] Building CXX object paddle\fluid\platform\CMakeFiles\enforce_test.dir\enforce_test.cc.obj
FAILED: paddle/fluid/platform/CMakeFiles/enforce_test.dir/enforce_test.cc.obj
D:\MY_PROGRAME\VisualStutdio2019\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe /nologo /TP -DEIGEN_STRONG_INLINE=inline -DGOOGLE_GLOG_DLL_DECL="" -DHPPL_STUB_FUNC -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_MKLDNN -DPADDLE_WITH_MKLML -DPADDLE_WITH_POCKETFFT -DPADDLE_WITH_SSE3 -DPADDLE_WITH_TESTING -DUTF8PROC_STATIC -DWIN32_LEAN_AND_MEAN -D_XKEYCHECK_H -I. -I..\paddle\fluid\framework\io -Ithird_party\install\zlib\include -Ithird_party\install -Ithird_party\install\gflags\include -Ithird_party\install\glog\include -I..\third_party\eigen3 -I..\third_party\threadpool -I..\third_party\dlpack\include -Ithird_party\install\xxhash\include -Ithird_party\install\warpctc\include -Ithird_party\install\warprnnt\include -Ithird_party\install\utf8proc\include -Ithird_party\install\mklml\include -Ithird_party\install\mkldnn\include -Ithird_party\install\protobuf\include -ID:\MY_PROGRAME\anaconda\include -ID:\MY_PROGRAME\anaconda\Lib\site-packages\numpy\core\include -Ithird_party\pybind\src\extern_pybind\include -Ithird_party\install\gtest\include -Ithird_party\install\cryptopp\include -Ithird_party\pocketfft\src -Ithird_party\dirent\src\extern_dirent\include -I..\ -I..\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\fluid\platform\CMakeFiles\enforce_test.dir\enforce_test.cc.obj /Fdpaddle\fluid\platform\CMakeFiles\enforce_test.dir\ /FS -c ..\paddle\fluid\platform\enforce_test.cc
..\paddle\fluid\platform\enforce_test.cc(603): fatal error C1001: 内部编译器错误。
(编译器文件“msc1.cpp”,第 1603 行)
要解决此问题,请尝试简化或更改上面所列位置附近的程序。
如果可以,请在此处提供重现步骤: https://developercommunity.visualstudio.com/
请选择 Visual C++
“帮助”菜单上的“技术支持”命令,或打开技术支持帮助文件来获得详细信息。
“D:\MY_PROGRAME\VisualStutdio2019\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe”中的内部编译器错误
请选择 Visual C++
“帮助”菜单上的“技术支持”命令,或打开技术支持帮助文件来获得详细信息
[26/1285] Building CXX object paddle\fluid\framework\CMakeFiles\lod_tensor_test.dir\lod_tensor_test.cc.obj
ninja: build stopped: subcommand failed.

@lazyn1997
Copy link

同样的问题,不加-DWITH_TESTING=ON时,CMake 3.17.0编译通过,加了之后就报错了,和上述一样的错误

@lazyn1997
Copy link

CMake换成3.18.0还是相同的错误

@lazyn1997
Copy link

lazyn1997 commented Jul 13, 2023

添加-DWITH_TESTING=ON后编译报错,无法进行单元测试
image
将报错位置代码段注释掉,如下图所示
image
执行ninja -j32编译成功,执行ctest -R test_logsumexp运行logsumexp的单测成功,结果如下
image
搜索这个错误,有用户提出可以先把报错位置代码注释掉编译一遍,成功后取消注释二次编译,不会再出现这个错误,我进行了尝试,注释后编译成功,取消注释后二次编译还会有同样的错误。

@paddle-bot paddle-bot bot added the PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc label Sep 21, 2023
@paddle-bot paddle-bot bot added status/close 已关闭 and removed status/following-up 跟进中 labels Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/close 已关闭 type/bug-report 报bug
Projects
None yet
Development

No branches or pull requests

4 participants