简体   繁体   English

如何为CentOS 6.10编译node.js(库问题)

[英]How to compile node.js for CentOS 6.10 (library issues)

I'm trying to get the newest version of node (12.1.0, at present) running on a CentOS 6.10 box. 我正在尝试获取在CentOS 6.10机器上运行的最新版本的节点(当前为12.1.0)。 This is a problem because the standard CentOS binaries are out of date; 这是一个问题,因为标准的CentOS二进制文件已过期。 eg: 例如:

./node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./node)
(a number of other references like this also appear)

when I try to install and run the binaries, and the g++ / c++ tools are out of date. 当我尝试安装和运行二进制文件时,而g ++ / c ++工具已过时。 But I've decided to try to compile from source, if I can get the tools properly aligned. 但是,如果可以正确对齐工具,我决定尝试从源代码进行编译。

I've gotten an updated version of the compiler tools from the CERN devtools ( http://linux.web.cern.ch/linux/devtoolset ), and seemingly have them installed properly. 我已经从CERN devtools( http://linux.web.cern.ch/linux/devtoolset )获得了编译器工具的更新版本,并且似乎已正确安装了它们。 What I've gotten from various places around the web is that I need to export pointers to these new libraries before doing the configure, like: 我从网络上的各个地方得到的是,在进行配置之前,我需要将指向这些新库的指针导出,例如:

export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc  
export CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp
export CXX=/opt/rh/devtoolset-2/root/usr/bin/c++

These do have the updated and sufficiently modern versions, eg, 这些确实具有更新且足够现代的版本,例如,

/opt/rh/devtoolset-2/root/usr/bin/c++ --version
c++ (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)

But they don't seem to be getting into the configuration process: 但是他们似乎并没有进入配置过程:

[root@linux2 node-v12.1.0]# ./configure --prefix=/opt/node-12.1.0
WARNING: C++ compiler too old, need g++ 6.3.0 or clang++ 8.0.0 (CXX=/opt/rh/devtoolset-2/root/usr/bin/c++)
INFO: Using floating patch "tools/icu/patches/64/source/common/putil.cpp" from "tools/icu"
INFO: Using floating patch "tools/icu/patches/64/source/i18n/dtptngen.cpp" from "tools/icu"
WARNING: warnings were emitted in the configure phase
INFO: configure completed successfully

When I cross my fingers and try to make anyway, I get a whole bunch of compilation results and then a bunch of errors, omitted here (for now) for brevity. 当我用手指交叉尝试尝试时, make得到一堆编译结果,然后是一堆错误,为简洁起见,这里(暂时)将其省略。

Anyway: it's just not working. 无论如何:这只是行不通。 Can anyone see what's going on here, and how I can get things right? 谁能看到这里发生的事情以及如何正确处理事情? Thanks! 谢谢!

You need a newer devtoolset, 6 or 7 instead of 2. This link should help. 您需要较新的devtoolset,而不是2或6或7。 此链接应该会有所帮助。 And use scl like it suggests instead of setting env vars yourself. 并像建议的那样使用scl ,而不是自己设置env var。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM