Linux(debian10)下安装protobuf3.6.1以及遇到的问题

本文介绍了如何在遇到权限问题下正确配置并安装protobuf-3.6.1,包括chmod解决configure权限问题,以及针对测试失败的zip_output_unittest.sh和gzip_stream_unittest.sh进行权限调整。
摘要由CSDN通过智能技术生成

先下载protobuf-3.6.1,再执行以下操作即可

tar zvxf protobuf-all-3.6.1.tar.gz
cd protobuf-3.6.1
 
./configure --prefix=/usr/local/
 
sudo make
sudo make check
sudo make install

问题

执行./configure --prefix=/usr/local/这条时可能会有权限问题 -bash: ./configure: Permission denied,解决如下:

chmod 777 configure

再重新执行./configure --prefix=/usr/local/
sudo make
sudo make check
执行sudo make check完后又报错

make[3]: Entering directory '/userdata/test/protobuf-3.6.1/src'
PASS: protobuf-test
PASS: protobuf-lazy-descriptor-test
PASS: protobuf-lite-test
FAIL: google/protobuf/compiler/zip_output_unittest.sh
FAIL: google/protobuf/io/gzip_stream_unittest.sh
PASS: protobuf-lite-arena-test
PASS: no-warning-test
============================================================================
Testsuite summary for Protocol Buffers 3.6.1
============================================================================
# TOTAL: 7
# PASS:  5
# SKIP:  0
# XFAIL: 0
# FAIL:  2
# XPASS: 0
# ERROR: 0
============================================================================
See src/test-suite.log
Please report to protobuf@googlegroups.com
============================================================================
make[3]: *** [Makefile:7613: test-suite.log] Error 1
make[3]: Leaving directory '/userdata/test/protobuf-3.6.1/src'
make[2]: *** [Makefile:7721: check-TESTS] Error 2
make[2]: Leaving directory '/userdata/test/protobuf-3.6.1/src'
make[1]: *** [Makefile:7834: check-am] Error 2
make[1]: Leaving directory '/userdata/test/protobuf-3.6.1/src'
make: *** [Makefile:1538: check-recursive] Error 1

有两个失败了,查看日志src/test-suite.log

.. contents:: :depth: 2

FAIL: google/protobuf/compiler/zip_output_unittest.sh
=====================================================

../test-driver: line 107: ./google/protobuf/compiler/zip_output_unittest.sh: Permission denied
FAIL google/protobuf/compiler/zip_output_unittest.sh (exit status: 126)

FAIL: google/protobuf/io/gzip_stream_unittest.sh
================================================

../test-driver: line 107: ./google/protobuf/io/gzip_stream_unittest.sh: Permission denied
FAIL google/protobuf/io/gzip_stream_unittest.sh (exit status: 126)

发现又是权限问题,解决方法如下,终端命令行输入:

chmod 777 src/google/protobuf/compiler/zip_output_unittest.sh
chmod 777 src/google/protobuf/io/gzip_stream_unittest.sh

再重新执行

sudo make check

成功

PASS: protobuf-test
PASS: protobuf-lazy-descriptor-test
PASS: protobuf-lite-test
PASS: google/protobuf/compiler/zip_output_unittest.sh
PASS: google/protobuf/io/gzip_stream_unittest.sh
PASS: protobuf-lite-arena-test
PASS: no-warning-test
============================================================================
Testsuite summary for Protocol Buffers 3.6.1
============================================================================
# TOTAL: 7
# PASS:  7
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

最后安装

sudo make install
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值