-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP send recv op * WIP send recv * put grpc impl in details * put grpc impl in details * update wip * update proto * update proto * update proto * clean cmake * wip on op implementations * wip on op implementations * compile ok adding ut * wip unitest * add extern cares for linking * wip add ut * working version send recv * revert optimizer.py * update test cmake * add libtool to dockerfile * update cmake dependency * update cmake depends * update cmake grpc depends * fix cmake dependency * fix compile error * fix compile * follow comments * update * update copyfrom
- Loading branch information
1 parent
dc82a30
commit 0a8a86e
Showing
21 changed files
with
941 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,3 @@ AllowAllParametersOfDeclarationOnNextLine: true | |
BinPackParameters: false | ||
BinPackArguments: false | ||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
IF(MOBILE_INFERENCE) | ||
return() | ||
ENDIF() | ||
|
||
include (ExternalProject) | ||
|
||
# NOTE: c-ares is needed when linking with grpc. | ||
|
||
SET(CARES_SOURCES_DIR ${THIRD_PARTY_PATH}/cares) | ||
SET(CARES_INSTALL_DIR ${THIRD_PARTY_PATH}/install/cares) | ||
SET(CARES_INCLUDE_DIR "${CARES_INSTALL_DIR}/include/" CACHE PATH "cares include directory." FORCE) | ||
|
||
ExternalProject_Add( | ||
extern_cares | ||
GIT_REPOSITORY "https://github.com/c-ares/c-ares.git" | ||
GIT_TAG "cares-1_13_0" | ||
PREFIX ${CARES_SOURCES_DIR} | ||
UPDATE_COMMAND "" | ||
CONFIGURE_COMMAND ./buildconf && ./configure --disable-shared --prefix=${CARES_INSTALL_DIR} | ||
BUILD_IN_SOURCE 1 | ||
BUILD_COMMAND make | ||
INSTALL_COMMAND make install | ||
) | ||
|
||
ADD_LIBRARY(cares STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET cares PROPERTY IMPORTED_LOCATION | ||
"${CARES_INSTALL_DIR}/lib/libcares.a") | ||
|
||
include_directories(${CARES_INCLUDE_DIR}) | ||
ADD_DEPENDENCIES(cares extern_cares) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
IF(MOBILE_INFERENCE) | ||
return() | ||
ENDIF() | ||
|
||
include (ExternalProject) | ||
|
||
SET(GRPC_SOURCES_DIR ${THIRD_PARTY_PATH}/grpc) | ||
SET(GRPC_INSTALL_DIR ${THIRD_PARTY_PATH}/install/grpc) | ||
SET(GRPC_INCLUDE_DIR "${GRPC_INSTALL_DIR}/include/" CACHE PATH "grpc include directory." FORCE) | ||
SET(GRPC_CPP_PLUGIN "${GRPC_INSTALL_DIR}/bin/grpc_cpp_plugin" CACHE FILEPATH "GRPC_CPP_PLUGIN" FORCE) | ||
|
||
ExternalProject_Add( | ||
extern_grpc | ||
DEPENDS protobuf zlib | ||
GIT_REPOSITORY "https://github.com/grpc/grpc.git" | ||
GIT_TAG "v1.7.x" | ||
PREFIX ${GRPC_SOURCES_DIR} | ||
UPDATE_COMMAND "" | ||
CONFIGURE_COMMAND "" | ||
BUILD_IN_SOURCE 1 | ||
BUILD_COMMAND make | ||
INSTALL_COMMAND make prefix=${GRPC_INSTALL_DIR} install | ||
) | ||
|
||
# FIXME(typhoonzero): hack to get static lib path, try a better way like merge them. | ||
ADD_LIBRARY(grpc++_unsecure STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET grpc++_unsecure PROPERTY IMPORTED_LOCATION | ||
"${GRPC_INSTALL_DIR}/lib/libgrpc++_unsecure.a") | ||
|
||
ADD_LIBRARY(grpc++ STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET grpc++ PROPERTY IMPORTED_LOCATION | ||
"${GRPC_INSTALL_DIR}/lib/libgrpc++.a") | ||
ADD_LIBRARY(gpr STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET gpr PROPERTY IMPORTED_LOCATION | ||
"${GRPC_INSTALL_DIR}/lib/libgpr.a") | ||
|
||
ADD_LIBRARY(grpc_unsecure STATIC IMPORTED GLOBAL) | ||
SET_PROPERTY(TARGET grpc_unsecure PROPERTY IMPORTED_LOCATION | ||
"${GRPC_INSTALL_DIR}/lib/libgrpc_unsecure.a") | ||
|
||
include_directories(${GRPC_INCLUDE_DIR}) | ||
ADD_DEPENDENCIES(grpc++_unsecure extern_grpc) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.