Mysql 从源安装找不到devtoolset gcc

Mysql 从源安装找不到devtoolset gcc,mysql,Mysql,当我试图从我的Centos-6.8上的源文件安装mysql-8.0.11时,cmake抱怨需要GCC 4.8或更新版本 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/usr/local/mysql/data \ -DENABLED_LOCAL_INFILE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DMYSQL_UN

当我试图从我的
Centos-6.8
上的源文件安装
mysql-8.0.11
时,
cmake
抱怨需要GCC 4.8或更新版本

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
      -DMYSQL_DATADIR=/usr/local/mysql/data \
      -DENABLED_LOCAL_INFILE=1 \
      -DWITH_INNOBASE_STORAGE_ENGINE=1 \      
      -DMYSQL_UNIX_ADDR=/tmp/mysql.sock \      
      -DSYSCONFDIR=/etc \      
      -DDEFAULT_CHARSET=utf8 \      
      -DWITH_SSL=system \      
      -DMYSQL_TCP_PORT=3306 \      
      -DWITH_EXTRA_CHARSETS=all \      
      -DDEFAULT_COLLATION=utf8_general_ci \      
      -DDOWNLOAD_BOOST=1 \      
      -DWITH_BOOST=/usr/local/include/boost
-- Running cmake version 2.8.12.2
-- Found Git: /usr/bin/git (found version "1.7.1") 
-- Configuring with MAX_INDEXES = 64U
-- This is Linux version 2.6.32-754.9.1.el6.x86_64
-- gcc is /usr/local/bin/gcc
-- We probably need /opt/rh/devtoolset-7/root/usr/bin/gcc
-- /usr/local/bin/gcc is version 4.9.1

CMake Warning at CMakeLists.txt:173 (MESSAGE):
  Could not find devtoolset gcc


-- CMAKE_GENERATOR: Unix Makefiles
CMake Error at cmake/os/Linux.cmake:40 (MESSAGE):
  GCC 4.8 or newer is required!
Call Stack (most recent call first):
  CMakeLists.txt:239 (INCLUDE)


-- Configuring incomplete, errors occurred!
似乎cmake让我升级编译器,所以我通过下面的
yum
命令完成了升级

cd /etc/yum.repos.d
wget http://linuxsoft.cern.ch/cern/scl/slc6-scl.repoyum -y --nogpgcheck 
install devtoolset-3-gcc devtoolset-3-gcc-c++
scl enable devtoolset-3 bash
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/rh/devtoolset-3/root/usr --mandir=/opt/rh/devtoolset-3/root/usr/share/man --infodir=/opt/rh/devtoolset-3/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/cloog-install --with-mpc=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC) 

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/rh/devtoolset-3/root/usr --mandir=/opt/rh/devtoolset-3/root/usr/share/man --infodir=/opt/rh/devtoolset-3/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/cloog-install --with-mpc=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC) 
然而,它仍然不起作用

检查gcc和g++的版本时,我看到如下所示

cd /etc/yum.repos.d
wget http://linuxsoft.cern.ch/cern/scl/slc6-scl.repoyum -y --nogpgcheck 
install devtoolset-3-gcc devtoolset-3-gcc-c++
scl enable devtoolset-3 bash
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/rh/devtoolset-3/root/usr --mandir=/opt/rh/devtoolset-3/root/usr/share/man --infodir=/opt/rh/devtoolset-3/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/cloog-install --with-mpc=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC) 

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/opt/rh/devtoolset-3/root/usr --mandir=/opt/rh/devtoolset-3/root/usr/share/man --infodir=/opt/rh/devtoolset-3/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,fortran,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/cloog-install --with-mpc=/builddir/build/BUILD/gcc-4.9.1-20140922/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.9.1 20140922 (Red Hat 4.9.1-10) (GCC) 
我错过了什么

如果您有任何建议,我们将不胜感激。

请在您的cmake系列中附加以下内容:
-DCMAKE\u C\u COMPILER=/opt/rh/devtoolset-7/root/usr/bin/gcc-DCMAKE\u CXX\u COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++
/p>
-DCMAKE\u链接器=…/ld
可能也很有用,尽管没有它也可以工作。