简体   繁体   中英

Installing ruby without pthreads using rvm

I wanted to install ruby on my ubuntu 64 bit box using rvm but without tk/tcl/pthreads:

$ 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'

But when I inspect the THREAD_MODEL, it still lists pthread there:

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

Does that mean pthread is still being used? And if so, why is it still there?

Is this unavoidable because my compiler uses Posix threads?

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

when running ./configure --help for ruby you can see:

--enable-pthread        obsolete, and ignored

Which I guess also means that --disable-pthread will not work,

I have tried:

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

but it also did not worked, it looks like this option got removed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM