MySQL系列—编译安装8.0版本时gcc及cmake版本说明

MySQL系列—编译安装8.0版本时gcc及cmake版本说明

编码文章call10242025-09-12 16:23:1810A+A-

MySQL 8.0.16以上版本是C++14标准,编译安装时需gcc 5.3以上版本。本人在结合cmake编译工具的情况下,经过多版本测试,gcc版本10.2.1是最好的选择,同时cmake的版本为3.19.8。

下面是在测试过程中遇到的错误信息详情。

1.使用gcc9.3.1时,cmake版本不能超过3.19.0

## 若使用3.19.1-3.19.8版本的cmake,就会出现如下的错误信息,无法完成编译。错误信息中已提示找不到gcc 10编译器

Could not find devtoolset compiler in /opt/rh/devtoolset-10

## 若使用3.20.x版本的cmake,则会出现如下的错误信息,无法完成编译。错误信息中也提示找不到gcc 10编译器



2.使用gcc10.2.1时,cmake最好不要使用3.20.x版本,使用3.20.x版本会出现Warning提示(如下所示),但能完成cmake配置,也能完成MySQL的安装,简单测试使用也无问题。MySQL后续使用中是否会出现问题不知道。个人建议在安装过程中尽量避免出现一些不正常的提示信息。

-- Running cmake version 3.20.1
-- Found Git: /bin/git (found version "1.8.3.1") 
CMake Deprecation Warning at cmake/cmake_policies.cmake:54 (CMAKE_POLICY):
  The OLD behavior for policy CMP0075 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:233 (INCLUDE)


-- CMP0073 OLD
CMake Deprecation Warning at cmake/cmake_policies.cmake:62 (CMAKE_POLICY):
  The OLD behavior for policy CMP0073 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:233 (INCLUDE)


-- This is .el7. as found from 'rpm -qf /'
-- Looking for a devtoolset compiler
-- Using /opt/rh/devtoolset-10/root/usr/bin/gcc
-- Using /opt/rh/devtoolset-10/root/usr/bin/g++
点击这里复制本文地址 以上内容由文彬编程网整理呈现,请务必在转载分享时注明本文地址!如对内容有疑问,请联系我们,谢谢!
qrcode

文彬编程网 © All Rights Reserved.  蜀ICP备2024111239号-4