# grpc **Repository Path**: maqun001/grpc ## Basic Information - **Project Name**: grpc - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-03-09 - **Last Updated**: 2021-11-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # grpc源码的编译与安装 为了使用grpc相关的功能,需要在主机上对grpc进行编译安装。 为了方便地进行grpc的安装与使用,特意建立一个脚本进行一键安装与测试,使用者可以快捷方便地将其安装在Linux系统中。 脚本为 "grpc/grpc_config.sh",用户克隆本仓库后,进入项目根目录,直接运行 ```"./grpc_config.sh"```即可进行编译安装。 ## 注意事项 * 主机需要联网,需要安装必要的库和软件 * 需要提供sudo权限 * 如果编译过程报错可根据以下介绍重新执行出错部分 ## grpc_config.sh 此脚本文件包括以下几个部分: ### 安装必要依赖 ``` sudo apt-get update sudo apt install -y build-essential autoconf libtool pkg-config sudo apt-get install automake make g++ unzip sudo apt-get install libflags-dev libgtest-dev sudo apt-get install clang libc++-dev sudo apt-get install openssl libssl-dev sudo apt-get install cmake ``` ### 安装absl依赖 ``` mkdir -p "third_party/abseil-cpp/cmake/build" pushd "third_party/abseil-cpp/cmake/build" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../.. sudo make install popd ``` ### 安装protobuf 依赖 ``` # Install protobuf mkdir -p "third_party/protobuf/cmake/build" pushd "third_party/protobuf/cmake/build" cmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release .. sudo make install popd ``` ### 安装c-ares依赖 ``` #install c-ares mkdir -p "third_party/cares/cares/cmake/build" pushd "third_party/cares/cares/cmake/build" cmake -DCMAKE_BUILD_TYPE=Release ../.. sudo make install popd ``` ### 安装re2依赖 ``` # Install re2 mkdir -p "third_party/re2/cmake/build" pushd "third_party/re2/cmake/build" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../.. sudo make -j4 install popd ``` ### 安装grpc ``` #install grpc mkdir -p "cmake/build" pushd "cmake/build" cmake \ -DCMAKE_BUILD_TYPE=Release \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ -DgRPC_CARES_PROVIDER=package \ -DgRPC_ABSL_PROVIDER=package \ -DgRPC_PROTOBUF_PROVIDER=package \ -DgRPC_RE2_PROVIDER=package \ -DgRPC_SSL_PROVIDER=package \ -DgRPC_ZLIB_PROVIDER=package \ ../.. make sudo make install popd ``` ### 测试用例 ``` # build helloworld example using cmake mkdir -p "examples/cpp/helloworld/cmake/build" pushd "examples/cpp/helloworld/cmake/build" cmake ../.. make popd cd .. ``` 至此,即可完成grpc的编译和安装,安装过程较为耗时,请耐心等待。 下面是grpc的官方介绍。 ------------------------------------------------------------------------------------------------------------------------------------------------------ gRPC - An RPC library and framework =================================== gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems.
Homepage: grpc.io
Mailing List: grpc-io@googlegroups.com
[![Join the chat at https://gitter.im/grpc/grpc](https://badges.gitter.im/grpc/grpc.svg)](https://gitter.im/grpc/grpc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) # To start using gRPC To maximize usability, gRPC supports the standard method for adding dependencies to a user's chosen language (if there is one). In most languages, the gRPC runtime comes as a package available in a user's language package manager. For instructions on how to use the language-specific gRPC runtime for a project, please refer to these documents * [C++](src/cpp): follow the instructions under the `src/cpp` directory * [C#](src/csharp): NuGet package `Grpc` * [Dart](https://github.com/grpc/grpc-dart): pub package `grpc` * [Go](https://github.com/grpc/grpc-go): `go get google.golang.org/grpc` * [Java](https://github.com/grpc/grpc-java): Use JARs from Maven Central Repository * [Kotlin](https://github.com/grpc/grpc-kotlin): Use JARs from Maven Central Repository * [Node](https://github.com/grpc/grpc-node): `npm install grpc` * [Objective-C](src/objective-c): Add `gRPC-ProtoRPC` dependency to podspec * [PHP](src/php): `pecl install grpc` * [Python](src/python/grpcio): `pip install grpcio` * [Ruby](src/ruby): `gem install grpc` * [WebJS](https://github.com/grpc/grpc-web): follow the grpc-web instructions Per-language quickstart guides and tutorials can be found in the [documentation section on the grpc.io website](https://grpc.io/docs/). Code examples are available in the [examples](examples) directory. Precompiled bleeding-edge package builds of gRPC `master` branch's `HEAD` are uploaded daily to [packages.grpc.io](https://packages.grpc.io). # To start developing gRPC Contributions are welcome! Please read [How to contribute](CONTRIBUTING.md) which will guide you through the entire workflow of how to build the source code, how to run the tests, and how to contribute changes to the gRPC codebase. The "How to contribute" document also contains info on how the contribution process works and contains best practices for creating contributions. # Troubleshooting Sometimes things go wrong. Please check out the [Troubleshooting guide](TROUBLESHOOTING.md) if you are experiencing issues with gRPC. # Performance See the [Performance dashboard](https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5652536396611584) for performance numbers of master branch daily builds. # Concepts See [gRPC Concepts](CONCEPTS.md) # About This Repository This repository contains source code for gRPC libraries implemented in multiple languages written on top of a shared C core library [src/core](src/core). Libraries in different languages may be in various states of development. We are seeking contributions for all of these libraries: | Language | Source | |-------------------------|-------------------------------------| | Shared C [core library] | [src/core](src/core) | | C++ | [src/cpp](src/cpp) | | Ruby | [src/ruby](src/ruby) | | Python | [src/python](src/python) | | PHP | [src/php](src/php) | | C# (core library based) | [src/csharp](src/csharp) | | Objective-C | [src/objective-c](src/objective-c) | | Language | Source repo | |-------------------------|------------------------------------------------------| | Java | [grpc-java](https://github.com/grpc/grpc-java) | | Kotlin | [grpc-kotlin](https://github.com/grpc/grpc-kotlin) | | Go | [grpc-go](https://github.com/grpc/grpc-go) | | NodeJS | [grpc-node](https://github.com/grpc/grpc-node) | | WebJS | [grpc-web](https://github.com/grpc/grpc-web) | | Dart | [grpc-dart](https://github.com/grpc/grpc-dart) | | .NET (pure C# impl.) | [grpc-dotnet](https://github.com/grpc/grpc-dotnet) |