-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
protobuf link error when run test on Macos #2457
Comments
It is strange. The found |
Yes, It is a mismatch problem of protobuf. Here is my environment.
I had made a double check, everything looks correct in the right place.
seems nothing is wrong. So, my problem is why paddle choose binary in system and the library from third_party?, I thought the answer will show us the right way. Thanks! |
@dzhwinter What is your cmake command? |
only one command of |
@dzhwinter you can add some debug logs to see what exactly happend: SET(PROTOBUF_VERSION 3.1)
IF(NOT CMAKE_CROSSCOMPILING)
FIND_PACKAGE(Protobuf ${PROTOBUF_VERSION})
message(STATUS ${PROTOBUF_ROOT})
IF(PROTOBUF_FOUND)
message(STATUS "found system protobuf")
SET_PROTOBUF_VERSION()
IF("${PROTOBUF_VERSION}" VERSION_LESS "3.1.0")
SET(PROTOBUF_FOUND OFF)
ENDIF()
ENDIF(PROTOBUF_FOUND)
ELSE()
build_protobuf(protobuf_host TRUE)
LIST(APPEND external_project_dependencies protobuf_host)
SET(PROTOBUF_PROTOC_EXECUTABLE ${protobuf_host_PROTOC_EXECUTABLE}
CACHE FILEPATH "protobuf executable." FORCE)
ENDIF()
IF(NOT PROTOBUF_FOUND)
message("need to build protobuf")
build_protobuf(protobuf FALSE)
LIST(APPEND external_project_dependencies protobuf)
SET(PROTOBUF_INCLUDE_DIR ${protobuf_INCLUDE_DIR}
CACHE PATH "protobuf include directory." FORCE)
IF(NOT CMAKE_CROSSCOMPILING)
SET(PROTOBUF_PROTOC_EXECUTABLE ${protobuf_PROTOC_EXECUTABLE}
CACHE FILEPATH "protobuf executable." FORCE)
ENDIF()
SET(PROTOBUF_LITE_LIBRARY ${protobuf_LITE_LIBRARY} CACHE FILEPATH "protobuf lite library." FORCE)
SET(PROTOBUF_LIBRARY ${protobuf_LIBRARY} CACHE FILEPATH "protobuf library." FORCE)
SET(PROTOBUF_PROTOC_LIBRARY ${protobuf_PROTOC_LIBRARY} CACHE FILEPATH "protoc library." FORCE)
ENDIF(NOT PROTOBUF_FOUND) |
after delete all these mess of cmake code, just leave behind of INCLUDE(ExternalProject)
FIND_PACKAGE(Protobuf ${PROTOBUF_VERSION})
INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) use system |
If you can reproduce this issue, please record the exact step, and reopen this issue. Thanks. |
build with the lastest develop branch run test will report me protobuf link error. I can't run any test case. Error message e.g.
paddle use the thrid_party protobuf.
The text was updated successfully, but these errors were encountered: