我尝试从源码安装GRPC。我有Oracle Linux7.9,来自devtoolset-10的GCC 10.2.1和cmake version3.21.0-rc1都是从源代码构建的。
我使用的方式:
git clone --recurse-submodules -b v1.37.0 https://github.com/grpc/grpc
cd grpc
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX=$/usr/local/bin \
../..
make
make install之后,我看到来自本地的文件已在/usr/ /root/grpc/cmake/build$/usr/local/bin/lib/....files /....中创建。
好的。但是当我将目录更改为/usr/local -这个目录不包含make install中的文件。
我哪里做错了?
顺便说一句,当我尝试构建1.38版本的GRPS时,我返回了构建错误:
/root/grpc/src/core/lib/gpr/log_linux.cc: In function ‘void gpr_default_log(gpr_log_func_args*)’:
/root/grpc/src/core/lib/gpr/log_linux.cc:97:62: error: no matching function for call to ‘StrFormat(const char [22], const char*, char [64], int32_t&, long int&, const char*&, int&)’
time_buffer, now.tv_nsec, tid, display_file, args->line);发布于 2021-06-30 04:53:00
下面的方法对我很有效:
$ git clone --recurse-submodules -b v1.37.0 https://github.com/grpc/grpc
$ cmake -G Ninja -S grpc/ -B grpc-build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF
$ cmake --build grpc-build --target install这里相关的区别是我的安装前缀中没有杂乱的$,并且我设置了构建类型(您必须始终这样做)。
我使用的是Ubuntu20.04LTS,使用的是CMake 3.20.5 (最新版本)和GCC 10.3.0。请尝试上面的命令,看看有没有什么变化。
https://stackoverflow.com/questions/68182754
复制相似问题