CMake 3.15.5引导程序因g ++ 9.3.0失败

问题描述

我正在尝试在20.04 xubuntu机器上构建CMake 3.15.5(但我也尝试了18.04和20.10,但结果相同)。

错误如下:

loading initial cache file /home/max/Lavori/nova/src/repos/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/Bootstrap.cmk/InitialCacheFlags.cmake
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking if compiler supports C11 _Thread_local
-- Checking if compiler supports C11 _Thread_local - yes
-- Checking if compiler supports needed C++17 constructs
-- Checking if compiler supports needed C++17 constructs - yes
-- Checking if compiler supports C++ make_unique
-- Checking if compiler supports C++ make_unique - no
-- Checking if compiler supports C++ unique_ptr
-- Checking if compiler supports C++ unique_ptr - no
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 "/home/max/Lavori/nova/src/repos/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeOutput.log".
See also "/home/max/Lavori/nova/src/repos/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeError.log".
---------------------------------------------
Error when bootstrapping CMake:
Problem while running initial CMake

我绝对确定g ++ 9.3.0支持C ++ 11,那么问题出在哪里呢?

(编辑:添加了CMakeError.log)

这是CMakeError.log文件

Determining if compiler supports C++ make_unique Failed with the following output:
Change Dir: /home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_f5a77/fast && make[2]: Entering directory '/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp'
make[2]: Warning: File 'Makefile' has modification time 0,27 s in the future
make -f CMakeFiles/cmTC_f5a77.dir/build.make CMakeFiles/cmTC_f5a77.dir/build
make[3]: Entering directory '/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp'
make[3]: Warning: File 'CMakeFiles/cmTC_f5a77.dir/flags.make' has modification time 0,26 s in the future
Building CXX object CMakeFiles/cmTC_f5a77.dir/cm_cxx_make_unique.cxx.o
/usr/bin/g++    -O2    -std=gnu++17 -o CMakeFiles/cmTC_f5a77.dir/cm_cxx_make_unique.cxx.o -c /home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/Source/Checks/cm_cxx_make_unique.cxx
Linking CXX executable cmTC_f5a77
/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_f5a77.dir/link.txt --verbose=1
/usr/bin/g++  -O2   -L/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/host/lib -Wl,-rpath,/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/host/lib  CMakeFiles/cmTC_f5a77.dir/cm_cxx_make_unique.cxx.o  -o cmTC_f5a77 
make[3]: warning:  Clock skew detected.  Your build may be incomplete.
make[3]: Leaving directory '/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp'
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[2]: Leaving directory '/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp'



Determining if compiler supports C++ unique_ptr Failed with the following output:
Change Dir: /home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_02c6e/fast && make[2]: Entering directory '/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp'
make[2]: Warning: File 'Makefile' has modification time 0,27 s in the future
make -f CMakeFiles/cmTC_02c6e.dir/build.make CMakeFiles/cmTC_02c6e.dir/build
make[3]: Entering directory '/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp'
make[3]: Warning: File 'CMakeFiles/cmTC_02c6e.dir/flags.make' has modification time 0,26 s in the future
Building CXX object CMakeFiles/cmTC_02c6e.dir/cm_cxx_unique_ptr.cxx.o
/usr/bin/g++    -O2    -std=gnu++17 -o CMakeFiles/cmTC_02c6e.dir/cm_cxx_unique_ptr.cxx.o -c /home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/Source/Checks/cm_cxx_unique_ptr.cxx
Linking CXX executable cmTC_02c6e
/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_02c6e.dir/link.txt --verbose=1
/usr/bin/g++  -O2   -L/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/host/lib -Wl,/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/host/lib  CMakeFiles/cmTC_02c6e.dir/cm_cxx_unique_ptr.cxx.o  -o cmTC_02c6e 
make[3]: warning:  Clock skew detected.  Your build may be incomplete.
make[3]: Leaving directory '/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp'
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[2]: Leaving directory '/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/CMakeFiles/CMakeTmp'

我不知道什么是错误的。 我以为这可能是时钟偏斜问题,但我也在虚拟机之外尝试过,但结果相同。

我还尝试了手工编译和链接,而没有任何错误或警告。

/usr/bin/g++    -O2    -std=gnu++17 -o cm_cxx_make_unique.cxx.o -c /home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/build/host-cmake-3.15.5/Source/Checks/cm_cxx_make_unique.cxx

/usr/bin/g++  -O2   -L/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/host/lib -Wl,/home/max/Lavori/nova/srcs/repo/dep-startup/buildroot-output/buildroot-2020.02.1/output/host/lib  cm_cxx_make_unique.cxx.o  -o cmTC_f5a77 

我也尝试运行二进制文件而没有错误。 因此,更多的是'我不知道出什么问题了

解决方法

在使用 Linux 虚拟机 (VMware) 和将源放置在共享文件夹中时出现相同的错误。当将源移动到用户文件夹时,所有配置成功。