i executed make test and it seems that some of the tests are also
failing: [email protected]:~/Downloads/ruby-1.8.6-p399$ make test
not ok float 1 – ./sample/test.rb:1172
not ok float 2 – ./sample/test.rb:1173
not ok float 3 – ./sample/test.rb:1174
not ok float 4 – ./sample/test.rb:1175
not ok float 5 – ./sample/test.rb:1176
not ok float 6 – ./sample/test.rb:1177
not ok float 7 – ./sample/test.rb:1178
not ok float 8 – ./sample/test.rb:1179
not ok float 9 – ./sample/test.rb:1180
test failed
make: *** [test] Error 1
By the way, doing every same move with 1.8.7 as i did with 1.8.6 works
indeed: [email protected]:~/Downloads/ruby-1.8.7-p249$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-linux] [email protected]:~/Downloads/ruby-1.8.7-p249$ ruby -e “require ‘date’;
puts Date.today”
2010-05-30
But my problem was that i really-really needed 1.8.6, thus trying to
make it work.
But thanks for the tip.
Jarmo
Robert K. wrote:
If you are compiling from source anyway I’d probably switch to 1.8.7.
You could also check [1] to see whether it’s a known bug already.
I tried your first suggestion which worked as you said! Then i decided
to downgrade gcc completely and tried your second suggestion which also
worked!
Also make test succeeded (although i tried with latest patchlevel, so
i’m not sure if it was even related with my problem).
But why does 1.8.7 work with gcc 4.4? Is util.c there somehow changed?
So in the end it is a incompatibility problem with Ruby 1.8.6 and gcc
4.4 (which comes by default with latest Ubuntu)?
Anyway, thank You again!
Jarmo
Takehiro Kubo wrote:
As far as I checked, ruby_strtod() in util.c is broken by gcc 4.4’s
optimization.
disable optimization.
./configure
make
vi Makefile # replace -O2 to -O0.
touch util.c # update the timestamp to recompile util.c.
make
sudo make install
use gcc-4.3.
sudo apt-get install gcc-4.3
./configure CC=gcc-4.3
make
sudo make install
configure with -fno-strict-aliasing and --enable-pthread.
(I don’t know why it dismisses the problem…)
./configure CFLAGS=’-g -O2 -fno-strict-aliasing’ --enable-pthread
make
sudo make install