Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linecache19 fails to compile with 1.9.3-head #8

Open
dblock opened this issue May 28, 2011 · 27 comments
Open

Linecache19 fails to compile with 1.9.3-head #8

dblock opened this issue May 28, 2011 · 27 comments

Comments

@dblock
Copy link

dblock commented May 28, 2011

ruby 1.9.3dev (2011-05-29 trunk 31764) [i686-linux]

vm_core seems no more

dblock@dblock-magenta:/source/Gravity/dblock2$ cat ./ruby-1.9.2-p180/include/ruby-1.9.1/ruby-1.9.2-p180/vm_core.h
cat: ./ruby-1.9.2-p180/include/ruby-1.9.1/ruby-1.9.2-p180/vm_core.h: No such file or directory
dblock@dblock-magenta:
/source/Gravity/dblock2$ cat /home/dblock/.rvm/gems/ruby-head/gems/linecache19-0.5.12/ext/trace_nums/mkmf.log
have_header: checking for vm_core.h... -------------------- no

"gcc -o conftest -I/home/dblock/.rvm/rubies/ruby-head/include/ruby-1.9.1/i686-linux -I/home/dblock/.rvm/rubies/ruby-head/include/ruby-1.9.1/ruby/backward -I/home/dblock/.rvm/rubies/ruby-head/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/dblock/.rvm/rubies/ruby-head/lib -Wl,-R/home/dblock/.rvm/rubies/ruby-head/lib -L. -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/home/dblock/.rvm/rubies/ruby-head/lib -L/home/dblock/.rvm/rubies/ruby-head/lib -lruby-static -lpthread -lrt -ldl -lcrypt -lm -lc"
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: int main() {return 0;}
/
end */

"gcc -E -I/home/dblock/.rvm/rubies/ruby-head/include/ruby-1.9.1/i686-linux -I/home/dblock/.rvm/rubies/ruby-head/include/ruby-1.9.1/ruby/backward -I/home/dblock/.rvm/rubies/ruby-head/include/ruby-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -o conftest.i"
conftest.c:3:21: fatal error: vm_core.h: No such file or directory
compilation terminated.
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include <vm_core.h>
/
end */


@mark-moseley
Copy link
Owner

Works fine for me. Are you using the --with-ruby-include=/ parameter?

@masterkain
Copy link

I'm using RVM, bundler and ruby 1.9.3, no flags, same problem as above.

ruby 1.9.3dev (2011-06-22 trunk 32202) [x86_64-darwin10.7.0]

@andrerocker
Copy link

wrong way: cat ./ruby-1.9.2-p180/include/ruby-1.9.1/ruby-1.9.2-p180/vm_core.h
right way: cat ./ruby-1.9.2-p180/include/ruby-1.9.1/1.9.3dev/vm_core.h

@gnufied
Copy link

gnufied commented Aug 1, 2011

I think the problem is back for 1.9.3-preview1. @mark-moseley can you update ruby preview YAML so as, linecache works on 1.9.3 (if thats the problem afaik).

@svenfuchs
Copy link

i'm seeing the same issue on 1.9.3preview1

@vwall
Copy link

vwall commented Aug 2, 2011

Had to use the --with-ruby-include "gem install linecache19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-preview1"

@bhavinkamani
Copy link

It compiles with gem install linecache19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-preview1. However, on irb when I do "require "linecache19" it throws following error.

I am getting similar error for ruby-debug on 1.9.3-preview

@gnufied
Copy link

gnufied commented Aug 3, 2011

Bhavin, your error suspiciously looks like, as if it got compiled against wrong version of ruby or something.

@bhavinkamani
Copy link

nopes.. I have compiled it against right version. Here's the dump of my command sequence.

@mike-park
Copy link

Ditto, ruby 1.9.3dev (2011-07-31 revision 32789) [x86_64-darwin11.0.0]
with errors

@janv
Copy link

janv commented Aug 10, 2011

Having the same issue on rvm 1.9.3-preview1 :(

@masterkain
Copy link

dlopen(/Users/kain/.rvm/gems/ruby-1.9.3-preview1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_current_thread
  Referenced from: /Users/kain/.rvm/gems/ruby-1.9.3-preview1/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
  Expected in: flat namespace

@vwall
Copy link

vwall commented Aug 14, 2011

Actually now that I think about it I used this to install linecache
gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-preview1

@nevir
Copy link

nevir commented Aug 17, 2011

If you're using bundler, you can set it up to handle this whenever the ruby version changes (if you want to stay on the bleeding edge):

bundle config build.linecache19 --with-ruby-include=\$rvm_path/src/\$rvm_ruby_string
bundle config build.ruby-debug-base19 --with-ruby-include=\$rvm_path/src/\$rvm_ruby_string

And as a bonus, if you're also using perftools:

bundle config build.ruby-debug19 --with-opt-include=\$rvm_path/src/\$rvm_ruby_string

(Note, I am also getting the "Symbol not found: _ruby_current_thread" error whenever actually trying to load ruby-debug or linecache)

@bhavinkamani
Copy link

@nevir : Thats true. I can compile and install these gems without any issue after setting bundle config for these gems. However, it breaks with Symbol not found: _ruby_current_thread when I try to use them in irb.

@masterkain
Copy link

Notes for Darwin ( Mac OS X )
  For Lion, Rubies should be built using gcc rather than llvm-gcc. Since
  /usr/bin/gcc is now linked to /usr/bin/llvm-gcc-4.2, add the following to
  your shell's start-up file: export CC=gcc-4.2
  (The situation with LLVM and Ruby may improve. This is as of 07-23-2011.)

I'm going to try and see if this resolves the symbol not found error.

@joeperic
Copy link

I'm also facing the "fatal error: vm_core.h: No such file or directory" issue. My log was basically the same as OP's. It had this:

checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include <vm_core.h>
/ end */

@janv
Copy link

janv commented Aug 22, 2011

The Markdown in @joeperic's comment seems broken, should read:

#include "ruby.h"

#include <vm_core.h>

@joeperic
Copy link

Yes, thank you janv

@joeperic
Copy link

I did something similar to bhavinkamani and it worked. This seems to work: 'gem install linecache19 -- --with-ruby-include=[directory for ruby source]'

@janv
Copy link

janv commented Sep 29, 2011

So, 1.9.3-RC1 is out. I just tried to require linecache19 and this problem still exists :(

But the problem is being worked on, the discussion is here:
mark-moseley/ruby-debug#14
http://redmine.ruby-lang.org/issues/5193

@rubysolo
Copy link

fwiw, I've combined solutions from @nevir (setting --with-ruby-include options) and @masterkain (using gcc rather than llvm), and it compiles but still fails with the Symbol not found: _ruby_current_thread when you try to use it. (Lion, 1.9.3-RC1)

@osegrums
Copy link

osegrums commented Oct 3, 2011

Same error here for:
Using (ruby 1.9.3dev (2011-09-23 revision 33323) [i686-linux])

@osegrums
Copy link

osegrums commented Oct 3, 2011

Installing gem via bundler.
Gem installation succeeded when using advise from @nevir. Thanks dude.

@gnufied
Copy link

gnufied commented Oct 24, 2011

Error Symbol not found: _ruby_current_thread is coming because Ruby 1.9.3 has changed visibility of external variables via GCC flag.

@jeremy
Copy link

jeremy commented Oct 24, 2011

Patch to fix symbol visibility @ ruby/ruby#47

@Mihailoff
Copy link

ruby 2.0.0-p0 compatible fork

https://github.com/windwiny/linecache

To install from source code

gem build GEMNAME.gemspec
gem install gemname-version.gem

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

No branches or pull requests