serving: fix -fPIE option

This commit is contained in:
xuyongfei 2020-09-10 14:50:51 +08:00
parent 5166fe832d
commit 0b48927c9f
2 changed files with 5 additions and 3 deletions

View File

@ -99,7 +99,11 @@ add_executable(ms_serving ${SERVING_SRC})
target_link_libraries(ms_serving mindspore::event mindspore::event_pthreads)
target_link_libraries(ms_serving ${_REFLECTION} ${_GRPC_GRPCPP} ${_PROTOBUF_LIBPROTOBUF} pthread)
set_target_properties(ms_serving PROPERTIES POSITION_INDEPENDENT_CODE ON)
include(CheckPIESupported)
check_pie_supported()
set_property(TARGET ms_serving PROPERTY POSITION_INDEPENDENT_CODE TRUE)
if (ENABLE_D)
add_compile_definitions(ENABLE_D)
target_link_libraries(ms_serving ${RUNTIME_LIB})

View File

@ -72,7 +72,6 @@ grpc::Status CreatGRPCStatus(const Status &status) {
// Service Implement
class MSServiceImpl final : public MSService::Service {
grpc::Status Predict(grpc::ServerContext *context, const PredictRequest *request, PredictReply *reply) override {
std::lock_guard<std::mutex> lock(mutex_);
MSI_TIME_STAMP_START(Predict)
auto res = Session::Instance().Predict(*request, *reply);
MSI_TIME_STAMP_END(Predict)
@ -87,7 +86,6 @@ class MSServiceImpl final : public MSService::Service {
MSI_LOG(INFO) << "TestService call";
return grpc::Status::OK;
}
std::mutex mutex_;
};
static std::pair<struct evhttp *, struct event_base *> NewHttpServer() {