如何在 Windows 上将 GNU Parallel 构建为可执行文件

How can build GNU Parallel to executable file on Windows

我尝试将 GNU Parallel 编译为 Windows 上的可执行文件。当我使用以下代码构建它时:

wget https://git.savannah.gnu.org/cgit/parallel.git/plain/10seconds_install
bash 10seconds_install

我没有得到任何可执行文件。更详细的,你可以看下面:

C:\Users\nexleuser\Desktop\tmp>bash 10seconds_install

GnuPG (gpg) is not installed so the signature cannot be checked.
This means that if the code has been changed by criminals, you will not discover that!

Continue anyway? (y/n)
y
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether ln -s works... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
make  all-recursive
make[1]: Entering directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922'
Making all in src
make[2]: Entering directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922/src'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922/src'
make[2]: Entering directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922'
make[2]: Leaving directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922'
make[1]: Leaving directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922'
Making install in src
make[1]: Entering directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922/src'
make[2]: Entering directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922/src'
 /usr/bin/mkdir -p '/usr/local/bin'
 /usr/bin/install -c parallel sql niceload parcat parset env_parallel env_parallel.ash env_parallel.bash env_parallel.csh env_parallel.dash env_parallel.fish env_parallel.ksh env_parallel.mksh env_parallel.pdksh env_parallel.sh env_parallel.tcsh env_parallel.zsh '/usr/local/bin'
make  install-exec-hook
make[3]: Entering directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922/src'
rm /usr/local/bin/sem || true
ln -s parallel /usr/local/bin/sem
make[3]: Leaving directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922/src'
 /usr/bin/mkdir -p '/usr/local/share/doc/parallel'
 /usr/bin/install -c -m 644 parallel.html env_parallel.html sem.html sql.html niceload.html parallel_tutorial.html parallel_book.html parallel_design.html parallel_alternatives.html parcat.html parset.html parallel.texi env_parallel.texi sem.texi sql.texi niceload.texi parallel_tutorial.texi parallel_book.texi parallel_design.texi parallel_alternatives.texi parcat.texi parset.texi parallel.pdf env_parallel.pdf sem.pdf sql.pdf niceload.pdf parallel_tutorial.pdf parallel_book.pdf parallel_design.pdf parallel_alternatives.pdf parcat.pdf parset.pdf parallel_cheat.pdf '/usr/local/share/doc/parallel'
 /usr/bin/mkdir -p '/usr/local/share/man/man1'
 /usr/bin/install -c -m 644 parallel.1 env_parallel.1 sem.1 sql.1 niceload.1 parcat.1 parset.1 '/usr/local/share/man/man1'
 /usr/bin/mkdir -p '/usr/local/share/man/man7'
 /usr/bin/install -c -m 644 parallel_tutorial.7 parallel_book.7 parallel_design.7 parallel_alternatives.7 '/usr/local/share/man/man7'
make[2]: Leaving directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922/src'
make[1]: Leaving directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922/src'
make[1]: Entering directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922'
make[2]: Entering directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922'
make[1]: Leaving directory '/cygdrive/c/Users/nexleuser/Desktop/tmp/parallel-20190922'

 installed globally22

我有一个问题:我们如何将 GNU Parallel 构建为 windows 上的可执行文件?可能吗?

我是否需要安装更多的软件包来将 GNU Parallel 构建为可执行文件?

感谢您的支持。

根据您的输出,此命令成功:

/usr/bin/install -c parallel sql niceload parcat parset env_parallel env_parallel.ash env_parallel.bash env_parallel.csh env_parallel.dash env_parallel.fish env_parallel.ksh env_parallel.mksh env_parallel.pdksh env_parallel.sh env_parallel.tcsh env_parallel.zsh '/usr/local/bin'

它将 parallel(和朋友)安装在 /usr/local/bin

所以你应该能够做到:

/usr/local/bin/parallel --version

如果您将 /usr/local/bin 添加到 $PATH,那么 parallel 应该有效。

export PATH=/usr/local/bin:$PATH
parallel --version

(但是 出了点问题:您脚本中的 $latest 不仅包含 'parallel-20190922',还可能包含 'parallel-20190922\r'。' \r' 出现在那里我只能猜测。也许你出于某种原因调用 Windows sort 而不是 GNU sort 并且可能为每一行插入 '\r' 。你可以尝试替换 sort in 10seconds_install with perl -e 'print sort <>' 看看输出的最后一行是否改变了?应该是:'GNU parallel-20190922 installed globally')