TT Bigdata TT Bigdata
首页
  • 部署专题

    • 常规安装
    • 一键部署
  • 组件安装

    • 常规&高可用
  • 版本专题

    • 更新说明
  • Ambari-Env

    • 环境准备
    • 开始使用
  • 组件编译

    • 专区—Ambari
    • 专区—Bigtop
  • 报错解决

    • 专区—Ambari
    • 专区—Bigtop
  • 其他技巧

    • Maven镜像加速
    • Gradle镜像加速
    • Bower镜像加速
    • 虚拟环境思路
    • R环境安装+一键安装脚本
    • Ivy配置私有镜像仓库
    • Node.js 多版本共存方案
    • Ambari Web本地启动
    • Npm镜像加速
    • PostgreSQL快速安装
    • Temurin JDK 23快速安装
  • 成神之路

    • 专区—Ambari
    • 专区—Bigtop
  • 集成案例

    • Redis集成教学
    • Dolphin集成教学
    • Doris集成教学
    • 持续整理...
  • 模板代码

    • 各类组件
    • 通用模板
  • 国产化&其他系统

    • Centos系列
    • Kylin系列
    • OpenEuler系列
    • Rocky系列
    • Ubuntu系列
  • 生产调优

    • 组件调优指南
    • 1v1指导调优
  • 定制开发

    • 组件版本定制
    • 样式风格定制
  • 蓝图愿景
  • 技术支持
  • 合作共建
GitHub (opens new window)

JaneTTR

数据酿造智慧,每一滴都是沉淀!
首页
  • 部署专题

    • 常规安装
    • 一键部署
  • 组件安装

    • 常规&高可用
  • 版本专题

    • 更新说明
  • Ambari-Env

    • 环境准备
    • 开始使用
  • 组件编译

    • 专区—Ambari
    • 专区—Bigtop
  • 报错解决

    • 专区—Ambari
    • 专区—Bigtop
  • 其他技巧

    • Maven镜像加速
    • Gradle镜像加速
    • Bower镜像加速
    • 虚拟环境思路
    • R环境安装+一键安装脚本
    • Ivy配置私有镜像仓库
    • Node.js 多版本共存方案
    • Ambari Web本地启动
    • Npm镜像加速
    • PostgreSQL快速安装
    • Temurin JDK 23快速安装
  • 成神之路

    • 专区—Ambari
    • 专区—Bigtop
  • 集成案例

    • Redis集成教学
    • Dolphin集成教学
    • Doris集成教学
    • 持续整理...
  • 模板代码

    • 各类组件
    • 通用模板
  • 国产化&其他系统

    • Centos系列
    • Kylin系列
    • OpenEuler系列
    • Rocky系列
    • Ubuntu系列
  • 生产调优

    • 组件调优指南
    • 1v1指导调优
  • 定制开发

    • 组件版本定制
    • 样式风格定制
  • 蓝图愿景
  • 技术支持
  • 合作共建
GitHub (opens new window)
  • Ambari

    • phantomjs下载失败问题
    • 编译问题:GCC 安装与配置
      • 一、在 Ambari 项目中编译 ambari-web 时的 GCC 版本问题
        • 1.1 编译时报错日志
        • 1.2 解决方案
        • 1.2.1 使用多版本 GCC 共存
        • 1.2.2 配置示例
    • bower CERT_HAS_EXPIRED 错误问题
    • Ambari-admin包出现bower install错误
    • Cannot run program "rpmbuild"
    • Python: No such file or directory
    • Yarn解压报错EOFException排查与解决
    • Rpm-maven-plugin与shebang兼容性报错
    • Rpm-maven-plugin 最佳实践
    • Bower install拉取失败解决
    • 缺少 python3 报错解决
  • Ambari-infra

  • Ambari-metrics

  • 报错解决-Ambari
  • Ambari
JaneTTR
2023-04-05
目录

编译问题:GCC 安装与配置

# 一、在 Ambari 项目中编译 ambari-web 时的 GCC 版本问题

# 1.1 编译时报错日志

在编译 ambari-web 时,如果遇到如下报错,通常是因为系统中 GCC 版本较低,无法满足 Node.js 的依赖需求:

