diff --git a/BCLOUD b/BCLOUD index d55332688b85903ed8f71f24a1e0ff88a3f574a3..744cb5458a450b49c322ff017d978767528ebf03 100644 --- a/BCLOUD +++ b/BCLOUD @@ -23,5 +23,6 @@ Directory('pdcodegen') Directory('configure') Directory('predictor') Directory('inferencer-fluid-cpu') -Directory('serving') +Directory('demo-serving') Directory('sdk-cpp') +Directory('demo-client') diff --git a/BCLOUD.client b/BCLOUD.client index 136872e39c6c640d84bd6df05c4d80c70c2d3f05..96ad866e6ec7931dde8e7231f6d403db210e241e 100644 --- a/BCLOUD.client +++ b/BCLOUD.client @@ -15,3 +15,4 @@ CONFIGS('baidu/third-party/glog@v0.3.x@git_branch') Directory('pdcodegen') Directory('configure') Directory('sdk-cpp') +Directory('demo-client') diff --git a/README.md b/README.md index 2a6bbbcce2b3b93404c8b8089eb953fd712e9724..aa06fa20dab45df342326669de758727e1404ca6 100644 --- a/README.md +++ b/README.md @@ -42,10 +42,10 @@ Paddle serving框架为策略工程师提供以下三层面的功能性扩展: | |-- src | `-- tests |-- demo-client # Client端示例;包括如文本分类、图像分类等任务的例子 -| |-- conf # conf目录 -| |-- data # data目录 +| |-- conf # Client示例的conf目录 +| |-- data # Client示例的data目录 | | \-- images -| `-- src # src目录 +| `-- src # Client示例的src目录 |-- demo-serving # Serving示例。该目录下代码与libpdserving.a联编,产出一个可执行的serving二进制 | |-- conf # Serving示例的Conf目录 | |-- data # Serving示例的data目录 diff --git a/demo-client/BCLOUD b/demo-client/BCLOUD new file mode 100644 index 0000000000000000000000000000000000000000..43c91fbead8533e0774c9784763437a1425ded08 --- /dev/null +++ b/demo-client/BCLOUD @@ -0,0 +1,58 @@ +#edit-mode: -*- python -*- +#coding:utf-8 + +WORKROOT('../../../../') + +#Preprocessor flags. +CPPFLAGS(r'-D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__const__= -Dtypeof=__typeof__ -DUSE_PTHREAD') +#CPPFLAGS(r'-DVERSION=\"%s\"' % SVN_LAST_CHANGED_REV()) + +#C++ flags. +CXXFLAGS('-g -O2 -pipe -W -Wall -fPIC -fno-omit-frame-pointer -Wno-deprecated -Wno-unused-parameter -Wno-unused-variable -Wno-unused-local-typedefs -Wno-sign-compare -std=c++11') + +#link flags +LDFLAGS('-lpthread -lcrypto -lrt -lssl -ldl -lz -std=c++11') + +ImportConfigsFrom('..') + +INCPATHS('$INC') +INCPATHS('$INC/sdk-cpp') +INCPATHS('$INC/sdk-cpp/include') +INCPATHS('$OUT_ROOT/third-64/protobuf/output/include') + +LIBS('$OUT/lib/libpdconfigure.a') + +CONFIGS('baidu/base/baidu-rpc@ci-base') +CONFIGS('baidu/third-party/gflags@v2.0.0@git_branch') +CONFIGS('baidu/third-party/glog@v0.3.x@git_branch') +CONFIGS('baidu/third-party/opencv@master@git_branch') + +# DELETE_AUTO_LIBS('$OUT_ROOT/third-64/glog/output/lib/libglog.a') +DELETE_AUTO_LIBS('$OUT_ROOT/third-64/gflags/output/lib/libgflags.a') +DELETE_AUTO_LIBS('$OUT_ROOT/third-64/gflags/output/lib/libgflags_nothreads.a') + +PROTOFLAGS( + '--plugin=protoc-gen-pdcodegen=../pdcodegen/plugin/pdcodegen', + '--pdcodegen_out proto --proto_path=.', + '--proto_path=../predictor/proto') + +HEADERS(GLOB_GEN_SRCS('../configure/proto/sdk_configure.pb.h'), '$INC/sdk-cpp') +HEADERS(GLOB_GEN_SRCS('../predictor/proto/builtin_format.pb.h'), '$INC/sdk-cpp') +HEADERS(GLOB_GEN_SRCS('../predictor/proto/pds_option.pb.h'), '$INC/sdk-cpp') +HEADERS(GLOB_GEN_SRCS('proto/*.pb.h'), '$INC/sdk-cpp') + +HEADERS('include/*.h', '$INC/sdk-cpp/include') +HEADERS('include/*.hpp', '$INC/sdk-cpp/include') + +# Application +#bin +Application('ximage', Sources('src/ximage.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) +Application('echo', Sources('src/echo.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) +Application('dense_format', Sources('src/dense_format.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) +Application('sparse_format', Sources('src/sparse_format.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) +Application('int64tensor_format', Sources('src/int64tensor_format.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) +Application('text_classification', Sources('src/text_classification.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) +Application('text_classification_press', Sources('src/text_classification_press.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) + +OUTPUT('conf', '$OUT/demo/client') +OUTPUT('data', '$OUT/demo/client') diff --git a/demo-serving/BCLOUD b/demo-serving/BCLOUD index f011e08d67d1dbf4fbdcb5abd12bfeb74e1bf08b..ffa9bc422c473be361c7e28a89f8cf4ab96da301 100644 --- a/demo-serving/BCLOUD +++ b/demo-serving/BCLOUD @@ -46,8 +46,7 @@ PROTOFLAGS( '--pdcodegen_out proto --proto_path=.', '--proto_path=../predictor/proto') -HEADERS(GLOB_GEN_SRCS('../configure/proto/server_configure.pb.h'), '$INC/serving') -HEADERS(GLOB_GEN_SRCS('proto/*.pb.h'), '$INC/serving') +HEADERS(GLOB_GEN_SRCS('proto/*.pb.h'), '$INC/demo-serving') # Application Application('serving', Sources(GLOB(' '.join(cpp_source_dirs))), WholeArchives('$OUT/lib/libinferencer-fluid-cpu.a')) diff --git a/sdk-cpp/BCLOUD b/sdk-cpp/BCLOUD index e7291511623c4b232abffa97728b9ed9da7fa002..73db519eb8249a0f7628b3739e90f9da4a21c55f 100644 --- a/sdk-cpp/BCLOUD +++ b/sdk-cpp/BCLOUD @@ -49,16 +49,3 @@ user_sources += ' ../predictor/proto/builtin_format.proto ../predictor/proto/pds # .a StaticLibrary('pdsdk-cpp', Sources(user_sources)) - -# Application -#bin -Application('ximage', Sources('demo/ximage.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) -Application('echo', Sources('demo/echo.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) -Application('dense_format', Sources('demo/dense_format.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) -Application('sparse_format', Sources('demo/sparse_format.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) -Application('int64tensor_format', Sources('demo/int64tensor_format.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) -Application('text_classification', Sources('demo/text_classification.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) -Application('text_classification_press', Sources('demo/text_classification_press.cpp'), WholeArchives('$OUT/lib/libpdsdk-cpp.a')) - -OUTPUT('conf', '$OUT/demo/client') -OUTPUT('data', '$OUT/demo/client')