triton-inference-server/server

CMake problems for client library in v2.3.0

Closed this issue · 2 comments

Description
This issue relates to building just the client library, without any other components or external packages (these are provided separately). To do this, I follow https://github.com/triton-inference-server/server/blob/v2.3.0/build/CMakeLists.txt#L433-L455 to generate a CMake command (with flags modified as needed). See https://github.com/cms-sw/cmsdist/blob/0766b90a33d091258910f4fc06587c4152f548e6/triton-inference-server.spec.

Several modifications/deletions are necessary to make this work:

  1. Remove RapidJSON dependence from src/core/CMakeLists.txt and triton-json-library from src/clients/c++/library/CMakeLists.txt; disable HTTP client using -DTRITON_ENABLE_HTTP=OFF. Somehow, the RapidJSON dependence isn't quite declared properly, and the above CMake command doesn't find its headers (even if the RapidJSON CMake config is located). This is related to #1429.
    1b. It could also be useful to specify a RapidJSON version or commit hash that's compatible with Triton, since the central repository hasn't tagged a new version in 4 years.
  2. #1846 introduced -DTRITON_CLIENT_SKIP_EXAMPLES, which is very useful for production builds of the client. However, the python client expects perf_client (which is part of the examples) to be available: https://github.com/triton-inference-server/server/blob/v2.3.0/src/clients/python/library/setup.py#L89. There's no flag to disable the python client build specifically, so for the moment, it's necessary to remove src/clients/python from build/client/CMakeLists.txt.
  3. The C++ client build tries to install all the external libraries: https://github.com/triton-inference-server/server/blob/v2.3.0/src/clients/c%2B%2B/library/CMakeLists.txt#L142-L164, etc. If the client is built standalone, these external libraries may be obtained from other locations, so CMake will not find them at the specified paths. It would be useful to have a flag to disable this (currently done by hand).
  4. The generated header files src/core/model_config.pb.h, src/core/grpc_service.grpc.pb.h, and src/core/grpc_service.pb.h are not installed by default with make install, but these are needed to access certain parts of the C++ client API (currently done by hand).
    4b. src/core/model_config.h also provides some useful function interfaces, but currently this can't be installed in the normal way, because it includes other headers from src/core (rather than using the installed path, like the generated headers).

Triton Information
v2.3.0, built myself.

To Reproduce
The CMake command in the above linked .spec file relies on the external dependencies being provided as RPMs using a custom build system. The complete setup is somewhat involved, but can be provided if the descriptions here aren't sufficient to understand the problems.

Expected behavior
CMake and make run successfully and all necessary headers and libraries are installed.

dzier commented

I am not understanding what the issue here is. Are you trying to build a minimal client library? Do you find an issue with the instructions here https://github.com/triton-inference-server/server/blob/main/docs/model_configuration.md#scheduling-and-batching?

I'm trying to build the client to be compatible with a complicated software environment, in which the necessary dependencies (grpc, protobuf, etc.) are already provided and the unnecessary dependencies (rapidjson, etc.) are not desired. The existing build instructions (I think you meant to link https://github.com/triton-inference-server/client#getting-the-client-libraries-and-examples ?) don't cover this use case.

However, this issue is also very outdated, and I'm writing up a new one for v2.11.0. I'll close this and we can continue the discussion there once I finalize it.