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

Header path issues in librequest.so #556

Closed
philipp-schmidt opened this issue Aug 14, 2019 · 2 comments
Closed

Header path issues in librequest.so #556

philipp-schmidt opened this issue Aug 14, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@philipp-schmidt
Copy link

I'm trying to build a standalone c++ client, which should link and make use of librequest.so.
For this, I would like to use the tar file provided in the client docker, e.g. v1.5.0dev.clients.tar.gz

The content looks like this:

.
|-- bin
|   |-- ensemble_image_client
|   |-- image_client
|   |-- perf_client
|   |-- simple_callback_client
|   |-- simple_client
|   |-- simple_sequence_client
|   |-- simple_shm_client
|   `-- simple_string_client
|-- include
|   |-- api.pb.h
|   |-- model_config.pb.h
|   |-- request.h
|   |-- request_grpc.h
|   |-- request_http.h
|   |-- request_status.pb.h
|   `-- server_status.pb.h
|-- lib
|   `-- librequest.so
|-- python
|   |-- ensemble_image_client.py
|   |-- grpc_image_client.py
|   |-- image_client.py
|   |-- simple_callback_client.py
|   |-- simple_client.py
|   |-- simple_sequence_client.py
|   |-- simple_string_client.py
|   `-- tensorrtserver-1.5.0.dev0-py2.py3-none-linux_x86_64.whl
`-- v1.5.0dev.clients.tar.gz

So in my CMakeLists.txt I link and include the library like this:

# TRTIS client request library
INCLUDE_DIRECTORIES(/path/to/above/include)
link_directories(/path/to/above/lib)

In my main I include #include "request_grpc.h", which is correctly found. But in this "public" library header, I get the following error now:

In file included from /path/to/main.cpp:32:0:
/path/to/request_grpc.h:30:10: fatal error: src/clients/c++/request.h: No such file or directory
 #include "src/clients/c++/request.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Which makes sense, as those "public" library headers try to include from the path "src/clients/c++/", which of course does not exist in this context.

So how can I use the library headers? Or in more general terms: how would I install and use this library from e.g. /usr/lib and /usr/include?

@deadeyegoodwin deadeyegoodwin added the bug Something isn't working label Aug 14, 2019
@deadeyegoodwin
Copy link
Contributor

Yes, that is a bug. We should either fix those includes to expect a "flat" include directly like we have, or place them within the same include hierarchy as what they expect. Until we fix you should be able to work-around by re-arranging the includes into the locations they expect.

@philipp-schmidt
Copy link
Author

philipp-schmidt commented Aug 14, 2019

As a simple hotfix we use the following script to convert the install/include directory in the client docker file to a flat include hierarchy:

cd /workspace/install/include
sed -i -e "s/\"src\/core\//\"/" *             
sed -i -e "s/\"src\/clients\/c++\//\"/" *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants