Compiling with node-gyp in parallel

201 views
Skip to first unread message

AT

unread,
Jun 26, 2014, 5:03:34 PM6/26/14
to nod...@googlegroups.com
I've tried searching for an answer to this but couldn't come up with anything - is there a way to have npm compile native addons with node-gyp, in parallel?

I've developing a native addon and in my Gruntfile I use the following configuration:

build: {
  command: function() {
    var os = require('os');
    return 'node-gyp build --debug --jobs ' + os.cpus().length;
  },
},

and it works great for development. I'd like end-users who install my addon to have the same speedup when they install with `npm install`. Is this possible?

mscdex

unread,
Jun 26, 2014, 10:43:04 PM6/26/14
to nod...@googlegroups.com
On Thursday, June 26, 2014 5:03:34 PM UTC-4, AT wrote:

and it works great for development. I'd like end-users who install my addon to have the same speedup when they install with `npm install`. Is this possible?

Not really. I usually just have the environment variable `JOBS` set to the number of cores (in my bashrc for example), that way all compilation gets finished faster and I never have to remember to set `--jobs` manually.

Nathan Rajlich

unread,
Jun 28, 2014, 4:38:34 PM6/28/14
to nodejs
Another option is to encourage users to run `npm config set jobs 8` (replace 8 with an appropriate number of CPU cores to use in parallel).


--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/21b5cf42-7ae1-4957-9ce3-6a963b13124b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages