spack: Build error: cmake

cmake errors even with cxxflags set (spack compiled gcc@9.2.0)

spack install cmake cxxflags="-std=c++11"


Steps to reproduce the issue

spack install cmake cxxflags="-std=c++11"

2 errors found in build log:
     454    -- Checking if compiler supports needed C++17 constructs
     455    -- Checking if compiler supports needed C++17 constructs - yes
     456    -- Checking if compiler supports C++ make_unique
     457    -- Checking if compiler supports C++ make_unique - no
     458    -- Checking if compiler supports C++ unique_ptr

  >> 474    CMake Error at CMakeLists.txt:92 (message):
     475      The C++ compiler does not support C++11 (e.g.  std::unique_ptr).

Platform and user environment

$ uname -a 
Linux edi 3.10.0-1062.1.1.el7.x86_64 #1 SMP Fri Sep 13 22:55:44 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

centOS 7.7

Additional information

Possibly related https://github.com/spack/spack/issues/11223

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (19 by maintainers)

Commits related to this issue

Most upvoted comments

The other one is exactly the same, not sure why it is logged two times in the log file.

Details
Determining if compiler supports C++ make_unique failed with the following output:
Change Dir: /tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_c4050/fast && gmake -f CMakeFiles/cmTC_c4050.dir/build.make CMakeFiles/cmTC_c4050.dir/build
gmake[1]: Entering directory `/tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_c4050.dir/cm_cxx_make_unique.cxx.o
/opt/spack/lib/spack/env/gcc/g++    -std=gnu++17 -o CMakeFiles/cmTC_c4050.dir/cm_cxx_make_unique.cxx.o -c /tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/Source/Checks/cm_cxx_make_unique.cxx
cc1plus: warning: '-mtune=x86-64' is deprecated; use '-mtune=k8' or '-mtune=generic' instead as appropriate [-Wdeprecated]
Linking CXX executable cmTC_c4050
/tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_c4050.dir/link.txt --verbose=1
/opt/spack/lib/spack/env/gcc/g++       CMakeFiles/cmTC_c4050.dir/cm_cxx_make_unique.cxx.o  -o cmTC_c4050
gmake[1]: Leaving directory `/tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/CMakeFiles/CMakeTmp'



Determining if compiler supports C++ unique_ptr failed with the following output:
Change Dir: /tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/gmake cmTC_3a134/fast && gmake -f CMakeFiles/cmTC_3a134.dir/build.make CMakeFiles/cmTC_3a134.dir/build
gmake[1]: Entering directory `/tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_3a134.dir/cm_cxx_unique_ptr.cxx.o
/opt/spack/lib/spack/env/gcc/g++    -std=gnu++17 -o CMakeFiles/cmTC_3a134.dir/cm_cxx_unique_ptr.cxx.o -c /tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/Source/Checks/cm_cxx_unique_ptr.cxx
cc1plus: warning: '-mtune=x86-64' is deprecated; use '-mtune=k8' or '-mtune=generic' instead as appropriate [-Wdeprecated]
Linking CXX executable cmTC_3a134
/tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/Bootstrap.cmk/cmake -E cmake_link_script CMakeFiles/cmTC_3a134.dir/link.txt --verbose=1
/opt/spack/lib/spack/env/gcc/g++       CMakeFiles/cmTC_3a134.dir/cm_cxx_unique_ptr.cxx.o  -o cmTC_3a134
gmake[1]: Leaving directory `/tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/CMakeFiles/CMakeTmp'
"/tmp/patrick/cmake-3.15.3-vitqxcfmycqjt7bgumukhzu4nb745eom/spack-src/CMakeFiles/CMakeError.log" 30L, 2521C

Sorry, c/p mistake. Added the error message in the initial post.