Problem in compilation and installation of Ruby 1.9

Hi

This mail is regarding the errors and warnings I got while compiling
Ruby 1.9. I have downloaded the Ruby 1.9 source code from the link
http://svn.ruby-lang.org/repos/ruby/trunk/ and I try to compile the code
but I was getting many compile time errors. I have done some changes in
configuration file and source code to solve those errors and warnings
but still I am getting few errors. Please look in detail description
about errors and warnings below and give reply about removing those
errors and warnings so I can successfully compile and install Ruby 1.9.

Machine/OS information for my machine:
OS: GNU/Linux
Kernel: 2.4.21-40.ELsmp
Kernel Version: #1 SMP Thu Feb 2 22:22:39 EST 2006
Processor: i686
Hardware-platform - i386

Below are details about errors and warnings.

First I got this error:

rm -f ruby
/opt/ruby/ruby-1.8.6/ruby ./tool/insns2vm.rb --srcdir=“.”
./tool/insns2vm.rb:3:in `require’: no such file to load – optparse
(LoadError)
from ./tool/insns2vm.rb:3
make: *** [optinsn.inc] Error 1

I export RUBYLIB=“./lib” to solve this error.

The next error I got was:

rm -f ruby
ruby ./tool/insns2vm.rb --srcdir=“.”
./tool/insns2vm.rb:7:in `require’: ./tool/…/lib/vm/instruction.rb:105:
syntax error (SyntaxError)
load_insns_def opts[:“insns.def”] || ‘insns.def’
^
./tool/…/lib/vm/instruction.rb:107: syntax error
load_opt_operand_def opts[:“opope.def”] || ‘opt_operand.def’
^
./tool/…/lib/vm/instruction.rb:108: syntax error
load_insn_unification_def opts[:“unif.def”] || ‘opt_insn_unif.def’
^
./tool/…/lib/vm/instruction.rb:114: syntax error
%w[use_const verbose].each do |attr|
^
./tool/…/lib/vm/instruction.rb:115: syntax error
./tool/…/lib/vm/instruction.rb:144: syntax error
vpath.open(file) do |f|
^
./tool/…/lib/vm/instruction.rb:145: syntax error
./tool/…/lib/vm/instruction.rb:150: syntax error
from ./tool/insns2vm.rb:7
make: *** [optinsn.inc] Error 1

The reason for this error was the version of ruby. The ruby binary
“/usr/bin/ruby” having version ruby 1.6.8 (2002-12-24) [i386-linux-gnu].
To solve it: The ruby 1.8.6 is already installed on my machine. I have
changed the “BASERUBY = /opt/ruby/ruby-1.8.6/ruby” (Earlier It was
“BASERUBY = ruby”) at line no 1661 in file configure.in and follow all
steps of compilation from the beginning (Means regenerate configure and
then Makefile).

The next error I got was:

In file included from thread.c:150:
thread_pthread.ci:90:1: directives may not be used inside a macro
argument
thread_pthread.ci:89:65: unterminated argument list invoking macro
“NOINLINE”
In file included from thread.c:150:
thread_pthread.ci:93: syntax error before ‘)’ token
thread.c:280: warning: thread_start_func_2' was declared implicitly extern’ and later static' thread_pthread.ci:114: warning: previous declaration of thread_start_func_2’
make: *** [thread.o] Error 1

To solve this error, I have commented line no 90, 91 and 92 in file
thread_pthread.ci.
Below is a snapshot of changed thread_pthread.ci file.


NOINLINE(static int thread_start_func_2(rb_thread_t *th, VALUE
*stack_start
//#ifdef __ia64
// , VALUE *register_stack_start
//#endif
));


I was getting a below warning for many of the files:

yarvcore.h:614: warning: `fastcall’ attribute directive ignored

To solve this warning, I have done below changes at line no 614 in
yarvcore.h file.
Snapshot before change for the line 614 in yarvcore.h file:


typedef rb_control_frame_t *
(FUNC_FASTCALL(*rb_insn_func_t))(rb_thread_t *, rb_control_frame_t
*);


Snapshot after change for the line 614 in yarvcore.h file:


typedef rb_control_frame_t * (*rb_insn_func_t)(rb_thread_t *,
rb_control_frame_t *);


Now I am getting this error and I can not able to solve it:

rbconfig.rb unchanged
/users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1026:in
method_missing': private method open’ called for false:FalseClass
(NoMethodError)
from
/users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1026:in
rescue in block in touch' from /users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1022:in block in touch’
from
/users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1020:in
each' from /users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1020:in touch’
from ./mkconfig.rb:188:in `’
make: *** [.rbconfig.time] Error 1

