mark-moseley / linecache

GNU General Public License v2.0
29 stars 20 forks source link

Linecache19 fails to compile with 1.9.3-head #8

Open dblock opened 13 years ago

dblock commented 13 years ago

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_OFFSETBITS=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: vmcore.h: No such file or directory compilation terminated. checked program was: /* begin / 1: #include "ruby.h" 2: 3: #include /_ end */


mark-moseley commented 13 years ago

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

masterkain commented 13 years ago

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 commented 13 years ago

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 commented 13 years ago

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 commented 13 years ago

i'm seeing the same issue on 1.9.3preview1

vwall commented 13 years ago

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

bhavinkamani commented 13 years ago

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 commented 13 years ago

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

bhavinkamani commented 13 years ago

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

mike-park commented 13 years ago

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

janv commented 13 years ago

Having the same issue on rvm 1.9.3-preview1 :(

masterkain commented 13 years ago
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 commented 13 years ago

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 commented 13 years ago

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 commented 13 years ago

@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 commented 13 years ago
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 commented 13 years ago

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 / end */

janv commented 13 years ago

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

#include "ruby.h"

#include <vm_core.h>
joeperic commented 13 years ago

Yes, thank you janv

joeperic commented 13 years ago

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

janv commented 12 years ago

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: https://github.com/mark-moseley/ruby-debug/pull/14 http://redmine.ruby-lang.org/issues/5193

rubysolo commented 12 years ago

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 commented 12 years ago

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

osegrums commented 12 years ago

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

gnufied commented 12 years ago

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

jeremy commented 12 years ago

Patch to fix symbol visibility @ https://github.com/ruby/ruby/pull/47

Mihailoff commented 10 years ago

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