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

centos8 源码安装mysql8的时候,提示

-- Running cmake version 3.11.4
-- Could NOT find Git (missing: GIT_EXECUTABLE) 
-- This is .el8. as found from 'rpm -qf /'
-- Looking for a devtoolset compiler
CMake Warning at CMakeLists.txt:280 (MESSAGE):
  Could not find devtoolset compiler in /opt/rh/gcc-toolset-10


CMake Error at CMakeLists.txt:281 (MESSAGE):
  Please set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER explicitly.


-- Configuring incomplete, errors occurred!

图片[1]-Could not find devtoolset compiler in /opt/rh/gcc-toolset-10-百分数

后来查询发现,是少了“devtoolset”等包,yum安装和配置源之后,还是没有,经过一番查询,最后找到了解决方法。

dnf install centos-release-stream
dnf install gcc-toolset-10-gcc-c++
dnf install gcc-toolset-10-gcc-libasan-devel #如果提示已安装或者没有,就跳过,上一条可能已经安装过了。
source /opt/rh/gcc-toolset-10/enable
echo "int main(void) {}" > t.c
gcc -fsanitize=address -lasan t.c

Output:
/bin/ld: cannot find /usr/lib64/libasan.so.6
/bin/ld: cannot find /usr/lib64/libasan.so.6
collect2: error: ld returned 1 exit status

解决方法来源于下面链接

https://bugs.centos.org/view.php?id=17860

图片[2]-Could not find devtoolset compiler in /opt/rh/gcc-toolset-10-百分数

图片[3]-Could not find devtoolset compiler in /opt/rh/gcc-toolset-10-百分数

图片[4]-Could not find devtoolset compiler in /opt/rh/gcc-toolset-10-百分数

© 版权声明
THE END
喜欢就支持一下吧
点赞6
分享
评论 抢沙发