Skip to content
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

Refactor Onnx runtime Server to only use public APIs #1271

Merged
merged 28 commits into from
Jul 4, 2019
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@
[submodule "cmake/external/eigen"]
path = cmake/external/eigen
url = https://github.com/eigenteam/eigen-git-mirror.git
[submodule "cmake/external/spdlog"]
path = cmake/external/spdlog
url = https://github.com/gabime/spdlog.git
1 change: 1 addition & 0 deletions cmake/external/spdlog
Submodule spdlog added at 352281
11 changes: 8 additions & 3 deletions cmake/onnxruntime_server.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ endif()
# Setup dependencies
include(get_boost.cmake)
set(re2_src ${REPO_ROOT}/cmake/external/re2)
set(SPDLOG_BUILD_EXAMPLES OFF)
add_subdirectory(${REPO_ROOT}/cmake/external/spdlog)

# Setup source code
set(onnxruntime_server_lib_srcs
Expand All @@ -33,6 +35,7 @@ set(onnxruntime_server_lib_srcs
"${ONNXRUNTIME_ROOT}/server/executor.cc"
"${ONNXRUNTIME_ROOT}/server/converter.cc"
"${ONNXRUNTIME_ROOT}/server/util.cc"
"${ONNXRUNTIME_ROOT}/server/serializing/tensorprotoutils.cc"
)
if(NOT WIN32)
if(HAS_UNUSED_PARAMETER)
Expand All @@ -41,6 +44,7 @@ if(NOT WIN32)
set_source_files_properties(${ONNXRUNTIME_ROOT}/server/executor.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties(${ONNXRUNTIME_ROOT}/server/converter.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties(${ONNXRUNTIME_ROOT}/server/util.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
set_source_files_properties(${ONNXRUNTIME_ROOT}/server/serializing/tensorprotoutils.cc PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
endif()
endif()

Expand Down Expand Up @@ -70,8 +74,7 @@ target_link_libraries(onnxruntime_server_http_core_lib PRIVATE
add_library(onnxruntime_server_lib ${onnxruntime_server_lib_srcs})
onnxruntime_add_include_to_target(onnxruntime_server_lib gsl onnx_proto server_proto)
target_include_directories(onnxruntime_server_lib PRIVATE
${ONNXRUNTIME_ROOT}
${CMAKE_CURRENT_BINARY_DIR}/onnx
${ONNXRUNTIME_INCLUDE_DIR}
${ONNXRUNTIME_ROOT}/server
${ONNXRUNTIME_ROOT}/server/http
${ONNXRUNTIME_ROOT}/server/logging
Expand All @@ -94,6 +97,8 @@ target_link_libraries(onnxruntime_server_lib PRIVATE
onnxruntime_common
onnxruntime_mlas
${onnxruntime_EXTERNAL_LIBRARIES}
PUBLIC
spdlog::spdlog
)

if (onnxruntime_USE_SYSLOG)
Expand Down Expand Up @@ -124,7 +129,7 @@ message(STATUS "ONNX Runtime Server latest commit id is: ${onnxruntime_LATEST_CO
onnxruntime_add_include_to_target(${SERVER_APP_NAME} onnxruntime_session onnxruntime_server_lib gsl onnx onnx_proto server_proto)

target_include_directories(${SERVER_APP_NAME} PRIVATE
${ONNXRUNTIME_ROOT}
${ONNXRUNTIME_INCLUDE_DIR}
${ONNXRUNTIME_ROOT}/server/http
)

Expand Down
4 changes: 2 additions & 2 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -611,12 +611,12 @@ if (onnxruntime_BUILD_SERVER)
add_library(onnxruntime_test_utils_for_server ${onnxruntime_test_server_src})
onnxruntime_add_include_to_target(onnxruntime_test_utils_for_server onnxruntime_test_utils_for_framework gtest gmock gsl onnx onnx_proto server_proto)
add_dependencies(onnxruntime_test_utils_for_server onnxruntime_server_lib onnxruntime_server_http_core_lib Boost ${onnxruntime_EXTERNAL_DEPENDENCIES})
target_include_directories(onnxruntime_test_utils_for_server PUBLIC ${Boost_INCLUDE_DIR} ${REPO_ROOT}/cmake/external/re2 ${CMAKE_CURRENT_BINARY_DIR}/onnx ${ONNXRUNTIME_ROOT}/server/http ${ONNXRUNTIME_ROOT}/server/http/core PRIVATE ${ONNXRUNTIME_ROOT} )
target_include_directories(onnxruntime_test_utils_for_server PUBLIC ${Boost_INCLUDE_DIR} ${REPO_ROOT}/cmake/external/re2 ${CMAKE_CURRENT_BINARY_DIR}/onnx ${ONNXRUNTIME_ROOT}/server ${ONNXRUNTIME_ROOT}/server/http ${ONNXRUNTIME_ROOT}/server/http/core PRIVATE ${ONNXRUNTIME_ROOT} )
if(UNIX)
target_compile_options(onnxruntime_test_utils_for_server PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -Wno-error=sign-compare>"
"$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:-Wno-error=sign-compare>")
endif()
target_link_libraries(onnxruntime_test_utils_for_server ${Boost_LIBRARIES})
target_link_libraries(onnxruntime_test_utils_for_server ${Boost_LIBRARIES} spdlog::spdlog)


AddTest(
Expand Down
Loading