web-dev-qa-db-ja.com

c ++ 11 std :: unique_ptrエラーcmake3.11.3 bootstrap

Ubuntu 16.04.4 LTSxenialでbootstrap cmake3.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
---------------------------------------------

私がc ++ 11を取得する理由は何でもstd::unique_ptr非準拠エラー?

11
Ela

実際、./bootstrapスクリプトは、コンパイラーでさまざまなC++標準フラグを試します。したがって、その機能を自動的に検出する必要があります。

CXXFLAGS環境変数が設定されていないことを確認して、最初からやり直してください(表示されるメッセージ/警告は、同じディレクトリでの複数の試行/エラーを示しています)。

成功した​​場合の出力

CMakeの./bootstrapを呼び出す私のUbuntuのリファレンスとして、次のようになります。

---------------------------------------------
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>
---------------------------------------------

デバッグ

問題をデバッグするために、次のこともできます。

  • ./bootstrap --verboseに電話してください
  • Bootstrap.cmk/cmake_bootstrap.logを調べてください

既知の問題

bootstrapコンパイラの使用でclangに問題が発生したのは一度だけで、次の呼び出しを行う必要がありました。

export CXXFLAGS=-Xclang -std=c++1z -Xclang -stdlib=libc++

代替

最新バージョンをインストールしたいだけの場合は、 buntuのCMakeのインストール場所を指定する方法は? を参照してください。

1
Florian

私の場合、問題は、CMakeソースコードがあるフォルダーがマウントされたディレクトリにあるためです(実際、rootfs全体がNFS経由でマウントされています)。そこで、「mount」コマンド出力を調べて、「/ run/user」を選択しました。/1000 'の場所は、tmpfsを使用してマウントされ、CMakeソースコードをこの場所に移動したため、ローカルの場所として使用されます。これにより、。/ bootstrap && make && Sudo makeinstallが正常に実行されました。

1
VidyaSagar