Ruby 1.9.3-p551编译 - 并行生成错误

时间:2016-04-02 12:53:25

标签: ruby makefile

作为更大的Makefile的一部分,我有以下代码来编译Ruby 1.9.3-p551(从这里下载:https://cache.ruby-lang.org/pub/ruby/ruby-1.9.3-p551.tar.gz):

rb:
    tar -xzf ruby-1.9.3-p551.tar.gz
    cd ruby-1.9.3-p551;  ./configure --prefix=${PREFIX} && make && make install

调用make rb PREFIX=$PWD/ruby一切都正常编译。

但我有很多要编译的包,我想使用-j标志并行编译,但这样做会产生以下错误(作为make步骤的一部分,配置成功完成) :

$ make -j 4 rb PREFIX=$PWD/ruby
...
make[1]: Entering directory `/home/vanwyk/tmp/ruby-1.9.3-p551'
CC = gcc
LD = ld
LDSHARED = gcc -shared
CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration 
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I.
DLDFLAGS =  
SOLIBS = 
make[1]: *** read jobs pipe: No such file or directory. Stop.
make[1]: *** Waiting for unfinished jobs....
compiling main.c
make[1]: Leaving directory `/home/vanwyk/tmp/ruby-1.9.3-p551'
make: *** [rb] Error 2

尝试解决方案

手动执行步骤

手动运行makefile中的步骤并将-j标志显式传递给make命令:

$ ./configure --prefix=$HOME/tmp/ruby
...
$ make -j 4
...
$ make install
...
$ ls $HOME/tmp/ruby/bin/
erb  gem  irb  rake  rdoc  ri  ruby  testrb

这是否意味着将-j标志传递给make命令与将其传递给调用make命令的Makefile之间存在差异?

Ruby的新版本:2.2.4

使用Ruby-2.2.4运行会产生原始错误

$ make -j 4 rb PREFIX=$PWD/ruby
...
make[1]: Entering directory `/home/vanwyk/tmp/ruby-2.2.4'
    CC = gcc
make[1]: ***    LD = ld
    LDSHARED = gcc -shared
    CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat -std=iso9899:1999 
read jobs pipe: Invalid argument. Stop.
make[1]: *** Waiting for unfinished jobs....
    XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE
    CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I.
    DLDFLAGS = -fstack-protector -pie  
    SOLIBS = 
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.1' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1) 
make[1]: Leaving directory `/home/vanwyk/tmp/ruby-2.2.4'
make: *** [rb] Error 2

Ubuntu 14.04 LTS,GNU Make 3.81,GCC 4.8.4

0 个答案:

没有答案