Hi,

In message “Re: Problem in compilation and installation of Ruby 1.9”
on Wed, 11 Jul 2007 18:15:13 +0900, Chirag M.
[email protected] writes:

|./tool/insns2vm.rb:7:in `require’: ./tool/…/lib/vm/instruction.rb:105:
|syntax error (SyntaxError)
| load_insns_def opts[:“insns.def”] || ‘insns.def’

Upgrade your ruby before compiling trunk.

          matz.

Hi,

At Wed, 11 Jul 2007 18:15:13 +0900,
Chirag M. wrote in [ruby-talk:258763]:

Machine/OS information for my machine:
OS: GNU/Linux
Kernel: 2.4.21-40.ELsmp
Kernel Version: #1 SMP Thu Feb 2 22:22:39 EST 2006
Processor: i686
Hardware-platform - i386

What’s the version of gcc?

First I got this error:

rm -f ruby
/opt/ruby/ruby-1.8.6/ruby ./tool/insns2vm.rb --srcdir="."
./tool/insns2vm.rb:3:in `require’: no such file to load – optparse
(LoadError)
from ./tool/insns2vm.rb:3

How did you install that ruby without optparse.rb?

The next error I got was:

In file included from thread.c:150:
thread_pthread.ci:90:1: directives may not be used inside a macro
argument
thread_pthread.ci:89:65: unterminated argument list invoking macro
“NOINLINE”

I haven’t seen this error, it may be a gcc version issue.
Anyway, I hope this has been fixed now.

I was getting a below warning for many of the files:

yarvcore.h:614: warning: `fastcall’ attribute directive ignored

What’s the version of autoconf? The warning should be checked
in configure.in.

Nobuyoshi N. wrote:

Hi,

At Wed, 11 Jul 2007 18:15:13 +0900,
Chirag M. wrote in [ruby-talk:258763]:

Machine/OS information for my machine:
OS: GNU/Linux

What’s the version of gcc?
It is gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-54)

How did you install that ruby without optparse.rb?
I have installed ruby 1.8.6.

I haven’t seen this error, it may be a gcc version issue.
Anyway, I hope this has been fixed now.

What’s the version of autoconf? The warning should be checked
in configure.in.
the version of autoconf is autoconf (GNU Autoconf) 2.57
for this I have change line no 4 with “AC_PREREQ(2.57)” in configure.in
file. Earlier this line was AC_PREREQ(2.13).

Yukihiro M. wrote:

Hi,

In message “Re: Problem in compilation and installation of Ruby 1.9”
on Wed, 11 Jul 2007 18:15:13 +0900, Chirag M.
[email protected] writes:

|./tool/insns2vm.rb:7:in `require’: ./tool/…/lib/vm/instruction.rb:105:
|syntax error (SyntaxError)
| load_insns_def opts[:“insns.def”] || ‘insns.def’

Upgrade your ruby before compiling trunk.

          matz.

Hi
Thanks for the reply. I have installed ruby 1.8.6 which is
installed under “/usr/local”. The older version ruby 1.6.8 is still in
“/usr”. the “ruby” command now upgraded with /usr/local/bin/ruby which
latest ruby 1.8.6. But still I am getting below error. Please give your
feedback.

