Skip to content

Conversation

@bluewomble
Copy link

I couldn't get the current release branch of rsruby to build on the latest Ubuntu with the standard ruby package - it gives the following error:

$ sudo gem install rsruby -- --with-R-dir=$R_HOME --with-R-include=/usr/share/R/include
Building native extensions.  This could take a while...
ERROR:  Error installing rsruby:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb --with-R-dir=/usr/lib/R --with-R-include=/usr/share/R/include
checking for main() in -lR... yes
checking for R.h... yes
creating Makefile

make
compiling robj.c
compiling rsruby.c
rsruby.c: In function ‘r_finalize’:
rsruby.c:104:3: warning: implicit declaration of function ‘Rf_KillAllDevices’ [-Wimplicit-function-    declaration]
rsruby.c: In function ‘rs_shutdown’:
rsruby.c:121:3: warning: implicit declaration of function ‘Rf_endEmbeddedR’ [-Wimplicit-function- declaration]
compiling Converters.c
Converters.c: In function ‘ruby_to_R’:
Converters.c:107:7: error: format not a string literal and no format arguments [-Werror=format-security]
Converters.c: In function ‘to_ruby_vector’:
Converters.c:356:25: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
Converters.c:384:21: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
Converters.c:310:9: warning: unused variable ‘params’ [-Wunused-variable]
Converters.c: In function ‘to_ruby_hash’:
Converters.c:601:10: warning: assignment discards ‘const’ qualifier from pointer target type    [enabled by default]
cc1: some warnings being treated as errors
make: *** [Converters.o] Error 1


Gem files will remain installed in /var/lib/gems/1.9.1/gems/rsruby-0.5.1.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/rsruby-0.5.1.1/ext/gem_make.out

I thin kthe issue is similar to the compilation errors reported in this issue in eventmachine:
eventmachine/eventmachine#346

...and the fix is very similar - I've modified a couple of the rb_raise calls to include the format string "%s" explicitly.

Thanks,
Ash.

@bluewomble
Copy link
Author

Actually, this isn't quite right - my 'fix' seems to be causing segfaults...

I managed to get the standard released gem to install (and work without segfault'ing) by installing like this:

gem install rsruby -- --with-R-include=/usr/share/R/include --with_cflags="-fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wall -fno-strict-aliasing"

i.e. I used the options that extconf.rb put into the Makefile for me, except for -Werror=format-security which breaks the build.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant