-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix the problem that protobuf cannot be used as a DEPS argument in cc… #2582
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有一点问题不确定。。如果没问题,就merge吧
cmake/external/protobuf.cmake
Outdated
MESSAGE(STATUS "Protobuf protoc executable: ${PROTOBUF_PROTOC_EXECUTABLE}") | ||
MESSAGE(STATUS "Protobuf library: ${PROTOBUF_LIBRARY}") | ||
MESSAGE(STATUS "Protobuf version: ${PROTOBUF_VERSION}") | ||
INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) | ||
|
||
# Assuming that all the protobuf libraries are of the same type. | ||
IF(${PROTOBUF_LIBRARY} MATCHES "${STATIC_LIBRARY_SUFFIX}$") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不太清楚STATIC_LIBRARY_SUFFIX定义在哪?
https://cmake.org/cmake/help/v3.0/variable/CMAKE_STATIC_LIBRARY_SUFFIX.html
是这个变量么?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哦,这个是我定义在system.cmake里面的。cmake系统本身有定义这个变量吗,我看下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, 都替换成CMake系统变量了,诸如:
CMAKE_STATIC_LIBRARY_PREFIX
CMAKE_STATIC_LIBRARY_SUFFIX
- ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* fix name of pretrain weights * format, test=document_fix
Fix #2568
使用了#2569 中的测试代码
paddle/framework/example.proto
和paddle/framework/example.cc
,paddle/framework/CMakelist.txt
中增加如下内容:注意,生成"*.pb.cc"和"*.pb.h"采用paddle/proto/CMakelist.txt中的方式, 是因为CMake系统自带的macro
protobuf_generate_cpp
存在以下问题:PROTOBUF_ROOT
时不会调用find_package(Protobuf)
,会出现如下错误:protobuf_generate_cpp
不能设置依赖关系,如果需要使用third_party
目录下编译好的protoc
,使用make -j12
编译可能会出现出现错误: