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

crystal failed to compile on OSX(10.11 El Capitan) (version: 0.9.0) #1798

Closed
r3bo0t opened this issue Oct 21, 2015 · 10 comments
Closed

crystal failed to compile on OSX(10.11 El Capitan) (version: 0.9.0) #1798

r3bo0t opened this issue Oct 21, 2015 · 10 comments

Comments

@r3bo0t
Copy link

r3bo0t commented Oct 21, 2015

Recently got crystal upgraded via homebrew from 0.8.x to 0.9.0. Earlier everything was working fine, but suddenly with this upgrade, crystal started to fail to compile with error

crystal eval 'puts "Hello world!"'
ld: library not found for -levent
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `cc -o "/Users/konflikt/.crystal/crystal-run-eval.tmp" "${@}"  -rdynamic  -levent -lpcl -lpcre -lgc -lpthread -ldl`

All the required crystal dependencies are install

brew install \
  bdw-gc \
  gmp \
  libevent \
  libpcl \
  libxml2 \
  libyaml \
  llvm
Warning: bdw-gc-7.4.2 already installed
Warning: gmp-6.0.0a already installed
Warning: libevent-2.0.22 already installed
Warning: libpcl-1.12 already installed
Warning: libxml2-2.9.2 already installed
Warning: libyaml-0.1.6_1 already installed
Warning: llvm-3.6.2 already installed

Seems like an issue with current upgrade.
System: Mac OSX (10.11 El Capitan), Crystal: 0.9.0, LLVM: 3.6.2

@TBD
Copy link

TBD commented Oct 21, 2015

export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib"

this fixed for me, but if there are problems check http://stackoverflow.com/questions/3146274/is-it-ok-to-use-dyld-library-path-on-mac-os-x-and-whats-the-dynamic-library-s

@r3bo0t
Copy link
Author

r3bo0t commented Oct 21, 2015

@TBD yes, thanks.
This solve the issue for me too. But that should be handled internally. no?

@ysbaddaden
Copy link
Contributor

Not really, this is a homebrew configuration. It could be installed in /opt instead of /usr/local/lib for example.

@waj
Copy link
Member

waj commented Oct 21, 2015

I also had this problem after upgrading to 10.11 but I solved it reinstalling the command line tools: xcode-select --install and selecting as the default active toolchain: xcode-select --switch /Library/Developer/CommandLineTools

Seems like XCode doesn't look by default for libraries at /usr/local/lib anymore. My understanding is that Homebrew should at least warn about this when running brew doctor.

@asterite
Copy link
Member

@Conflikt I just upgraded to El Capitan, had the same issue, did what @waj suggested and I'm having everything working again. Can you confirm this fixed it for you too?

@squarism
Copy link

Same problem (levent not found despite having deps installed). Same situation (upgraded to 10.11). @waj fix worked for me. Thanks! 🍰 Normally I wouldn't comment on a closed issue but asterite was wondering if it worked for someone else.

andrewsuzuki added a commit to andrewsuzuki/crystal that referenced this issue Dec 14, 2015
A few users had a problem with crystal upon updating to 10.11 (including myself). (`ld: library not found for -levent`)

This comment by @waj solved it: crystal-lang#1798 (comment)
@r3bo0t
Copy link
Author

r3bo0t commented Jan 6, 2016

@asterite, I already mentioned the same thing worked for me too in my last comment conflikt commented on Oct 22, 2015. I guess you missed that 😃

@gottlike
Copy link

@asterite Maybe this should be mentioned in the Mac OS install docs. I was having the same problem and was lucky enough to find this Github issue..

@asterite
Copy link
Member

Yeah, it's just so frequent that I think it's worth it. Just did so: http://crystal-lang.org/docs/installation/on_mac_osx_using_homebrew.html

@gottlike
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants