centos7编译Ceph14中g++版本和pthread问题

错误现象:

CMake Error at CMakeLists.txt:39 (message):
  GCC 7+ required due to C++17 requirements


-- Configuring incomplete, errors occurred!
See also "/opt/ceph/ceph_curse/build/CMakeFiles/CMakeOutput.log".
See also "/opt/ceph/ceph_curse/build/CMakeFiles/CMakeError.log".
+ exit 1

及"/opt/ceph/ceph_curse/build/CMakeFiles/CMakeError.log".

Run Build Command(s):/usr/bin/gmake cmTC_49c58/fast
/usr/bin/gmake -f CMakeFiles/cmTC_49c58.dir/build.make CMakeFiles/cmTC_49c58.dir/build
gmake[1]: Entering directory `/opt/ceph/ceph_curse/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_49c58.dir/CheckFunctionExists.c.o
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_49c58.dir/CheckFunctionExists.c.o   -c /usr/share/cmake3/Modules/CheckFunctionExists.c
Linking C executable cmTC_49c58
/usr/bin/cmake3 -E cmake_link_script CMakeFiles/cmTC_49c58.dir/link.txt --verbose=1
/usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_49c58.dir/CheckFunctionExists.c.o  -o cmTC_49c58 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTC_49c58] Error 1
gmake[1]: Leaving directory `/opt/ceph/ceph_curse/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTC_49c58/fast] Error 2

解决办法:

首次执行

yum install centos-release-scl
yum install devtoolset-7
scl enable devtoolset-7 bash

每次登录使用g++编译需要执行

scl enable devtoolset-7 bash

 

你可能感兴趣的:(Ceph存储系统)