[CMake] Failure to build CMake 3.11.0 on ARMv7 Ubuntu 16.04 due to std::size undefined

Andrew Brownsword andrew.e.brownsword at gmail.com
Sat Apr 7 11:32:53 EDT 2018


I have managed to get CMake 3.11.0 to build by hacking the CLang-CXX file to specify -std=c++1y instead of 1z.  With 1z the __cplusplus define is set to a 2017 date such that the CMake code presumes the existence of std::size, which isn’t actually defined in the headers I have (presumably because the system gcc is 5.4.0, circa C++14).

Is there a proper way to specify the -std= to use when running the cmake bootstrap or make?


> I am attempting to build the latest release of CMake on my ARM-based Ubuntu system.  The bootstrap works fine, however the make fails with a bunch of error messages which all look like variations on this one:
> 
> 
> In file included from /home/andrew/cmake/cmake-3.11.0/Source/cmCryptoHash.cxx:5:
> /home/andrew/cmake/cmake-3.11.0/Source/cmAlgorithms.h:407:7: error: no member named 'size' in
>      namespace 'std'; did you mean 'std::seed_seq::size'?
> using std::size;
>      ^~~~~~~~~
>      std::seed_seq::size
> 
> 
> 
> Looking at the source the compiler is checking the __cplusplus macro to see if it is 2017-something, and it apparently passes this test when I make CMake.  If I just write a trivial program that prints this define, it outputs 201500L.  The compiler in use is the system gcc compiler, version 5.4.0.  I’ve tried it with the CLang 7.0 compiler I just built and get the same errors.
> 
> Any suggestions?
> 


More information about the CMake mailing list