【windows 编译】 缺少第三方库 protobuf 导致编译失败
bug描述 Describe the Bug
我的cmake设置:
-D Protobuf_DIR="${vcpkgPath}/installed/${platform}-windows-static/share/protobuf" `
-D Protobuf_INCLUDE_DIR="${vcpkgPath}/installed/${platform}-windows-static/include" `
-D Protobuf_LIBRARY="${vcpkgPath}/installed/${platform}-windows-static/lib/libprotobuf.lib" `
-D Protobuf_LIBRARY_DEBUG="${vcpkgPath}/installed/${platform}-windows-static/debug/lib/libprotobufd.lib" `
-D Protobuf_LITE_LIBRARY="${vcpkgPath}/installed/${platform}-windows-static/lib/libprotobuf-lite.lib" `
-D Protobuf_LITE_LIBRARY_DEBUG="${vcpkgPath}/installed/${platform}-windows-static/debug/lib/libprotobuf-lited.lib" `
-D Protobuf_PROTOC_LIBRARY="${vcpkgPath}/installed/${platform}-windows-static/lib/libprotoc.lib" `
-D Protobuf_PROTOC_LIBRARY_DEBUG="${vcpkgPath}/installed/${platform}-windows-static/debug/lib/libprotocd.lib" `
-D Protobuf_PROTOC_EXECUTABLE="${vcpkgPath}/installed/${platform}-windows-static/tools/protobuf/protoc.exe" `
-D Protobuf_INCLUDE_DIRS="${vcpkgPath}/installed/${platform}-windows-static/include" `
configure之后,上面这些设置项会被强制覆盖为以下选项:
-D PROTOBUF_INCLUDE_DIR="D:/CMake/Paddle/cmake/third_party/install/protobuf/include" `
-D PROTOBUF_LIBRARY="D:/CMake/Paddle/cmake/third_party/install/protobuf/lib/libprotobuf.lib" `
.........
被重置后的选项我就不一一列出了。实际上“D:/CMake/Paddle/cmake/third_party/install/protobuf”为空文件夹,Protobuf 并没有被安装。最后导致编译失败
其他补充信息 Additional Supplementary Information
Win11 VS 2022 CMAKE 3.21.2
No response
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网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版本是多少呢?建议删除Build重新执行cmake,windows的编译操作可参考https://www.paddlepaddle.org.cn/documentation/docs/zh/install/compile/windows-compile.html 如依旧报错可以手动安装protobuf。 如果还是不行建议拉最新的paddle源码进行编译
Paddle版本是PaddlePaddle 2.2.2 Release 我目前是把自己外部安装的protobuf拷贝到“D:/CMake/Paddle/cmake/third_party/install/protobuf”下面进行编译成功。 不过这应该只是临时措施,我觉得paddle在protobuf安装这一块存在问题,不能像其他第三方库可以自动安装到对应路径下。
非常感谢您的反馈,目前Paddle的在进行源码编译时需要开发者下载protobuf的,后续我们会不断完善的,后续如果支持自动安装会更新到安装文档中的 https://www.paddlepaddle.org.cn/documentation/docs/zh/install/compile/windows-compile.html 感谢您的支持
有点奇怪,按该文档,我发现我一直有安装好的python版本protobuf,不过也没有被正确识别。也许我这边的环境有点问题。非常感谢您的耐心回复。
你好,现在Paddle已经有编译好的安装包了,请问你在什么任务场景下需要编译Paddle呀?比如是需要新增算子、还是需要修改飞桨源代码,或者有什么其他的用途呢?