rvm and subtle
Added by eric t about 14 years ago
I'm having problems compiling subtle with rvm.
beryllium:{eric}~/subtle/subtle-0.9.2109-iota:rake prefix=$HOME -v install (in /home/eric/subtle/subtle-0.9.2109-iota) gcc -o subtle build/subtle/shared.o build/subtle/display.o build/subtle/array.o build/subtle/screen.o build/subtle/client.o build/subtle/tray.o build/subtle/gravity.o build/subtle/panel.o build/subtle/tag.o build/subtle/view.o build/subtle/ruby.o build/subtle/subtle.o build/subtle/ewmh.o build/subtle/event.o build/subtle/hook.o build/subtle/grab.o build/subtle/sublet.o -L/home/eric/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/x86_64-linux -lruby -lX11 -lXft -lXrender -lfontconfig -lfreetype -lX11 -lXinerama /usr/bin/ld: cannot find -lruby collect2: ld returned 1 exit status rake aborted! Linker failed with status 1 /home/eric/subtle/subtle-0.9.2109-iota/Rakefile:504:in `block (2 levels) in <top (required)>'
beryllium:{eric}~/subtle/subtle-0.9.2109-iota:which ruby /home/eric/.rvm/rubies/ruby-1.9.2-p0/bin/ruby beryllium:{eric}~/subtle/subtle-0.9.2109-iota:ldd `which ruby` libruby.so.1.9 => /home/eric/.rvm/rubies/ruby-1.9.2-p0/lib/libruby.so.1.9 (0x00002abac313a000) libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003ab1400000) librt.so.1 => /lib64/librt.so.1 (0x0000003ab6000000) libdl.so.2 => /lib64/libdl.so.2 (0x0000003ab0c00000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0000003ac2e00000) libm.so.6 => /lib64/libm.so.6 (0x0000003ab1000000) libc.so.6 => /lib64/libc.so.6 (0x0000003ab0800000) /lib64/ld-linux-x86-64.so.2 (0x0000003aaf800000)
I suspect the problem is that gcc
doesn't know where the rvm version of ruby and is only searching in the system paths. Is it possible to configure something in the Rakefile to handle this?
Replies (12)
RE: rvm and subtle - Added by Christoph Kappel about 14 years ago
I wonder, did you configure subtle and then change the ruby version? Normally the build process uses the values supplied via mkmf and the config hash. Can you try to run rake clobber; rake
inside of the build tree? I am using rvm as well and I never had this problems.
RE: rvm and subtle - Added by eric t about 14 years ago
beryllium:{eric}~/subtle/subtle-0.9.2109-iota:rake clobber (in /home/eric/subtle/subtle-0.9.2109-iota) rm -r subtle rm -r subtlext.so rm -r build/subtle/shared.o rm -r build/subtle/display.o rm -r build/subtle/array.o rm -r build/subtle/screen.o rm -r build/subtle/client.o rm -r build/subtle/tray.o rm -r build/subtle/gravity.o rm -r build/subtle/panel.o rm -r build/subtle/tag.o rm -r build/subtle/view.o rm -r build/subtle/ruby.o rm -r build/subtle/subtle.o rm -r build/subtle/ewmh.o rm -r build/subtle/event.o rm -r build/subtle/hook.o rm -r build/subtle/grab.o rm -r build/subtle/sublet.o rm -r build/subtlext/shared.o rm -r build/subtlext/geometry.o rm -r build/subtlext/screen.o rm -r build/subtlext/client.o rm -r build/subtlext/tray.o rm -r build/subtlext/gravity.o rm -r build/subtlext/tag.o rm -r build/subtlext/view.o rm -r build/subtlext/subtle.o rm -r build/subtlext/window.o rm -r build/subtlext/icon.o rm -r build/subtlext/subtlext.o rm -r build/subtlext/color.o rm -r build/subtlext/sublet.o rm -r html rm -r build rm -r config.h rm -r config.log rm -r config.yml beryllium:{eric}~/subtle/subtle-0.9.2109-iota:rake (in /home/eric/subtle/subtle-0.9.2109-iota) checking for stdio.h... yes checking for stdlib.h... yes checking for stdarg.h... yes checking for string.h... yes checking for unistd.h... yes checking for signal.h... yes checking for errno.h... yes checking for assert.h... yes checking for sys/time.h... yes checking for sys/types.h... yes checking for sys/inotify.h... yes checking for execinfo.h... yes checking for X11/Xlib.h... yes checking for X11/Xft/Xft.h... yes checking for X11/extensions/Xinerama.h... yes checking for X11/extensions/Xrandr.h... no checking for select()... yes checking for rb_enc_set_default_internal()... yes creating config.yml creating config.h subtle 0.9.0 ----------------- Binaries............: //usr/bin Configuration.......: /etc/xdg/subtle Scripts.............: //usr/share/subtle/scripts Extension...........: //home/eric/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/subtle Xft support.........: yes Xinerama support....: yes XRandR support......: no Debugging messages..: no CC build/subtle/shared.o CC build/subtle/display.o CC build/subtle/array.o CC build/subtle/screen.o CC build/subtle/client.o CC build/subtle/tray.o CC build/subtle/gravity.o CC build/subtle/panel.o CC build/subtle/tag.o CC build/subtle/view.o CC build/subtle/ruby.o CC build/subtle/subtle.o CC build/subtle/ewmh.o CC build/subtle/event.o CC build/subtle/hook.o CC build/subtle/grab.o CC build/subtle/sublet.o LD subtle /usr/bin/ld: cannot find -lruby collect2: ld returned 1 exit status rake aborted! Linker failed with status 1 /home/eric/subtle/subtle-0.9.2109-iota/Rakefile:504:in `block (2 levels) in <top (required)>' (See full trace by running task with --trace)
This is very strange. It seems to look like it found ruby (by what the Extension is). The only thing that seems a little off is that there is an extra slash, but that shouldn't make a difference (I don't think).
RE: rvm and subtle - Added by Christoph Kappel about 14 years ago
Hm strange indeed, can you show me the output of following?
ruby -rmkmf -e "puts Config.expand('-L$(archdir) -l$(RUBY_SO_NAME)')"
RE: rvm and subtle - Added by eric t about 14 years ago
Perhaps that is my problem:
beryllium:{eric}/home/eric/subtle/subtle-0.9.2109-iota:ruby -rmkmf -e "puts Config.expand('-L$(archdir) -l$(RUBY_SO_NAME)')" Illegal variable name.
Any ideas on how to resolve the issue?
RE: rvm and subtle - Added by Christoph Kappel about 14 years ago
Hm, this is surely an even odder error. Can you check your ruby install in rvm for rbconfig.rb?
It contains all the stuff Config can return, also the RUBY_SO_NAME. In my install it's in /home/unexist/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/i686-linux
Any chance that you are in IRC and we can continue this there?
RE: rvm and subtle - Added by eric t about 14 years ago
The file does exist (although I'm using the 64 bit version).
beryllium:{eric}~:cat ~/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb # This file was created by mkconfig.rb when ruby was built. Any # changes made to this file will be lost the next time ruby is built. module RbConfig RUBY_VERSION == "1.9.2" or raise "ruby lib version (1.9.2) doesn't match executable version (#{RUBY_VERSION})" TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/1.9.1/x86_64-linux") DESTDIR = '' unless defined? DESTDIR CONFIG = {} CONFIG["DESTDIR"] = DESTDIR CONFIG["MAJOR"] = "1" CONFIG["MINOR"] = "9" CONFIG["TEENY"] = "1" CONFIG["PATCHLEVEL"] = "0" CONFIG["INSTALL"] = '/usr/bin/install -c' CONFIG["EXEEXT"] = "" CONFIG["prefix"] = (TOPDIR || DESTDIR + "/home/eric/.rvm/rubies/ruby-1.9.2-p0") CONFIG["ruby_install_name"] = "ruby" CONFIG["RUBY_INSTALL_NAME"] = "ruby" CONFIG["RUBY_SO_NAME"] = "ruby" . . . CONFIG["sitearch"] = "$(arch)" CONFIG["arch"] = "x86_64-linux" . . . CONFIG["archdir"] = "$(rubylibdir)/$(arch)" CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)" CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)" CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)" CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)"
Sorry about the forum messages, but irc is blocked where I'm at.
RE: rvm and subtle - Added by Christoph Kappel about 14 years ago
Ok, I attached a patch for this issue, can you test this one for me before I commit it to the repo? It fixes the different paths used in rvm for the various ruby versions. I tested it with 1.9.2-head and 1.9.2-p378.
rpath.path (877 Bytes) rpath.path |
RE: rvm and subtle - Added by eric t about 14 years ago
Sorry, but I still receive the same error.
beryllium:{eric}~/subtle/subtle-0.9.2109-iota:rake . . . CC build/subtle/ewmh.o CC build/subtle/event.o CC build/subtle/hook.o CC build/subtle/grab.o CC build/subtle/sublet.o LD subtle /usr/bin/ld: cannot find -lruby collect2: ld returned 1 exit status rake aborted! Linker failed with status 1 /home/eric/subtle/subtle-0.9.2109-iota/Rakefile:508:in `block (2 levels) in <top (required)>' (See full trace by running task with --trace)
I will try on a different machine later tonight.
RE: rvm and subtle - Added by Christoph Kappel about 14 years ago
Ah right, forgot to mention that you need to flush the generated files with rake clobber before trying it again.
RE: rvm and subtle - Added by eric t about 14 years ago
Christoph Kappel wrote:
Ah right, forgot to mention that you need to flush the generated files with rake clobber before trying it again.
I did perform a rake clobber
. I also tried with a fresh copy. I'm currently at a Red Hat 5 box right now and these things tend to have problems with dependencies. I'll try later at home with Fedora.
RE: rvm and subtle - Added by eric t about 14 years ago
Wow, at home the error is a little better...I think?
This is with both the iota release and what's latest on the repository.
[eric@chielo subtle-0.9.2109-iota]$ rake (in /home/eric/subtle/subtle-0.9.2109-iota) LD subtle build/subtle/shared.o: In function `subSharedRegexNew': /home/eric/subtle/subtle-0.9.2109-iota/src/shared/shared.c:153: undefined reference to `OnigSyntaxRuby' /home/eric/subtle/subtle-0.9.2109-iota/src/shared/shared.c:153: undefined reference to `OnigEncodingASCII' /home/eric/subtle/subtle-0.9.2109-iota/src/shared/shared.c:153: undefined reference to `onig_new' /home/eric/subtle/subtle-0.9.2109-iota/src/shared/shared.c:163: undefined reference to `onig_error_code_to_str' build/subtle/shared.o: In function `subSharedRegexMatch': /home/eric/subtle/subtle-0.9.2109-iota/src/shared/shared.c:189: undefined reference to `onig_match' build/subtle/shared.o: In function `subSharedRegexKill': /home/eric/subtle/subtle-0.9.2109-iota/src/shared/shared.c:204: undefined reference to `onig_free' build/subtle/ruby.o: In function `RubyBacktrace': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:67: undefined reference to `rb_intern2' build/subtle/ruby.o: In function `RubyConvert': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:107: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:108: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:119: undefined reference to `rb_str_new_cstr' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:120: undefined reference to `rb_str_new_cstr' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:121: undefined reference to `rb_str_new_cstr' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:122: undefined reference to `rb_str_new_cstr' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:133: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:134: undefined reference to `rb_str_new_cstr' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:134: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:146: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:147: undefined reference to `rb_str_new_cstr' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:147: undefined reference to `rb_intern2' build/subtle/ruby.o: In function `RubyHook': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:168: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:169: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:170: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:171: undefined reference to `rb_intern2' build/subtle/ruby.o:/home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:172: more undefined references to `rb_intern2' follow build/subtle/ruby.o: In function `RubyWrapCall': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:601: undefined reference to `rb_proc_arity' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:601: undefined reference to `rb_proc_arity' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:602: undefined reference to `rb_proc_arity' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:601: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:606: undefined reference to `rb_proc_arity' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:607: undefined reference to `rb_proc_arity' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:606: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:616: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:619: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:622: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:625: undefined reference to `rb_intern2' build/subtle/ruby.o:/home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:628: more undefined references to `rb_intern2' follow build/subtle/ruby.o: In function `RubySubletDispatcher': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1569: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1580: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1582: undefined reference to `rb_intern2' build/subtle/ruby.o: In function `RubySubletConfigure': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1617: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1616: undefined reference to `rb_intern2' build/subtle/ruby.o: In function `RubySubletOn': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1688: undefined reference to `rb_intern2' build/subtle/ruby.o:/home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1688: more undefined references to `rb_intern2' follow build/subtle/ruby.o: In function `RubySubletOn': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1698: undefined reference to `rb_proc_arity' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1701: undefined reference to `rb_intern2' build/subtle/ruby.o: In function `RubySubletNameReader': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1776: undefined reference to `rb_str_new_cstr' build/subtle/ruby.o: In function `RubySubletDataReader': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1856: undefined reference to `rb_str_new_cstr' build/subtle/ruby.o: In function `RubySubletBackgroundWriter': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1926: undefined reference to `rb_intern2' build/subtle/ruby.o: In function `RubySubletGeometryReader': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1970: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:1971: undefined reference to `rb_intern2' build/subtle/ruby.o: In function `RubySubletWatch': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2084: undefined reference to `rb_intern2' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2092: undefined reference to `rb_intern2' build/subtle/ruby.o: In function `subRubyInit': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2199: undefined reference to `rb_filesystem_encoding' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2199: undefined reference to `rb_enc_from_encoding' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2200: undefined reference to `rb_enc_set_default_internal' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2201: undefined reference to `rb_enc_set_default_external' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2207: undefined reference to `Init_prelude' build/subtle/ruby.o: In function `subRubyLoadConfig': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2308: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2315: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2316: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2322: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2338: undefined reference to `rb_str_new_cstr' build/subtle/ruby.o: In function `subRubyLoadSublet': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2541: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2547: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2548: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2554: undefined reference to `rb_str_new_cstr' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2565: undefined reference to `rb_intern2' build/subtle/ruby.o: In function `subRubyLoadSublets': /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2648: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2654: undefined reference to `ruby_snprintf' /home/eric/subtle/subtle-0.9.2109-iota/src/subtle/ruby.c:2655: undefined reference to `ruby_snprintf' collect2: ld returned 1 exit status rake aborted! Linker failed with status 1 /home/eric/subtle/subtle-0.9.2109-iota/Rakefile:503:in `block (2 levels) in <top (required)>' (See full trace by running task with --trace)
RE: rvm and subtle - Added by Christoph Kappel about 14 years ago
I am not sure I like this error more, did you apply my patch to the rakefile of the repo too? The problem is that the rakefile was never intended to use other paths then the system path for libraries, the patch fixes that and I will probably add this to the repo, since linking looks right for me:
> ldd ./subtle* ./subtle: libruby.so.1.9 => /home/unexist/.rvm/rubies/ruby-1.9.1-p378/lib/libruby.so.1.9 (0xb76c1000) ./subtlext.so: libruby.so.1.9 => /home/unexist/.rvm/rubies/ruby-1.9.1-p378/lib/libruby.so.1.9 (0xb758b000)
What ruby version did you try for the post above?