help icon indicating copy to clipboard operation
help copied to clipboard

Issue to install Node.js V11 on AIX 7.1

Open LeoMXIBM opened this issue 8 years ago • 13 comments

Issues to run Node.JS on AIX 7.1

  • Node.js Version: node-v11.0.0-aix-ppc64
  • OS: AIX 7100-05-02-1810
  • Scope (install, code, runtime, meta, other?): Install Node.JS
  • Module (and version) (if relevant): N/A

Hello,

I'm new in this Node.js world and I try to install Node.JS on one of AIX server. our server is an AIX 7.1 and I try to install node J.S V11.

I Download the package from https://nodejs.org/en/download/current/ (node-v11.0.0-aix-ppc64.tar.gz) after dad I uncompressed the content on /opt/node/node-v11.0.0-aix-ppc64,

Follow the instructions here: https://www.ibm.com/developerworks/community/blogs/55382396-b19a-4819-8618-6522a02f2d99/entry/run_nodered_on_aix?lang=en_us

but when I try to check the version: node --version

I have this error:

./node --version exec(): 0509-036 Cannot load program ./node because of the following errors: 0509-150 Dependent module libstdc++.a(libstdc++.so.6) could not be loaded. 0509-103 The module has an invalid magic number.

Can you help me? please. Thank you

LeoMXIBM avatar Nov 07 '18 15:11 LeoMXIBM

/cc @nodejs/platform-aix

addaleax avatar Nov 07 '18 15:11 addaleax

what is the GLIBC version in your system? rpm -qa | grep -i glibc

gireeshpunathil avatar Nov 07 '18 15:11 gireeshpunathil

Hi,

I don't have output for that command, What version I need to install and where I can download?

LeoMXIBM avatar Nov 07 '18 16:11 LeoMXIBM

/cc @shellberg to provide the right advise.

gireeshpunathil avatar Nov 07 '18 16:11 gireeshpunathil

I'm afraid the instructions you're following from Node-RED are too old (2015). They relate to use of Node v0.10, whereas, you are trying to install the latest greatest Node v11! Back then, you could use the glibc levels that were distributed with AIX 7.1 base; however, the rate of change with the v8 component means that you have to add later levels of GCC and GNU C++ support to your AIX 7.1 environment to meet the current compilation dependency levels. And, it can be a bit tricky to get them to co-exist!

@gireeshpunathil was trying to determine the last level of GLIBC support you might have added in your environment. Almost all the sources of GNU tooling for AIX add this in the /opt/freeware/lib/gcc/... directory tree. Even getting the RPM repository data synchronised between base AIX packages and any additions can prove unreliable. So, perhaps you could tell us if you have any contents at:

$ ls /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/

As for where to download, you need to try and keep consistent in your sources of freeware packages (because of the dependence they typically place on the GNU toolchain) to maintain a coherent set of packages. We should determine if you have any such additions first! (Do you have any content in /opt/freeware/?) Then you need to choose a good complrehensive source such as the AIX Toolbox, or Bull Freeware. Once chosen, you need to commit to that choice and not try and mix-n-match packages, IMHO. Otherwise, a wide variety of problems can present...

shellberg avatar Nov 07 '18 17:11 shellberg

Hi,

Yes I have content in my. /opt/freeware:

ls /opt/freeware 64/ bin/ etc/ info/ lib64/ man/ sbin/ src/ Director_instNLS/ doc/ include/ lib/ libexec/ packages/ share/ var/ also, for the /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/

I have this output:

ls /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/ 4.8.2/ 4.9.4/

LeoMXIBM avatar Nov 07 '18 18:11 LeoMXIBM

Hi,

so, @shellberg what level of GLIBC I need to install?

As I recall, AIX Toolbox was used for other libraries.

LeoMXIBM avatar Nov 07 '18 21:11 LeoMXIBM

how about exporting LIBPATH to the location where your libstdc++.a or libstdc++.so.6 is present within /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4 and trying?

gireeshpunathil avatar Nov 08 '18 01:11 gireeshpunathil

hi @gireeshpunathil

I tried, but the same result:

pwd /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4 ls -ltr libstdc++.a -rwxr-xr-x 1 root system 11562081 Aug 04 2016 libstdc++.a* ls -ltr libstdc++.so.6 ls: 0653-341 The file libstdc++.so.6 does not exist.

export LIBPATH=$LIBPATH:/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4

cd /opt/node/node-v11.0.0-aix-ppc64/bin

pwd /opt/node/node-v11.0.0-aix-ppc64/bin

./node --version exec(): 0509-036 Cannot load program ./node because of the following errors: 0509-150 Dependent module /opt/freeware/lib/libstdc++.a(libstdc++.so.6) could not be loaded. 0509-103 The module has an invalid magic number. echo $LIBPATH /opt/freeware/lib:/opt/freeware/lib64:/usr/lib:/usr/lib64:.:/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.9.4

Do I need to install another GLIBC version?

LeoMXIBM avatar Nov 08 '18 04:11 LeoMXIBM

apologies; did not give enough attention last time - node 11 needs gcc 6.3. Once that is installed, you can set the LIBPATH appropriately based on the installation path.

gireeshpunathil avatar Nov 08 '18 05:11 gireeshpunathil

@LeoMXIBM : Sorry, @gireeshpunathil and myself are in different timezones... possibly from you too! So, you have GCC v4.8.2 and v4.9.4 GCC (and associated support?) installed, but as Gireesh mentioned, we will need a minimum of GCC v6.3 installed. You should install both GCC and C++ support at this compatible level... In terms of RPMs, you need this set (compatible with v6.33):

