Ruby 1.9.3-p327 install on Ubuntu does not pass -O3 in CFLAGS #1326

Closed
mipearson opened this Issue Nov 23, 2012 · 5 comments

Comments

Projects
None yet
3 participants

Triggered by http://spin.atomicobject.com/2012/11/06/is-your-application-running-with-ruby-slow/

@mpapis provided this nice snippet to check CFLAGS:

ruby -rrbconfig -e 'puts RbConfig::CONFIG["CFLAGS"]'

RVM 1.16.20, Ruby 1.9.3-p327 on Ubuntu 12.04 x86_64: -I/usr/local/rvm/usr/include -fPIC
on Mountain Lion: -O3 -I/Users/mp/.rvm/usr/include -fno-common -pipe

Substituting CFLAGS for cflags gives us something different on both systems:

-O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long
-Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings
-Werror=declaration-after-statement -Werror=implicit-function-declaration

Manually compiling with -O3 on Ubuntu shows a 2x performance improvement using the basic time/count test in the linked blog post.

Member

richo commented Nov 23, 2012

Can you confirm the invocation used to build ruby in the first place?
On 23 Nov 2012 12:40, "mipearson" notifications@github.com wrote:

Triggered by
http://spin.atomicobject.com/2012/11/06/is-your-application-running-with-ruby-slow/

@mpasis provided this nice snippet to check CFLAGS:

ruby -rrbconfig -e 'puts RbConfig::CONFIG["CFLAGS"]'

RVM 1.16.20, Ruby 1.9.3-p327 on Ubuntu 12.04 x86_64: -I/usr/local/rvm/usr/include
-fPIC
on Mountain Lion: -O3 -I/Users/mp/.rvm/usr/include -fno-common -pipe

Substituting CFLAGS for cflags gives us something different on both
systems:

-O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long
-Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings
-Werror=declaration-after-statement -Werror=implicit-function-declaration

Manually compiling with -O3 on Ubuntu shows a 2x performance improvement
using the basic time/count test in the linked blog post.


Reply to this email directly or view it on GitHubhttps://github.com/wayneeseguin/rvm/issues/1326.

@richo from the shell it was simply rvm install ruby-1.9.3

Found the make.log, here's the top:

        CC = gcc
        LD = ld
        LDSHARED = gcc -shared
        CFLAGS = -I/usr/local/rvm/usr/include -fPIC 
        XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
        CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I.
        DLDFLAGS = -Wl,-soname,libruby.so.1.9  
        SOLIBS = -lpthread -lrt -ldl -lcrypt -lm  

@mpapis on IRC suggested rvm get head && rvm reinstall ruby-1.9.3

This installed a ruby with the correct CFLAGS. However, it did so by downloading a pre-built binary, so this doesn't tell me whether the bug was actually fixed.

mpapis was assigned Nov 23, 2012

Confirmed that compiled version via RVM HEAD successfully includes cflags. Closing!

mipearson closed this Nov 23, 2012

Owner

mpapis commented Nov 23, 2012

also released as 1.17.0 stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment