grpc / grpc

The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)

Home Page:https://grpc.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C++ gRPC build takes very long time

vymao opened this issue · comments

What version of gRPC and what language are you using?

Latest one following the command

git clone --recurse-submodules -b v1.46.3 --depth 1 --shallow-submodules https://github.com/grpc/grpc

on the guide.

What operating system (Linux, Windows,...) and version?

macOS Monterey v12.0.1

What runtime / compiler are you using (e.g. python version or version of gcc)

$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: x86_64-apple-darwin21.1.0
Thread model: posix

What did you do?

Attempted to build gRPC following the guide. I am stuck at the step that involves actually building gRPC and the protocol buffer compiler. So far, the make -j command takes a very long time to run and I have not been able to successfully complete a build. I am guessing it is because there are many dependencies for gRPC.

What did you expect to see?

A completed build.

What did you see instead?

Make seems to take a very long time and is stuck on building various gRPC files.

Anything else we should know about your project / environment?

  1. How long should a C++ build take?
  2. Is there a better way to build this? Are there pre-compiled binaries we can use?
  3. Is it reasonable to try and use gRPC on development laptops? The resource requirements seem very high.
  4. Is there an estimate as to the disk space this will need?

We are aware that build times take a long time and it's something that we want to improve. On some systems with less resources, I've noticed it taking more than 30 minutes.
My own preference is to use bazel on those systems. It seems to be more reliable.

Is there a better way to build this? Are there pre-compiled binaries we can use?

No, the grpc team doesn't publish binaries for C++

Is it reasonable to try and use gRPC on development laptops? The resource requirements seem very high.

I've actually written and debugged code for gRPC on laptops. If it's simply using gRPC, then the build is a one time thing, and would not be nearly as bad.

Is there an estimate as to the disk space this will need?

You mean for compiled binaries? A sample binary with default options would take somewhere around 30MB. You could make it smaller by removing xds for example (--define=grpc_no_xds=true).

@yashykt is it possible somehow to copy the compiled files and make a shell-script to distribute them according to their place?
That would be platform basis but will be very fast...