C++11 c++;11标准::唯一错误cmake 3.11.3引导

C++11 c++;11标准::唯一错误cmake 3.11.3引导,c++11,cmake,bootstrapping,C++11,Cmake,Bootstrapping,我试图在Ubuntu 16.04.4上引导cmake 3.11.3 我升级了gnu g++编译器,如下所示: > $ g++ --version g++ (Ubuntu 8.1.0-5ubuntu1~16.04) 8.1.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty

我试图在Ubuntu 16.04.4上引导cmake 3.11.3

我升级了gnu g++编译器,如下所示:

> $ g++ --version
g++ (Ubuntu 8.1.0-5ubuntu1~16.04) 8.1.0 Copyright (C) 2018 Free
Software Foundation, Inc. This is free software; see the source for 
copying conditions.  There is NO warranty; not even for MERCHANTABILITY 
or FITNESS FOR A PARTICULAR PURPOSE.
并手动重新指向符号链接:

$ ll /usr/bin/*g++*
lrwxrwxrwx 1 root root       5 Jun  8 16:57 /usr/bin/g++ -> g++-8*
-rwxr-xr-x 1 root root  919832 Apr 24 15:02 /usr/bin/g++-5*
lrwxrwxrwx 1 root root      22 Jun  6 04:26 /usr/bin/g++-8 -> x86_64-linux-gnu-g++-8*
lrwxrwxrwx 1 root root      22 Jun  8 16:58 /usr/bin/x86_64-linux-gnu-g++ -> x86_64-linux-gnu-g++-8*
lrwxrwxrwx 1 root root       5 Apr 24 15:02 /usr/bin/x86_64-linux-gnu-g++-5 -> g++-5*
-rwxr-xr-x 1 root root 1071984 Jun  6 04:26 /usr/bin/x86_64-linux-gnu-g++-8*
但是,我在cmake的配置中遇到以下错误:

$ sudo ./bootstrap 
---------------------------------------------
CMake 3.11.3, Copyright 2000-2018 Kitware, Inc. and Contributors
Found GNU toolchain
C compiler on this system is: gcc       
C++ compiler on this system is: g++          
Makefile processor on this system is: make
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>
---------------------------------------------
make: Warning: File 'Makefile' has modification time 2.3 s in the future
make: 'cmake' is up to date.
make: warning:  Clock skew detected.  Your build may be incomplete.
loading initial cache file /mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/Bootstrap.cmk/InitialCacheFlags.cmake
CMake Error at CMakeLists.txt:92 (message):
  The C++ compiler does not support C++11 (e.g.  std::unique_ptr).


-- Configuring incomplete, errors occurred!
See also "/mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/CMakeFiles/CMakeOutput.log".
See also "/mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake
---------------------------------------------
$sudo./bootstrap
---------------------------------------------
CMake 3.11.3,版权所有2000-2018 Kitware,Inc.和贡献者
找到GNU工具链
这个系统上的C编译器是:gcc
这个系统的C++编译器是:G++
此系统上的Makefile处理器为:make
g++有setenv
g++已经取消了env
g++在stdlib.h中没有environ
g++具有stl wstring
g++具有
---------------------------------------------
make:警告:文件“Makefile”的修改时间为2.3秒
make:“cmake”是最新的。
make:警告:检测到时钟偏移。您的构建可能不完整。
正在加载初始缓存文件/mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/Bootstrap.cmk/InitialCacheFlags.cmake
CMakeLists.txt:92处的CMake错误(消息):
C++编译器不支持C++ 11(例如:STD::UnQuyJ-PTR)。
--配置不完整,出现错误!
另见“/mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/CMakeFiles/CMakeOutput.log”。
另见“/mnt/ganymede/user/gpeytavi/srv_admin/software/cmake-3.11.3/CMakeFiles/CMakeError.log”。
---------------------------------------------
引导CMake时出错:
运行初始CMake时出现问题
---------------------------------------------

我知道为什么得到C++ 11代码> STD::UNQuYGYPTR <代码>不兼容错误?

< P>实际上,/Bootstrap < /Cord>脚本尝试用编译器不同的C++标准标志。因此,它应该自动检测其功能

请确保未设置任何
cxflags
环境变量,然后重新尝试(收到的消息/警告指示在同一目录中多次尝试/错误)

成功时输出

在我的Ubuntu上,调用CMake的
/bootstrap
如下所示:

---------------------------------------------
CMake 3.11.20180423, Copyright 2000-2018 Kitware, Inc. and Contributors
Warning: This is an in-source build
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++  -std=gnu++1y
Makefile processor on this system is: make
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has <ext/stdio_filebuf.h>
---------------------------------------------
备选方案


如果您只想安装最新版本,请参见

在我的例子中,问题是因为我拥有CMake源代码的文件夹位于挂载目录中(事实上,我的整个rootfs都是通过NFS挂载的) 因此,我查看了“mount”命令输出,并选择“/run/user/1000”位置作为本地位置,因为它是使用tmpfs装载的,并将我的CMake源代码移到了这个位置。
有了它,./bootstrap&&make&&sudomake安装成功执行。

我通过在生成计算机和NFS文件服务器上运行ntpd来确保两者同步,从而解决了这个问题。

提到unique\u ptr可能只是一个转移视线的问题。make文件需要指定
-std=c++11
以启用c++11语法。如果您的编译器或make太旧而无法识别,那么
-std=gnu++11
可能会工作。非常感谢--verbose选项给了我提示。我把Cmake文件放在一个挂载的驱动器中,并试图从那里引导。显然(出于我不理解的原因)这是不可能的。如果其他人碰到这个问题,原因是时钟偏移。如果网络驱动器上的时间戳与本地文件不一致,cmake将变得非常混乱,测试将开始失败。在本地目录中构建,错误消失。是的,对我来说也是时钟偏移。我使用的是一台群集计算机,它没有直接的www连接,而是必须从中央服务器提取所有数据;由于某种原因,时钟错了。这是一个相当令人恼火的错误。这起作用了!我不知道我试图在一个挂载目录中构建cmake,但是在~/中做了同样的事情之后,它就成功了!谢谢你。这对我也有用!你能提供更多关于问题所在的细节吗?我正在尝试构建一些在NFS挂载上只有足够空间的东西,所以将其移动到其他地方并不是一个真正的选择。
export CXXFLAGS=-Xclang -std=c++1z -Xclang -stdlib=libc++