c++ - 错误 : unrecognized command line option ‘-Wno-invalid-source-encoding’ [-Werror] within building Mesos

标签 c++ ubuntu mesos

我的操作系统是 Ubuntu 18.10。我在三个节点上执行以下步骤: 为了安装 Mesos,我一步一步地完成了这些步骤,没有任何错误,除了每个节点已经有 Open JDK 8,所以我没有再次安装 Open JDK 8。

   sudo apt-get update
   sudo apt-get install -y tar wget git
   sudo apt-get install -y openjdk8-jdk (I did not do that)
   sudo apt-get install -y autoconf libtool
   sudo apt-get -y install build-essential python-dev python-six python- 
   virtualenv libcurl4-nss-dev libsasl2-dev libsasl2-modules maven 
   libapr1-dev libsvn-dev zlib1g-dev iputils-ping
   

当我想要构建 Mesos 时,问题就开始了。我为此做了这些步骤:

cd mesos-1.7.0
./bootstrap
mkdir build
cd build
../configure
make

我的 IP 地址是 150.20.11.137,150.20.11.134,150.20.11.157。我在所有这些上下载了 Mesos 包,并在相同的路径中解压。 我在每个节点上都做了 <../configure> 没有任何问题,但是当我运行“make”时,我在每个节点上都遇到了这个错误:

third_party/cares/cares/ares_init.c: In function ‘ares_dup’: third_party/cares/cares/ares_init.c:301:17: error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer- memaccess]

       sizeof(src->local_dev_name));
             ^

third_party/cares/cares/ares_init.c: At top level:

cc1: error: unrecognized command line option ‘-Wno-invalid-source- encoding’ [-Werror] cc1: all warnings being treated as errors

make[4]: *** [Makefile:2635: /home/spark/mesos- 1.7.0/build/3rdparty/grpc- 1.10.0/objs/opt/third_party/cares/cares/ares_init.o] Error 1

make[4]: Leaving directory '/home/spark/mesos- 1.7.0/build/3rdparty/grpc-1.10.0'

make[3]: *** [Makefile:1446: grpc-1.10.0-build-stamp] Error 2

make[3]: Leaving directory '/home/spark/mesos-1.7.0/build/3rdparty'

make 2]: *** [Makefile:1035: all-recursive] Error 1

make[2]: Leaving directory '/home/spark/mesos-1.7.0/build/3rdparty'

make[1]: *** [Makefile:765: all] Error 2

make[1]: Leaving directory '/home/spark/mesos-1.7.0/build/3rdparty'

make: *** [Makefile:768: all-recursive] Error 1

最佳答案

问题解决了。问题是因为 GCC 版本。 Ubuntu 18.10 中的 GCC 版本为 8.2.0。我使用以下指令安装了 gcc-5 和 g++-5:

 sudo add-apt-repository ppa:ubuntu-toolchain-r/test
 sudo apt-get update
 sudo apt-get install gcc-5 g++-5

然后要选择我想要的 GCC 版本,我必须为 gcc 安装“update-alternatives”。因此,我运行这些命令:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 500 --slave 
/usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave 
/usr/bin/g++ g++ /usr/bin/g++-8

之后我用这个命令选择了 gcc-5 :

sudo update-alternatives --config gcc

此外,我有一个与OpenSSL相关的错误;然后我通过这个命令安装了它:

sudo apt-get install libssl-dev

在这些修改之后,我开始安装 Mesos 并且安装没有任何错误。我希望这个插图对其他人有帮助。

关于c++ - 错误 : unrecognized command line option ‘-Wno-invalid-source-encoding’ [-Werror] within building Mesos,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54105764/

相关文章:

c++ - 如何正确地将std::string转换为整数 vector

python - 运行基本 tensorflow 示例时出错

logging - 0.8.2中的日志级别未正确配置?

docker - Mesos上的Docker:卷放在哪个节点上?

c++ - 如何将 Action 连接到 C++/Qt 中的值更改

C++ 运行时数据类型识别和避免 switch-case

linux - 如何比较bash中的IP值?

python - 结束程序后发生的奇怪的键盘中断错误

mesos - 如何使用Apache Mesos/Marathon运行一次性任务?

c++ - 了解找不到 key 时 QHash 的作用