ruby-install
ruby-install copied to clipboard
rbx 2.3 fails to build on Yosemite due to llvm config error
As originally reported by @willcosgrove on https://github.com/postmodern/ruby-install/issues/181
~/src/rubinius-2.3.0/configure.log:
[2014-11-04 15:33:58] Configuring Rubinius...
[2014-11-04 15:33:58] Command line: "--prefix=/Users/swrobel/.rubies/rbx-2.3.0 --with-opt-dir=/usr/local/opt/openssl:/usr/local/opt/readline:/usr/local/opt/libyaml:/usr/local/opt/gdbm"
[2014-11-04 15:33:58] Checking gcc:
[2014-11-04 15:33:58] found
[2014-11-04 15:33:58] Checking g++:
[2014-11-04 15:33:58] found
[2014-11-04 15:33:58] Checking bison:
[2014-11-04 15:33:58] found
[2014-11-04 15:33:58] ---
Detected old configuration settings, forcing a clean build
---
[2014-11-04 15:33:59] Checking for 'llvm-config':
[2014-11-04 15:33:59] not found
[2014-11-04 15:33:59]*** ERROR ABORT: unable to set up LLVM
One solution is to do ...
brew install llvm
ruby-install rbx 2.3.0 -i ~/.rubies/rbx -- --llvm-config /usr/local/opt/llvm/bin/llvm-config
We should pass --llvm-config /usr/local/opt/llvm/bin/llvm-config to configure. Let me know if you want a patch.
Uh, who is this @spastorino guy?
hehe, you answer later than me and just with clues bro. Give people the whole solution :P.
So, just to understand correctly, rbx < 2.3 installs without requiring llvm from homebrew, but rbx >= 2.3 requires llvm from homebrew?
@swrobel yes, that's basically correct. Rubinius 2.3.0+ requires LLVM to be installed. On OS X, that is usually simplest from Homebrew.
For some historical context, Rubinius pre-2.3.0 would either try to use a pre-built LLVM or build LLVM from source. This was a solution we created many years ago before Unix was invented and started spreading LLVM to the world (only slightly kidding). Now that LLVM is much more widely available, we want to focus effort on helping package LLVM instead of maintaining our own cache of custom LLVM builds.
Thanks for the context, @brixen. I realize I'm now turning this ruby-install issue into a rubinius issue, but since you're here, I was able to proceed using @spastorino's instructions, but installation failed at a later point:
1: LD vm/vm
ld: warning: directory not found for option '-L/usr/local/opt/openssl/lib64'
ld: warning: directory not found for option '-L/usr/local/opt/readline/lib64'
ld: warning: directory not found for option '-L/usr/local/opt/libyaml/lib64'
ld: warning: directory not found for option '-L/usr/local/opt/gdbm/lib64'
ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
mkdir -p runtime
GEN runtime/platform.conf
GEN runtime/signature
mkdir -p runtime/bootstrap
RBC kernel/bootstrap/basic_object.rb
dyld: lazy symbol binding failed: Symbol not found: _rb_enc_dummy_p
Referenced from: /Users/swrobel/src/rubinius-2.3.0/vendor/bundle/gems/rubinius-melbourne-2.2.2.0/lib/rubinius/melbourne/melbourne.bundle
Expected in: flat namespace
dyld: Symbol not found: _rb_enc_dummy_p
Referenced from: /Users/swrobel/src/rubinius-2.3.0/vendor/bundle/gems/rubinius-melbourne-2.2.2.0/lib/rubinius/melbourne/melbourne.bundle
Expected in: flat namespace
/usr/local/bin/../share/ruby-install/rbx/functions.sh: line 58: 43497 Trace/BPT trap: 5 bundle exec rake build
!!! Compiling rbx 2.3.0 failed!
UPDATE: rm -rf ~/src/rubinius-2.3.0/ and re-running seemed to get past installing rubinius-melbourne but fail at a later point:
Building native extensions. This could take a while...
Installed rubysl-zlib (2.0.1)
>>> Installing rubinius 2.3.0 ...
Your configuration is outdated, please run ./configure first
!!! Installation of rbx 2.3.0 failed!
@swrobel are you able to compile rbx-2.3.0 manually or does it only fail to build under ruby-install?
@postmodern @brixen no, I was not able to build rbx-2.3.0 manually. Here's my output: https://gist.github.com/swrobel/d97017ebc36caf5d1650
@swrobel @spastorino why isn't llvm-config symlinked into /usr/local/bin? Ideally, homebrew should symlink all binaries.
Seems like it isn't auto-linked because it's already included w/ OS X and doesn't want to stomp that.
$ brew link llvm
Warning: llvm is keg-only and must be linked with --force
I had success with
brew install llvm
brew link llvm --force
rvm install rbx-2.3.0
@tastycode does brew link llvm --force also fix the issue with ruby-install (not to be confused with rvm install).
I built successfully with
brew install llvm
brew link llvm --force
ruby-install rbx 2.4.0
Same issue on current OSX. Any progress? Ideally I would like to use the system LLVM, instead of brew link force.
In case it's helpful to see, here's brew output that warns against linking:
...
This formula is keg-only, which means it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/llvm/lib
CPPFLAGS: -I/usr/local/opt/llvm/include
Installed pretty easily and cleanly (no brew link) with:
$ brew install llvm
$ PATH="$(brew --prefix llvm)/bin:$PATH" ./configure
# ...
For MacPorts:
$ sudo port install llvm-3.5 llvm_select libyaml
$ sudo port select llvm mp-llvm-3.5
$ bundle
$ ./configure --with-opt-dir /opt/local ...
The rbx tests pass for 2.3.0 9d61df5d and 2.4.1.n350 7da4c6d4 with a few ld warnings:
ld: warning: directory not found for option '-L/opt/local/lib64'
ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
I created a pull request for the configure script that I believe will solve this. Can you all take a look and provide feedback? Thanks, Joel
https://github.com/rubinius/rubinius/pull/3247
@SixArm :+1: for trying to fix this as close as possible to the root. The root being homebrew, imho.
brew install llvm rvm install rbx -- --llvm-config /usr/local/opt/llvm/bin/llvm-config
With @taf2 suggestion:
brew install llvm
rvm install rbx -- --llvm-config /usr/local/opt/llvm/bin/llvm-config
I like this solution, because it avoids linking the brew version of LLVM into my system. However, i'm now very puzzled by the following error message after i ran bundle to install my gems and started my Rails (4.2) application:
dyld: lazy symbol binding failed: Symbol not found: _capi_get_constant
Referenced from: ~/.rvm/gems/rbx-2.5.2@global/gems/json-1.8.2/lib/json/ext/parser.bundle
Expected in: flat namespace
dyld: Symbol not found: _capi_get_constant
Referenced from: ~/.rvm/gems/rbx-2.5.2@global/gems/json-1.8.2/lib/json/ext/parser.bundle
Expected in: flat namespace
[1] 60885 trace trap rails s
Any similar experience with a clean workaround please?
Note:
ruby --version
rubinius 2.5.2 (2.1.0 7a5b05b1 2015-01-30 3.5.1 JI) [x86_64-darwin14.1.0]
rbx (~> 2.5) needs an older LLVM (~> 3.5) then is installed by latest xcode or brew. Check the system LLVM is okay or you have an older brew installed version with ls /usr/local/Cellar/llvm.
brew upgrade ruby-install --HEAD
ruby-install rbx -- --llvm-config=/usr/local/Cellar/llvm/3.5.1/bin/llvm-config
Good luck.
Got it to compile and install using:
brew install homebrew/versions/llvm35
brew upgrade ruby-install --HEAD
ruby-install rbx -- --llvm-config=/usr/local/lib/llvm-3.5/bin/llvm-config
Got rbx-3.27 to work on El Capitan with the following:
brew install homebrew/versions/llvm35
rvm install rbx-3.27 -- --llvm-config /usr/local/opt/llvm35/bin/llvm-config-3.5
I would assume this should work for other versions of Rubinius / OSX as well.
What Works
This now seems to work on macOS Sierra when using the latest versions of both Rubinius and the most recent LLVM package from Homebrew (currently 3.9.0). For example:
brew install llvm
ruby-install --latest rbx
What Doesn't
Without using the the latest versions, you get the prior behavior of:
Checking clang++: found
Detected old configuration settings, forcing a clean build
Checking for 'llvm-config': executing "/usr/local/Cellar/llvm/3.9.0/bin/llvm-config" failed
ABORT: unable to set up LLVM
Running 'configure' failed. Please check configure.log for more details.
!!! Configuration of rbx 3.67 failed!
Recent versions of Rubinius no longer seem to have this issue.
Rubinius support was removed due to inactivity (see #435). Closing this.