Problems building and updating ruby-llvm

11 views
Skip to first unread message

Perry Metzger

unread,
Apr 3, 2017, 8:31:33 PM4/3/17
to ruby-llvm
Howdy!

I'd like to use ruby-llvm for a compiler prototype I'm building, but I'm having a
hard time getting many of the bits to build.

0) I figured out that I needed to update version.rb and re-run the Rakefile in 
ext/ruby-llvm-support/ though I'm not sure if any other steps are needed.
Are there?

1) On debian, if I run "rake generate_ffi", I get:

/usr/include/x86_64-linux-gnu/sys/types.h:146:10: fatal error: 'stddef.h' file not found
rake aborted!

and no real indication of where things went wrong. I can't figure out what to do next.

2) On macOS, having installed LLVM 4.0 using macports, if I
run "rake", in ext/ruby-llvm-support/ I get

ld: library not found for -lLLVM-4.0

and the build dies. It isn't entirely obvious how to fix this because
I haven't yet figured out how the thing decides where to find its libraries or
what they're names.

Anyone in a position to give me some pointers?

Perry

Perry E. Metzger

unread,
Apr 3, 2017, 9:06:23 PM4/3/17
to ruby-llvm
On Mon, 3 Apr 2017 17:31:33 -0700 (PDT) Perry Metzger
<pe...@piermont.com> wrote:
> 2) On macOS, having installed LLVM 4.0 using macports, if I
> run "rake", in ext/ruby-llvm-support/ I get
>
> ld: library not found for -lLLVM-4.0
>
> and the build dies.

So I got past that in a cheesy way (I cut and pasted the g++ build
line and hand-edited -lLLVM-4.0 to -lLLVM) and then I used otool to
check that the resulting libRubyLLVMSupport-4.0.dylib was pointing to
the correct libLLVM (it is).

I then went off to run "rake generate_ffi" and got:

rake aborted!
LoadError: Could not open library 'libclang-3.5.so.1': dlopen(libclang-3.5.so.1, 5): image not found.
Could not open library 'libclang-3.5.so.1.dylib': dlopen(libclang-3.5.so.1.dylib, 5): image not found.
Could not open library 'libclang.so.1': dlopen(libclang.so.1, 5): image not found.
Could not open library 'libclang.so.1.dylib': dlopen(libclang.so.1.dylib, 5): image not found.
Could not open library 'clang': dlopen(clang, 5): image not found.
Could not open library 'libclang.dylib': dlopen(libclang.dylib, 5): image not found

This seemed rather weird to me, since the string "3.5" doesn't appear
anywhere in the ruby-llvm sources I have. I feel stuck.

Any ideas?

(And I'm still similarly struggling to figure out my include file
issue on debian.)

Perry
--
Perry E. Metzger pe...@piermont.com
Reply all
Reply to author
Forward
0 new messages