Search code examples
c++grpcicc

grpc and Intel compiler


I would like to use gRPC as a bridge/glue between C++ and Java components (on both Windows and Linux although at the moment I'm more interested in Windows solution) but the main blocker I'm currently facing is lack of support for Intel compiler (I guess mainly due to third party dependencies like abseil for example which don't support it) which is used by some components. Normally I would go through all errors and try to fix them myself but as I'm not C++ expert that may not end up well plus perhaps there is another way to bypass that problem.

What I mean by "bypassing" is strictly speaking I don't have to compile new component with ICC as long as there is another way of plugging my new library/code into existing C++ project (which is compiled with ICC). I know that I'm oversimplifying here (and with C++ it's never that easy) but at the end it should just be a matter of adding another DLL to app dependencies. I read few rather old threads on mixing different C++ compilers and while not recommended it seems doable but suggestions on how to do that seemed like an overkill so I'm wondering whether there is a simpler way of (just) linking and using my library/binary without falling back to COM (perhaps things moved on in recent years and there is a better way of doing it?).

Has anyone managed to do something like that (and separately has anyone managed to get gRPC compiled with ICC - not specifying any versions as this seems to be a problem for a long time)?

Thanks in advance


Solution

  • Dlls on windows need special care when it comes to their exposed API. Some libraries prefer not to bother and do not officially support building as a dll.

    I know from previous experience that grpc doesn't support building as a dll. You can read about it here. It should be possible to compile, but there's an extremely high chance it'll trigger horrible dll heap related bugs.. It's definitely not the way to go for production code

    A possible solution, is to statically link grpc into your own dll. Make a wrapper that hides any grpc API, compile it all using MSVC, and then use it as dll dependency in your ICC project.