0

我想使用 rvm 但没有 tk/tcl/pthreads 在我的 ubuntu 64 位机器上安装 ruby​​:

$ 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 时,它仍然在那里列出 pthread:

$ 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)
$
4

1 回答 1

3

运行./configure --helpruby​​ 时,您可以看到:

--enable-pthread        obsolete, and ignored

我猜这也意味着这--disable-pthread行不通,

我努力了:

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

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

于 2012-07-29T22:22:13.927 回答