[DEBUG] Loading mojo com.github.eirslett:frontend-maven-plugin:1.4:yarn from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.4, parent: sun.misc.Launcher$AppClassLoader@7852e922]
[DEBUG] Configuring mojo execution 'com.github.eirslett:frontend-maven-plugin:1.4:yarn:yarn install' with basic configurator -->
[DEBUG]   (f) arguments = install --ignore-engines --pure-lockfile --verbose
[DEBUG]   (f) environmentVariables = {npm_config_tmp=/tmp/npm_config_tmp}
[DEBUG]   (f) npmRegistryURL = https://registry.npmmirror.com
[DEBUG]   (f) project = MavenProject: org.apache.ambari:ambari-web:2.8.0.0.0 @ /opt/modules/ambari/ambari-web/pom.xml
[DEBUG]   (f) repositorySystemSession = org.eclipse.aether.DefaultRepositorySystemSession@3c35c345
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@41aaedaa
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipTests = false
[DEBUG]   (f) testFailureIgnore = false
[DEBUG]   (f) workingDirectory = /opt/modules/ambari/ambari-web
[DEBUG]   (f) yarnInheritsProxyConfigFromMaven = false
[DEBUG]   (f) execution = com.github.eirslett:frontend-maven-plugin:1.4:yarn {execution: yarn install}
[DEBUG] -- end configuration --
[INFO] yarn not inheriting proxy config from Maven
[INFO] Running 'yarn install --ignore-engines --pure-lockfile --verbose --registry=https://registry.npmmirror.com/' in /opt/modules/ambari/ambari-web
[DEBUG] Executing command line [/opt/modules/ambari/ambari-web/node/yarn/dist/bin/yarn, install, --ignore-engines, --pure-lockfile, --verbose, --registry=https://registry.npmmirror.com]
[ERROR] node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
[ERROR] node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)
[ERROR] node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
[ERROR] node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
[ERROR] node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
[ERROR] node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.140 s
[INFO] Finished at: 2024-08-20T09:15:00+08:00
[INFO] ------------------------------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

这类问题通常与系统中的 GCC 版本过低有关,导致 Node.js 的依赖无法满足。

# 1.2 解决方案

# 1.2.1 使用多版本 GCC 共存

为了解决编译时因 GCC 版本过低导致的报错,我们可以启用 SCL(Software Collection)源来安装更高版本的 GCC。你可以通过以下步骤来实现:

  1. 启用 devtoolset-7(包含较新的 GCC 版本):

    scl enable devtoolset-7 bash
    
    1
  2. 安装 devtoolset-7-gcc 和 devtoolset-7-gcc-c++:

    yum install devtoolset-7-gcc devtoolset-7-gcc-c++
    
    1

通过这种方式,你可以在当前系统中使用较新的 GCC 版本,而不需要替换掉系统自带的低版本 GCC。

GCC 安装与配置示意图

提示

启用 SCL 后,系统会使用 devtoolset-7 提供的 GCC,而不会影响系统中其他工具的正常使用。这使得多版本共存成为可能,解决了版本兼容问题。

# 1.2.2 配置示例

  1. 配置 YUM 仓库并启用对应版本的 GCC,确保安装最新版的编译工具链。

  2. 在项目中配置好相应的编译环境后,执行以下命令:

    scl enable devtoolset-7 bash
    
    1

注意

确保你在执行命令时已经正确配置了 SCL 环境,否则可能无法正确启用高版本 GCC。

通过这些步骤,你可以解决由于 GCC 版本过低引起的编译问题,并成功编译项目。

本文提供的解决方案适用于需要使用新版 GCC 的系统,实际操作中可能会根据系统环境有所不同。如果遇到问题,欢迎留言讨论。贡献

#GCC#编译问题#多版本管理
phantomjs下载失败问题
bower CERT_HAS_EXPIRED 错误问题

← phantomjs下载失败问题 bower CERT_HAS_EXPIRED 错误问题→

最近更新
01
Pandoc 缺失导致 SparkR 构建失败
06-08
02
Cyrus SASL/GSASL 缺失解决
06-07
03
Hadoop_3.3.4 编译实战 1.0.0+
06-06
更多文章>
Theme by Vdoing | Copyright © 2017-2025 JaneTTR | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式