10

Which cygwin package do I install to get the parallel command?

http://www.commandlinefu.com/commands/view/4738/grep-or-anything-else-many-files-with-multiprocessor-power

Bob
  • 4,576
  • 7
  • 39
  • 107
  • There are two different commands called `parallel`, with different options. One is provided by the GNU `parallel` package; the other is provided (at least on Ubuntu) by the `moreutils` package. See [this Debian bug report](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749355), for example. I don't know how this is resolved on Cygwin. – Keith Thompson Sep 14 '16 at 20:44
  • 2
    Please note that there appear to be [known issues](https://cygwin.com/ml/cygwin/2017-03/msg00189.html) with GNU Parallel on cygwin, which is why it the cygwin maintainers don't package it in the first place. Not that you can't get it to run (it's just Perl), but it doesn't always work correctly. – joelhardi Aug 22 '17 at 19:56

2 Answers2

9

This script works better to install the latest version of GNU parallel from the source.

wd=$(mktemp -d)
wget -nc -P $wd ftp://ftp.gnu.org/gnu/parallel/parallel-latest.tar.bz2

cd $wd
tar -xf parallel-latest.tar.bz2
cd parallel-*
./configure && make && make install
Саша Черных
  • 2,561
  • 4
  • 25
  • 71
DomainsFeatured
  • 1,426
  • 1
  • 21
  • 39
  • I'm getting `The setpgrp function is unimplemented at -e line 1` on Windows Server 2012 R2. Does it work for anyone else? – e40 Nov 03 '16 at 15:59
  • `setpgrp` is used a lot in parallel, so I highly doubt that it will ever work on cygwin. – e40 Nov 03 '16 at 16:05
  • It works on `cygwin` fine for me. It might be the package of cygwin you have installed. – DomainsFeatured Nov 03 '16 at 17:19
  • You can also go to `ftp.gnu.org/gnu/parallel/` and pick a different package and substitute that path into the code. I like using one of the older packages. – DomainsFeatured Nov 03 '16 at 17:19
  • I've just installed parallel via Cygwin and get the following warning every time I try using it, and no results: `sh: -c: option requires an argument`. Any ideas? – GGGforce Mar 05 '20 at 16:35
8

Install gcc, make, autotools etc into cygwin, download the software and compile it yourself (natively, under windows, so you get a windows, native binary) as it doesn't seem to be offered by cygwin.

The README for the software has a section on windows:

= Minimal installation =

If you just need parallel and do not have 'make' installed (maybe the system is old or Microsoft Windows):

wget http://git.savannah.gnu.org/cgit/parallel.git/plain/src/parallel
chmod 755 parallel
cp parallel sem
mv parallel sem dir-in-your-$PATH/bin/
Cwissy
  • 2,006
  • 15
  • 14