Yes that sums it up. The thread looks like a mess of diatribe and techno babble but it really just boils down to being able to install node packages that you need for your application. The fact that some need to compile native c modules using node-gyp during the install is usually something you only notice in passing on unix platforms. It just works. On Windows it didn't work properly at all and there was a big furore about it. There is a massive thread about it but ultimately a reasonable simple workaround to get it going (
https://github.com/nodejs/node-gyp/issues/629#issuecomment-153196245) was posted by a lovely lady by the name of "mousetraps" :)
Lo and behold, similar issues exist for the IBMi. Once you have node.js installed via the newly available group PTF, it turns out that in order to install some of these packages I had to do the following:
install ibmichroot from bitbucket (wasn't as straightforward as I would have liked)
One off task
=========
Call qp2term
cd /qopensys/ibmichroot
wget
http://www.oss4aix.org/download/everything/RPMS/libstdc++-devel-4.8.3-1.aix6.1.ppc.rpm
rpm --ignoreos --ignorearch --replacepkgs --nodeps -hUv libstdc++-devel-4.8.3-1.aix6.1.ppc.rpm
Install packages, including those with native compiles
========================================
STRTCPSVR *SSHD (if need be)
call qp2term
ssh localhost
bash
export CC=gcc
npm install blah
Note: I did not use a separate client to make the SSH connection to my IBMi LPAR - I just did it from QP2TERM and connected to the box I was already on.
BUT I agree with Jon. We shouldn't have to worry about all this crap just to install a package........and one day soon this will be the case I hope. In many cases packages don't need to compile anything natively and you don't need to worry about all this - just dive straight in to npm.
-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxx] On Behalf Of Aaron Bartell
Sent: 13 July 2016 23:58
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxx>
Subject: Re: [IBMiOSS] gmake: *** virtual memory exhausted. Stop.
Since I am installing Group PTFs (aka waiting...) I will digress through some of this and you can ask further questions.
First, what was Kevin Turner trying to accomplish? He wanted to install a Node Package Module (npm) named hiredis(n1) so he could communicate from Node.js to Redis, which is a NoSQL database that can run on IBM i (thanks perzl). The "npm install hiredis" command Kevin was running is how you install packages from the internet. This particular package has a "native"
component. When you see "native" that usually means the language
(Node.js/Ruby/PHP/Python) wasn't fast enough to do something (in this case a faster parser, though I don't know what it's parsing; maybe JSON?) or it wasn't worth rewriting something that already exists (i.e. encryption algorithms). Because it had a native component (C/C++) it required a compile. This necessitated a bunch more tools, like GNU Make and GCC. GNU Make (gmake for short) is a tool that looks at a file named "Makefile" that has instructions on how to create/make the project (like how we might put together a CL program full of CRTRPGMOD and CRTSRVPGM commands). In Kevin's scenario gmake was puking because it didn't like ~something~.
Well, we don't necessarily know what that something was in this case. What we learned is we should ~never~ use QSH or QP2TERM for anything. We should always STRTCPSVR *SSHD and ssh into the machine into a bash shell (which IBM now ships with 5733OPS).
Hope that helps.
n1 -
https://www.npmjs.com/package/hiredis
Aaron Bartell
litmis.com - Services for open source on IBM i
On Wed, Jul 13, 2016 at 5:33 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
"So, I get the thrust of what Tony is saying, but I also want to
reassure open source newbies that you don't HAVE to know C to
participate fruitfully in open source.”
I on the other agree fully with Tony _except_ I would replace “C” with
“Unixese” - I do know some C but have rarely found it necessary to
utilizing OS software. However the fact that everything is described
in assorted sub-dialects of Unixese _is_ a major inhibitor.
I try to follow some of the conversations on this list and frankly it
is putting me off trying a lot of the stuff. Take an extract from one
of the recent discussions on this list:
"OK thanks all - a little progress. I was now able to install ibm_db
from npm. However, node-gyp rebuild still fails for things like
"hiredis". With that gmake fails:
gmake: *** virtual memory exhausted. Stop.”
I guess it is English of sorts - but where the heck is one supposed to
start ?
Personally I’d like to see IBM make a lot more effort to make this
stuff comprehensible.
Jon Paris
www.partner400.com
www.SystemiDeveloper.com
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To post a message email: OpenSource@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/opensource.
___________________________________________
This email has been scanned by iomartcloud.
http://www.iomartcloud.com/
________________________________
NOTICE: The information in this electronic mail transmission is intended by CoralTree Systems Ltd for the use of the named individuals or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone, so that the sender's address records can be corrected.
--------------------------------------------------------------------------------
CoralTree Systems Limited
25 Barnes Wallis Road
Segensworth East, Fareham
PO15 5TT
Company Registration Number 5021022.
Registered Office:
12-14 Carlton Place
Southampton, UK
SO15 2EA
VAT Registration Number 834 1020 74.
As an Amazon Associate we earn from qualifying purchases.