2012-07-29 40 views
0

并行线程安装Ruby我想用RVM但没有TK/TCL /并行线程在我的Ubuntu 64位机器上安装红宝石:不使用RVM

$ rvm install ruby-1.9.3-p194 --default --reconfigure -C --with-out-ext=tcl --with-out-ext=tk --disable-pthread 
... 
$ rvm use ruby-1.9.3-p194 
$ ruby -r rbconfig -e 'puts RbConfig::CONFIG["configure_args"]' 
'--prefix=/home/yuvilio/.rvm/rubies/ruby-1.9.3-p194' '--enable-shared' '--disable-install-doc' '--without-ext=tcl' '--without-ext=tk' '--disable-pthread' '--with-libyaml' '--with-opt-dir=/home/yuvilio/.rvm/usr' 

但是,当我检查THREAD_MODEL,它仍然名单并行线程有:

$ ruby -r rbconfig -e 'puts RbConfig::CONFIG["THREAD_MODEL"]' 
pthread 
$ 

这是否意味着pthread仍在使用?如果是这样,为什么仍然存在?

这是不可避免的,因为我的编译器使用Posix线程?

$ gcc -v 
Using built-in specs. 
COLLECT_GCC=/usr/bin/gcc-4.6.real 
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper 
Target: x86_64-linux-gnu 
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ub\ 
untu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languag\ 
es=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shar\ 
ed --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-\ 
included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++\ 
/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --ena\ 
ble-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --en\ 
able-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=g\ 
eneric --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-g\ 
nu --target=x86_64-linux-gnu 
Thread model: posix 
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 
$ 

回答

3

红宝石运行./configure --help时,你可以看到:

--enable-pthread  obsolete, and ignored 

我的猜测也意味着--disable-pthread将无法​​正常工作,

我曾尝试:

rvm reinstall 1.9.3-posix --enable-threads=posix 

但它也没有工作,它看起来像这个选项被删除。

+0

奇怪,为什么他们甚至有没有可用的替代模型那里。加上pthread链接到一些红宝石[缓慢](在https://bugs.launchpad.net/ubuntu/+source/ruby1.8/+bug/307462)在Linux中似乎。 – yuvilio 2012-07-30 03:20:55

+0

你可以在这里看到http://bugs.ruby-lang.org/issues/2553#note-7该bug与1.9系列的ruby无关 – mpapis 2012-07-30 14:54:30

+0

它可能是[这个bug](http:// bugs。 ruby-lang.org/issues/show/3924)。我也尝试升级到gcc 4.7.0并运行rvm install。没有性能差异。 – yuvilio 2012-07-30 15:56:16