rbconfig.rb unchanged
/users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1026:in
method_missing': private method open’ called for false:FalseClass
(NoMethodError)
from
/users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1026:in
rescue in block in touch' from /users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1022:in block in touch’
from
/users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1020:in
each' from /users/username1/UnoRuby/ruby_1.9_sourcecode/lib/fileutils.rb:1020:in touch’
from ./mkconfig.rb:188:in `’
make: *** [.rbconfig.time] Error 1

Hi,

At Fri, 13 Jul 2007 00:00:30 +0900,
Chirag M. wrote in [ruby-talk:259093]:

What’s the version of autoconf? The warning should be checked
in configure.in.
the version of autoconf is autoconf (GNU Autoconf) 2.57
for this I have change line no 4 with “AC_PREREQ(2.57)” in configure.in
file. Earlier this line was AC_PREREQ(2.13).

2.13? From where did you salvaged such old configure.in?
It is AC_PREREQ(2.58) in the SVN repository.

Hi,

In message “Re: Problem in compilation and installation of Ruby 1.9”
on Thu, 12 Jul 2007 23:52:14 +0900, Chirag M.
[email protected] writes:

|> Upgrade your ruby before compiling trunk.

| Thanks for the reply. I have installed ruby 1.8.6 which is
|installed under “/usr/local”. The older version ruby 1.6.8 is still in
|“/usr”. the “ruby” command now upgraded with /usr/local/bin/ruby which
|latest ruby 1.8.6. But still I am getting below error. Please give your
|feedback.

So your build process must be kicking old ruby (1.6.8?). Try checking
your PATH priority or specify BASERUBY for your make, e.g.

make BASERUBY=/usr/local/bin/ruby

          matz.

Nobuyoshi N. wrote:

Hi,

At Fri, 13 Jul 2007 00:00:30 +0900,
Chirag M. wrote in [ruby-talk:259093]:

What’s the version of autoconf? The warning should be checked
in configure.in.
the version of autoconf is autoconf (GNU Autoconf) 2.57
for this I have change line no 4 with “AC_PREREQ(2.57)” in configure.in
file. Earlier this line was AC_PREREQ(2.13).

2.13? From where did you salvaged such old configure.in?
It is AC_PREREQ(2.58) in the SVN repository.

Hi
I have confirmed it. I might made mistake. Earlier it was
AC_PREREQ(2.58). Then we have changed it to AC_PREREQ(2.57).

Hi,

At Fri, 13 Jul 2007 14:12:13 +0900,
Chirag M. wrote in [ruby-talk:259246]:

2.13? From where did you salvaged such old configure.in?
It is AC_PREREQ(2.58) in the SVN repository.

Hi
I have confirmed it. I might made mistake. Earlier it was
AC_PREREQ(2.58). Then we have changed it to AC_PREREQ(2.57).

The purpose of it is exactly to get rid of those warnings.

You can change anything, but it’s at your own risk.

Yukihiro M. wrote:

Hi,

In message “Re: Problem in compilation and installation of Ruby 1.9”
on Thu, 12 Jul 2007 23:52:14 +0900, Chirag M.
[email protected] writes:

|> Upgrade your ruby before compiling trunk.

| Thanks for the reply. I have installed ruby 1.8.6 which is
|installed under “/usr/local”. The older version ruby 1.6.8 is still in
|“/usr”. the “ruby” command now upgraded with /usr/local/bin/ruby which
|latest ruby 1.8.6. But still I am getting below error. Please give your
|feedback.

So your build process must be kicking old ruby (1.6.8?). Try checking
your PATH priority or specify BASERUBY for your make, e.g.

make BASERUBY=/usr/local/bin/ruby

          matz.

Hi Matz
I tried it also but it is still not wroking. I am getting same
error.

Chirag M. wrote:

Yukihiro M. wrote:

Hi,

In message “Re: Problem in compilation and installation of Ruby 1.9”
on Thu, 12 Jul 2007 23:52:14 +0900, Chirag M.
[email protected] writes:

|> Upgrade your ruby before compiling trunk.

| Thanks for the reply. I have installed ruby 1.8.6 which is
|installed under “/usr/local”. The older version ruby 1.6.8 is still in
|“/usr”. the “ruby” command now upgraded with /usr/local/bin/ruby which
|latest ruby 1.8.6. But still I am getting below error. Please give your
|feedback.

So your build process must be kicking old ruby (1.6.8?). Try checking
your PATH priority or specify BASERUBY for your make, e.g.

make BASERUBY=/usr/local/bin/ruby

          matz.

Hi Matz
I tried it also but it is still not wroking. I am getting same
error.

Hi
I checked the things whatever you had mentioned in your reply and
then I tried but it displayed same error. Then I have completely
uninstalled older version of ruby-1.6.8 and then install 1.8.6. Then I
tried to compile ruby1.9 package. But it is still giving same error and
“make” fails at the execution of following command:

./miniruby ./mkconfig.rb -timestamp=.rbconfig.time -install_name=ruby
-so_name=ruby rbconfig.rb

Are there any special settings to compile ruby1.9 package?
Are there any prerequisites for successful compilation of ruby1.9
package?

Hi,

Please stop posting same article many times.

At Tue, 17 Jul 2007 23:26:41 +0900,
Chirag M. wrote in [ruby-talk:260264]:

I checked the things whatever you had mentioned in your reply and

then I tried but it displayed same error. Then I have completely
uninstalled older version of ruby-1.6.8 and then install 1.8.6. Then I
tried to compile ruby1.9 package. But it is still giving same error and
“make” fails at the execution of following command:

What does this show?

./miniruby -s -e ‘p $timestamp’ – -timestamp=.rbconfig.time