Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Ruby 1.8.6 on QNX: (12 Items)
   
Ruby 1.8.6 on QNX  
Hello everybody,
I'm trying to have Ruby running on Neutrino, so I've built the latest distribution (1.8.6-p114). All the standard steps 
(configure, make and make install) went fine and now I have a running ruby interpreter and irb console.
But there are unresolved issues: if I try to require a library (like socket or thread, for example) the interpreter 
fails complaining about unresolved symbols.
Anyone having the same problems (if not a solution) outta here?
Thanks in advance,
Paolo
Re: Ruby 1.8.6 on QNX  
Can you please post the names of the unresolved symbols?
Re: Ruby 1.8.6 on QNX  
Here is and example:

# irb -retc
unknown symbol: rb_eRuntimeError
unknown symbol: rb_eArgError
unknown symbol: rb_check_safe_obj
unknown symbol: rb_ary_new
unknown symbol: rb_define_module
unknown symbol: rb_int2inum
unknown symbol: rb_tainted_str_new2
unknown symbol: rb_define_module_function
unknown symbol: rb_scan_args
unknown symbol: rb_global_variable
unknown symbol: rb_struct_define
unknown symbol: rb_num2long
unknown symbol: rb_ensure
unknown symbol: rb_sys_fail
unknown symbol: rb_string_value
unknown symbol: rb_secure
unknown symbol: rb_ary_push
unknown symbol: rb_block_given_p
unknown symbol: rb_raise
unknown symbol: rb_struct_new
unknown symbol: rb_yield
/usr/local/lib/ruby/1.8/i386-nto-qnx6.3.2/etc.so: Unresolved symbols - /usr/local/lib/ruby/1.8/i386-nto-qnx6.3.2/etc.so 
(LoadError)
	from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
	from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `each'
	from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
	from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
	from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
	from /usr/local/bin/irb:13

I get the same results (with different symbol names, of course) whichever ruby extension I try to load. Only plane ruby 
library work.
Note that if I list the names included in usr/local/lib/ruby/1.8/i386-nto-qnx6.3.2/etc.so (for example), I can correctly
 find those rb_* symbols:

# nm -l /usr/local/lib/ruby/1.8/i386-nto-qnx6.3.2/etc.so | grep rb_*
         U rb_ary_new
         U rb_ary_push
         U rb_block_given_p
         U rb_check_safe_obj
         U rb_define_module
         U rb_define_module_function
         U rb_eArgError
         U rb_eRuntimeError
         U rb_ensure
         U rb_global_variable
         U rb_int2inum
         U rb_num2long
         U rb_raise
         U rb_scan_args
         U rb_secure
         U rb_string_value
         U rb_struct_define
         U rb_struct_new
         U rb_sys_fail
         U rb_tainted_str_new2
         U rb_yield

I would add that I've built ruby directly on Neutrino, run the make test, and all went smooth, no warnings. I guess it's
 something related to the Neutrino's peculiar dynamic linking, am I right?
Re: Ruby 1.8.6 on QNX  
> I guess it's something related to the Neutrino's
> peculiar dynamic linking, am I right?

yes and no. It is not Neutrino related. You must tell the dynamic loader where to search the dynamic libs. This is done 
e.g. through the LD_LIBRARY_PATH environment variable. This is normal *IX behavior.

I suppose that the tests are working because they set this variable to load the local dynamic libs. I would suggest that
 you install ruby (bmake install). 

More about setting LD_LIBRARY_PATH is available in 

http://community.qnx.com/sf/discussion/do/viewFullPost/projects.pkgsrc/discussion.general.topc1201/post1754

and

http://community.qnx.com/sf/wiki/do/viewPage/projects.pkgsrc/wiki/Bootstrap

says:

 Set up your environment

    * Add /usr/pkg/bin:/usr/pkg/sbin to your PATH
    * Add /usr/pkg/lib to your CS_LIBPATH
          o I have the following in my /etc/rc,d/rc.local
            setconf CS_LIBPATH $(getconf CS_LIBPATH):/usr/pkg/lib


Hope it helps
Christian
Re: Ruby 1.8.6 on QNX  
The LD_LIBRARY_PATH already contains the /usr/local/lib path (ruby .so are located in subdirs of it). Also setting the 
CS_LIBPATH doesn't help.

Note that the interpreter fails in loading libraries (.so) even if they are in the current directory.

I'd add that I'm not using bmake, rather I'm trying to build the latest stable Ruby version (the version on pkgsrc is 
quite old). What I've done is a simple download, ./configure, make, make test, and make install cycle.

I see that a similar issue appears whith Python, see http://community.qnx.com/sf/discussion/do/listPosts/projects.pkgsrc
/discussion.general.topc2537
Re: Ruby 1.8.6 on QNX  
I compile ruby 1.8.7 in QNX 6.3.2 without problems.
ruby and irb also work without problems.
I do not use qcc only gcc.
I used three versions gcc for the test and results from them were equal  for every one.
( # gcc --version
gcc (GCC) 4.2.4 20080423 (prerelease)
gcc (GCC) 4.3.1 20080403 (prerelease)
and gcc (GCC) 4.4.0 20080505 (experimental) )

I take a stable-snapshot ruby.
I made only one change in configure:
# diff configure configure.org
15940c15940
<         nto-qnx*)       : ${LDSHARED='${CC} -shared'}
---
>         nto-qnx*)       : ${LDSHARED="qcc -shared"}
next
./configure --enable-shared --enable-pthread --enable-largefile 2>&1 | tee Konfig.log
make 2>&1 | tee CC.log
make test 2>&1 | tee Test.log => test succeeded
make install 2>&1 | tee INSTALL.log

./miniruby  ./instruby.rb --dest-dir="" --extout=".ext" --make="make"
             --mflags="-I /usr/qnx632/target/qnx6/usr/include"
             --make-flags="I /usr/qnx632/target/qnx6/usr/include"
             --installed-list .installed.list --mantype="man"
installing binary commands
installing command scripts
installing library scripts
installing headers
installing manpages
installing extension objects
installing extension scripts

Ruby version is:
bash-3.2# ruby --version
ruby 1.8.7 (2008-05-07 patchlevel 5000) [i386-nto-qnx6.3.2]

irb work:
# irb -retc
irb(main):001:0>
.........
irb(main):008:0> Etc.getlogin
=> "root"
irb(main):009:0> name = Etc.getlogin
=> "root"
irb(main):010:0> info = Etc.getpwnam(name)
=> #<struct Struct::Passwd name="root", passwd="", uid=0, gid=0, gecos="Superuser", dir="/root", shell="/bin/s
h", age="", comment="Superuser">
irb(main):011:0> info.dir
=> "/root"
irb(main):012:0>

# irb
irb(main):001:0> def fib_up_to(n)
irb(main):002:1> f1, f2 = 1, 1
irb(main):003:1> while f1 <= n
irb(main):004:2>  puts f1
irb(main):005:2>  f1, f2 = f2, f1 + f2
irb(main):006:2> end
irb(main):007:1> end
=> nil
irb(main):008:0> fib_up_to(4)
1
1
2
3
=> nil
irb(main):009:0> fib_up_to(6)
1
1
2
3
5
=> nil
irb(main):010:0>


Re: Ruby 1.8.6 on QNX  
Great! many thanks, now it works.
Well...almost works: actually I still have an issue with rubygems. Once installed, the gem command doesn't work, 
complaining about another LoadError. 
In particular, it can't load the zlib library. Is it the same for you (try 'irb -rzlib')?
Thanks,
Paolo
Re: Ruby 1.8.6 on QNX  
> Great! many thanks, now it works.
> Well...almost works: actually I still have an issue with rubygems. Once 
> installed, the gem command doesn't work, complaining about another LoadError. 
> 
> In particular, it can't load the zlib library. Is it the same for you (try 
> 'irb -rzlib')?
> Thanks,
> Paolo

# irb -rzlib
irb(main):001:0>

Which version zlib you use ?
I use :
# ls -l /usr/local/lib | grep libz
-rw-r--r--  1 root      root         195946 May 03 00:52 libz.a
lrwxrwxrwx  1 root      root             13 May 03 00:52 libz.so -> libz.so.1.2.3
lrwxrwxrwx  1 root      root             13 May 03 00:52 libz.so.1 -> libz.so.1.2.3
-rwxr-xr-x  1 root      root          83045 May 03 00:51 libz.so.1.2.3
#
gem and rails work
# gem list --local

*** LOCAL GEMS ***

actionmailer (2.0.2)
actionpack (2.0.2)
activerecord (2.0.2)
activeresource (2.0.2)
activesupport (2.0.2)
rails (2.0.2)
rake (0.8.1)
#

Re: Ruby 1.8.6 on QNX  
Oh yes, that was the problem. By the way I'm wondering what is that libz.so.2 within /usr/lib: AFAIK the latest zlib 
version is 1.2.3...

But now I have another problem. I'm trying to build sqlite in order to use it for Rails. I grabed the sqlite-
amalgamation-3.5.8 tarball, accepted the default configuration and during the make step I get this: 

In file included from sqlite3.c:6358:
/usr/qnx632/target/qnx6/usr/include/stdio.h:260: error: conflicting types for `f
seeko'
/usr/qnx632/target/qnx6/usr/include/stdio.h:188: error: previous declaration of
`fseeko'
cc: /usr/qnx632/host/qnx6/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.5/cc1 err
or 1
make: *** [sqlite3.lo] Error 1
#

Same results with qcc and gcc either (3.3.5,gcc_ntox86).
Have you perhaps already solved this too?

Many many thanks for your helpful support!
Paolo




Re: Ruby 1.8.6 on QNX  
On Thu, May 08, 2008 at 06:37:18AM -0400, Paolo Bosetti wrote:
> Oh yes, that was the problem. By the way I'm wondering what is that libz.so.2 within /usr/lib: AFAIK the latest zlib 
version is 1.2.3...
> 
> But now I have another problem. I'm trying to build sqlite in order to use it for Rails. I grabed the sqlite-
amalgamation-3.5.8 tarball, accepted the default configuration and during the make step I get this: 
> 
> In file included from sqlite3.c:6358:
> /usr/qnx632/target/qnx6/usr/include/stdio.h:260: error: conflicting types for `f
> seeko'
> /usr/qnx632/target/qnx6/usr/include/stdio.h:188: error: previous declaration of
> `fseeko'
> cc: /usr/qnx632/host/qnx6/x86/usr/lib/gcc-lib/i386-pc-nto-qnx6.3.0/3.3.5/cc1 err
> or 1
> make: *** [sqlite3.lo] Error 1
> #
> 
> Same results with qcc and gcc either (3.3.5,gcc_ntox86).
> Have you perhaps already solved this too?
> 
> Many many thanks for your helpful support!
> Paolo
> 

This is fixed in the <stdio.h> contained in the utility
archive.  See the bootstrap page.

http://community.qnx.com/sf/wiki/do/viewPage/projects.pkgsrc/wiki/Bootstrap
Re: Ruby 1.8.6 on QNX  
Hi guys I want to install ruby to xqn
anyone can help me or show link to manuals for newbie

Can I create xqm template for KVM hypervisor ?
Re: Ruby 1.8.6 on QNX  
http://ftp.netbsd.org/pub/pkgsrc/packages/QNX/i386/6.5.0_head_20110826/All/ruby-1.8.7.352nb1.tgz

http://community.qnx.com/sf/projects/pkgsrc
http://community.qnx.com/sf/wiki/do/viewPage/projects.pkgsrc/wiki/BinaryPackages

On Thu, Aug 16, 2012 at 05:09:17AM -0400, Ruslan Voloshin wrote:
> Hi guys I want to install ruby to xqn
> anyone can help me or show link to manuals for newbie
> 
> Can I create xqm template for KVM hypervisor ?
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post94875
> To cancel your subscription to this discussion, please e-mail general-pkgsrc-unsubscribe@community.qnx.com