prosseek
prosseek

Reputation: 191049

Using ruby-llvm on Mac OS X 10.11

I found that ruby-llvm uses llvm 3.5 (https://rubygems.org/gems/ruby-llvm/versions/3.5.0), so I tried to use llvm-ruby/llvm 3.5.

I installed LLVM with brew install llvm35 --shared, and checked llvm is working correctly, and libraries are installed. Then, I installed ruby-llvm with gem install ruby-llvm.

However, when I tried with a sample program in (https://github.com/ruby-llvm/ruby-llvm), I got errors that llvm library is not found when I have it /usr/local/Cellar/llvm35/3.5.1/lib/llvm-3.5/lib/libLLVM-3.5.dylib

dlopen(libLLVM-3.5.so.1, 5): image not found. (LoadError)
Could not open library 'libLLVM-3.5.so.1.dylib': dlopen(libLLVM-3.5.so.1.dylib, 5): image not found.
Could not open library 'LLVM-3.5': dlopen(LLVM-3.5, 5): image not found.
Could not open library 'libLLVM-3.5.dylib': dlopen(libLLVM-3.5.dylib, 5): image not found
    from /Users/smcho/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ffi-1.9.10/lib/ffi/library.rb:100:in `map'
    from /Users/smcho/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ffi-1.9.10/lib/ffi/library.rb:100:in `ffi_lib'
    from /Users/smcho/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ruby-llvm-3.5.0/lib/llvm/core_ffi.rb:7:in `<module:C>'
    from /Users/smcho/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ruby-llvm-3.5.0/lib/llvm/core_ffi.rb:5:in `<top (required)>'
    from /Users/smcho/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/smcho/.rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'

What might be wrong? I set export LD_LIBRARY_PATH=/usr/local/Cellar/llvm35/3.5.1/lib, but I still have the same error.

Upvotes: 2

Views: 212

Answers (0)

Related Questions