# Problems building ruby1.9 on Blue Gene/L

**URL:** <https://www.ruby-forum.com/t/problems-building-ruby1-9-on-blue-gene-l/122550>\
**Category:** Ruby\
**Created:** [December 9, 2007, 9:06am UTC](https://www.ruby-forum.com/t/problems-building-ruby1-9-on-blue-gene-l/122550 "2007-12-09T09:06:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![underbluewaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/5daacb/32.png) [@underbluewaters](https://www.ruby-forum.com/u/underbluewaters)\
**Post date:** [December 9, 2007, 9:06am UTC](https://www.ruby-forum.com/t/problems-building-ruby1-9-on-blue-gene-l/122550/1 "2007-12-09T09:06:33Z")

</div>

Trying to cross-compile a compute node binary of Ruby1.9.

First, the configure.in file is still broken from Ruby1.8.6. You need to  
comment out these lines so the configure script doesn’t break:

./configure.in:706:#AC\_FUNC\_GETPGRP  
./configure.in:707:#AC\_FUNC\_SETPGRP

You also need to hack the resulting configure file so it won’t exit  
complaining you are trying to cross compile.

I used the following configure options:  
export CC=blrts\_xlc  
export F77=blrts\_xlf  
export FFLAGS=" -O2"  
export CFLAGS=" -O2"  
#Make sure to link the lmsglayer,lrts,ldevices before and after  
everything in the makefile.  
export LDFLAGS=" -qarch=440d -qtune=440   
-lc -lnss\_files -lnss\_dns -lresolv   
-L/bgl/BlueLight/ppcfloor/bglsys/lb -lmpich.rts -lmsglayer.rts  
-lrts.rts -ldevices.rts"  
echo “Configuring”  
export EXTLIBS="-lc -lnss\_files -lnss\_dns -lresolv"   
./configure -build powerpc-aix -host ppc-linux-gnu   
–includedir=/home/crb002/include --oldincludedir=/home/crb002/include  
–prefix=/home/crb002/

Now for the make:

> make  
> ./lib/fileutils.rb:1532:in `public': undefined method`commands’ for  
> class `Module' (NameError) from ./lib/fileutils.rb:1532 from ./lib/fileutils.rb:1531:in`each’  
> from ./lib/fileutils.rb:1531  
> from ./mkconfig.rb:10:in `require’  
> from ./mkconfig.rb:10  
> make: \*\*\* [.rbconfig.time] Error 1

> make -n  
> ruby -I/MY\_FANCY\_PATH/ruby -rfake ./mkconfig.rb  
> -timestamp=.rbconfig.time   
> -install\_name=ruby   
> -so\_name=ruby rbconfig.rb  
> ruby -I/MY\_FANCY\_PATH/ruby -rfake -I. -rrbconfig  
> ./tool/compile\_prelude.rb ./prelude.rb ./gem\_prelude.rb prelude.c  
> blrts\_xlc -O5 -qarch=440d -qtune=440 -I. -I.ext/include/powerpc-linux  
> -I./include -I. -DRUBY\_EXPORT -D\_GNU\_SOURCE=1 -c prelude.c  
> make: \*\*\* No rule to make target `thread_.h', needed by`error.o’.  
> Stop.

Any sugestions?

---

<div class="post-metadata">

**Author:** ![underbluewaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/5daacb/32.png) [@underbluewaters](https://www.ruby-forum.com/u/underbluewaters)\
**Post date:** [December 9, 2007, 3:20pm UTC](https://www.ruby-forum.com/t/problems-building-ruby1-9-on-blue-gene-l/122550/2 "2007-12-09T15:20:31Z")

</div>

Hi,

At Sun, 9 Dec 2007 17:06:32 +0900,  
Chad B. wrote in [ruby-talk:282763]:

> First, the configure.in file is still broken from Ruby1.8.6. You need to  
> comment out these lines so the configure script doesn’t break:
> 
> ./configure.in:706:#AC\_FUNC\_GETPGRP  
> ./configure.in:707:#AC\_FUNC\_SETPGRP

How did it fail?

> > make  
> > ./lib/fileutils.rb:1532:in `public': undefined method`commands’ for  
> > class `Module’ (NameError)

How is MINIRUBY defined in Makefile?

> blrts\_xlc -O5 -qarch=440d -qtune=440 -I. -I.ext/include/powerpc-linux  
> -I./include -I. -DRUBY\_EXPORT -D\_GNU\_SOURCE=1 -c prelude.c  
> make: \*\*\* No rule to make target `thread_.h', needed by`error.o’.

Seems pthread isn’t supported, or isn’t detected properly.

---

<div class="post-metadata">

**Author:** ![underbluewaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/5daacb/32.png) [@underbluewaters](https://www.ruby-forum.com/u/underbluewaters)\
**Post date:** [December 11, 2007, 10:17pm UTC](https://www.ruby-forum.com/t/problems-building-ruby1-9-on-blue-gene-l/122550/3 "2007-12-11T22:17:41Z")

</div>

Nobuyoshi N. wrote:

> How did it fail?

On Blue Gene/L the compute nodes are different from the login node, so  
you have to cross compile everything. The configure script stops first  
when trying to test the setpgrp functions.

> checking whether setpgrp takes no argument… configure: error: cannot check setpgrp when cross compiling

GNU Autoconf 2.59 was used to generate the configure file.

For Ruby1.8 I just hacked the configure script to comment out offending  
lines, but it would be nice if the configure.in file was modified to get  
rid of cross compiling problems.

> > > make  
> > > ./lib/fileutils.rb:1532:in `public': undefined method`commands’ for  
> > > class `Module’ (NameError)
> 
> How is MINIRUBY defined in Makefile?

MINIRUBY = ruby -I/MY\_PATH/ruby -rfake $(MINIRUBYOPT)  
RUNRUBY = $(MINIRUBY) -I`cd $(srcdir)/lib; pwd`

Is miniruby anything special or can I just replace it with a working  
ruby1.8.6 build?

> > blrts\_xlc -O5 -qarch=440d -qtune=440 -I. -I.ext/include/powerpc-linux  
> > -I./include -I. -DRUBY\_EXPORT -D\_GNU\_SOURCE=1 -c prelude.c  
> > make: \*\*\* No rule to make target `thread_.h', needed by`error.o’.
> 
> Seems pthread isn’t supported, or isn’t detected properly.

Yes. The compute nodes of Blue Gene/L use a very stripped down kernel  
that makes everything run in one process. No forking allowed, no  
pthreads. Is there something I have to pass in order to turn off OS  
threading? For ruby1.8 this wasn’t a problem.

---

<div class="post-metadata">

**Author:** ![underbluewaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/5daacb/32.png) [@underbluewaters](https://www.ruby-forum.com/u/underbluewaters)\
**Post date:** [December 12, 2007, 3:30am UTC](https://www.ruby-forum.com/t/problems-building-ruby1-9-on-blue-gene-l/122550/4 "2007-12-12T03:30:39Z")

</div>

Chad B. wrote:

> Question. Looking into thread.c:
> 
> > YARV Thread Desgin
> > 
> > model 1: Userlevel Thread  
> > Same as traditional ruby thread.  
> > model 2: Native Thread with Giant VM lock  
> > Using pthread (or Windows thread) and Ruby threads run \> concurrent.
> 
> So model 1 threads are not supported in Ruby1.9?  
> Well, according to Matz’s keynote I guess not ☹

[http://rubyconf2007.confreaks.com/d2t1p8\_keynote.html](http://rubyconf2007.confreaks.com/d2t1p8_keynote.html)

Well looks like I am stuck with 1.8 until somebody implements green  
threading. So if one wanted to do this what would be involved?

---

<div class="post-metadata">

**Author:** ![underbluewaters](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/5daacb/32.png) [@underbluewaters](https://www.ruby-forum.com/u/underbluewaters)\
**Post date:** [December 12, 2007, 1:16am UTC](https://www.ruby-forum.com/t/problems-building-ruby1-9-on-blue-gene-l/122550/5 "2007-12-12T01:16:38Z")

</div>

Question. Looking into thread.c:

> YARV Thread Desgin
> 
> model 1: Userlevel Thread  
> Same as traditional ruby thread.  
> model 2: Native Thread with Giant VM lock  
> Using pthread (or Windows thread) and Ruby threads run \> concurrent.

And looking into vm\_core.h:

> #define RUBY\_VM\_THREAD\_MODEL 2  
> …  
> #if defined(\_WIN32)  
> #include “thread\_win32.h”  
> #elif defined(HAVE\_PTHREAD\_H)  
> #include “thread\_pthread.h”  
> #else  
> #error “unsupported thread type”  
> #endif  
> …  
> #if RUBY\_VM\_THREAD\_MODEL == 2  
> #else  
> #error “unsupported thread model”  
> #endif

So model 1 threads are not supported in Ruby1.9?
