centos7.9安装node报GLIB的问题

在centos7.9上安装node提示GLIB的错误
在这里插入图片描述
这里以安装GLIBC_2.28为例

1、升级glibc2.28前置条件

查看升级glibc2.28所需编译器的版本号
我们查看安装包内的文件INSTALL
显示如下:

Recommended Tools for Compilation
=================================

We recommend installing the following GNU tools before attempting to
build the GNU C Library:

   * GNU 'make' 4.0 or newer

     As of relase time, GNU 'make' 4.2.1 is the newest verified to work
     to build the GNU C Library.

   * GCC 4.9 or newer

     GCC 4.9 or higher is required. 

  • 可知,需要make4.0以后的版本,最新验证过的make版本是4.2.1
  • 可知,需要gcc4.9或者更新版本。

在这里插入图片描述
2、查看本机的gcc版本、make版本

[dev1@localhost build]$ gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
目标:x86_64-redhat-linux
配置为:../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
线程模型:posix
gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
[dev1@localhost build]$

[dev1@localhost build]$ make -v
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[dev1@localhost build]$ 

gcc升级到4.9

wget https://mirrors.ustc.edu.cn/gnu/gcc/gcc-4.9.0/gcc-4.9.0.tar.bz2
tar -jxvf gcc-4.9.0.tar.bz2
cd gcc-4.9.0
./contrib/download_prerequisites
 mkdir build && cd build
../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
../configure --prefix=/usr/local/gcc  --enable-bootstrap  --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j4 && sudo make install

如果make -j4是报如下错误:
在make -j4时出现下面错误 error: no usable dependency style found。
需要安装gcc ,g++:yum -y install gcc+ gcc-c++

checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/home/doc/gcc-4.9.4/gcc-build-4.9/gcc':
configure: WARNING: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
checking for unordered_map... no
checking for tr1/unordered_map... no
checking for ext/hash_map... no
checking dependency style of g++... none
configure: error: no usable dependency style found
make[2]: *** [configure-stage1-gcc] Error 1
make[2]: Leaving directory `/home/doc/gcc-4.9.4/gcc-build-4.9'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/doc/gcc-4.9.4/gcc-build-4.9'
make: *** [all] Error 2

make升级

# 升级 make(默认为3 升级为4)
wget http://ftp.gnu.org/gnu/make/make-4.3.tar.gz
tar -xzvf make-4.3.tar.gz && cd make-4.3/
./configure  --prefix=/usr/local/make
make && make install
cd /usr/bin/ && mv make make.bak
ln -sv /usr/local/make/bin/make /usr/bin/make

参考:
https://blog.csdn.net/u012559967/article/details/136344204
https://www.cnblogs.com/astonc/p/16660685.html

  • 6
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值