c++11 std::unique_ptr error cmake 3.11.3 bootstrap

Actually the ./bootstrap script does try the different C++ standard flags with the compiler. So it should detect its capabilities automatically.

Please make sure you don't have any CXXFLAGS environment variable set and try from scratch again (the messages/warnings you get indicate several tries/errors in the same directory).

Output when Successful

As a reference on my Ubuntu calling CMake's ./bootstrap looks like this:

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

Debugging

For debugging your problem you also could:

  • Call ./bootstrap --verbose
  • Look into Bootstrap.cmk/cmake_bootstrap.log

Known Problem

I only once had a problem with bootstrap using clang compilers where I needed to do the following call:

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

Alternative

If you just want to install the latest version see How to specify where CMake is installed in Ubuntu?


In my case, the issue is because of the folder where I have CMake source code is in a mounted directory (in fact my entire rootfs is mounted over NFS) So, I looked in 'mount' command output and selected '/run/user/1000' location as a local location as this is mounted using tmpfs and moved my CMake source code to this location. with this, ./bootstrap && make && sudo make install executed successfully.