gcc-6.3.3
gcc-c++-6.3.3
gettext
gmp
info
libgcc-6.3.3
libiconv
libmpc
libstdc++-6.3.3
libstdc++-devel-6.3.3
mpfr
zlib

From memory, this set of RPMs (in the same directory) will install with rpm -Uvh *.rpm, with the exception of the latest gettext package; that almost always needs to be installed with -nodeps (that should occur first).

AIX Toolbox can be a source of packages, including the compiler toolchains. You should not treat it as only a source of individual libraries, because its a bad idea to try and treat this as a la carte (as I mentioned) and attempt to mix-n-match content.

shellberg avatar Nov 08 '18 13:11 shellberg

@LeoMXIBM OK, I've just tested exactly what you're trying to do (short of installing Node-RED) : I've taken a bare AIX 7.1 host (that we'd only used for testing Node up-to version 4, when the GCC/C++ requirements needed additional packages): oslevel -s is 7100-03-05-1524 It has been maintained with some additional packages from Bull Freeware. Thus, I went to the Freeware site, and I've obtained the gcc-c++-6.3.0-1 built for aix7.1 package. It attempts to calculate the requisite closure of dependencies, and it almost gets it right ;-) This is a fraught calculation, and there is plenty of scope to get it wrong! Where it goes wrong is suggesting libstdc++-8.2.0-1.aix7.1.ppc.rpm (latest), whereas it should be libstdc++-6.3.0-1.aix7.1.ppc.rpm (matching). So, uncheck that dependency, and download the composed ZIP file; then obtain libstdc++-6.3.0-1 built for aix7.1 separately as a second download (from the Bull Freeware site). When it comes to most of the compiler support, and supporting libraries, it matters to get the relevant architecture version (aix7.1 for us), whereas some of the dependencies will (correctly) use an aix6.1 version (where only that is available). I combined these two sets of RPMs in a single new directory on my AIX 7.1 host, and then using this as my current directory, I intended to issue the command rpm -Uvh *.rpm.

For reference, this was the contents of my RPM packages that I was adding: (correct for November 2018)

bash-4.4-3.aix6.1.ppc.rpm
gcc-6.3.0-1.aix7.1.ppc.rpm
gcc-c++-6.3.0-1.aix7.1.ppc.rpm
gcc-cpp-6.3.0-1.aix7.1.ppc.rpm
gettext-0.19.8-1.aix6.1.ppc.rpm
glib2-2.48.1-2.aix6.1.ppc.rpm
gmp-6.1.1-1.aix6.1.ppc.rpm
info-6.4-1.aix6.1.ppc.rpm
libffi-3.2.1-2.aix6.1.ppc.rpm
libgcc-6.3.0-1.aix7.1.ppc.rpm
libiconv-1.14-22.aix6.1.ppc.rpm
libmpc-1.0.3-2.aix6.1.ppc.rpm
libstdc++-6.3.0-1.aix7.1.ppc.rpm
libstdc++-devel-6.3.0-1.aix7.1.ppc.rpm
libunistring-0.9.6-2.aix6.1.ppc.rpm
libxml2-2.9.4-2.aix6.1.ppc.rpm
mpfr-3.1.4-1.aix6.1.ppc.rpm
ncurses-6.1-1.aix6.1.ppc.rpm
xz-libs-5.2.2-2.aix6.1.ppc.rpm
zlib-1.2.11-1.aix6.1.ppc.rpm

Strictly speaking, I really didn't need to update the bash, although it is correctly a dependency of the entire set - with some (repeated) experience, you can know what is essential, but more likely you want to know a formula that will work! I had one package already installed at the necessary version, and so my command in the end was rpm -Uvh --replacepkgs *.rpm and all installed, including gettext!

Then, I retrieved the node 11 build per your link, i.e. the community binary from the nodejs.org download site). I simply unpacked this into a fresh directory, changed my working directory to the requisite bin directory, and (the moment of truth!) executed './node --version' ....

bash-4.4# ./node --version
Could not load program ./node:
        Dependent module libstdc++.a(libstdc++.so.6) could not be loaded.
Could not load module libstdc++.a(libstdc++.so.6).
System error: No such file or directory

Looks familiar! Now... Can we use LIBPATH to find the relevant C++ support?

bash-4.4# LIBPATH=/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/ ./node --version
v11.1.0

Success! Obviously, you can now set (and export) LIBPATH persistently in your (user's) shell defaults. Simply exporting LIBPATH and amending the PATH so our current directory content is executable, and I can similarly execute 'npm --version':

bash-4.4# npm --version
6.4.1

Hopefully you can use this account as the basis of your own endeavour, and you'll find the same success.

This approach is what is necessary for using Node v9 and above on AIX 7.1 when the minimum GCC/C++ compiler effectively requires v5 or higher ; if you are only need up to Node 8, then you can still achieve this with a GCC/C++ level of v4.8, which is a similar addition over base, but less demanding to achieve.

Good Luck!

shellberg avatar Nov 08 '18 18:11 shellberg

hi @ shellberg

Good news, after we upgrade the libraries we already can check the version:

./node --version v11.0.0

Thank you so much for your time, If I have another question, I'll create another ticket support.

LeoMXIBM avatar Nov 08 '18 19:11 LeoMXIBM