-
Notifications
You must be signed in to change notification settings - Fork 843
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
Stack supplied GHC links against wrong dylibs on OSX #1826
Comments
Stack installs GHC using the official binary distribution downloaded from https://www.haskell.org/ghc/download_ghc_7_10_3#macosx_x86_64, which won't have any extra knowledge about Homebrew-installed libraries. The DYLD_LIBRARY_PATH environment variable can be used tell the dynamic linker where to look for them, but unfortunately it is ignored by GHC on Mac OS 10.11 (El Capitan) without a workaround. |
I had the same problem and solved it by passing an extra-lib-dirs parameter to stack. I installed all my dependencies with MacPorts, so my libraries are in /opt/local/lib, I added the following to my ~/.stack/config.yaml :
I imagine that if you're installing llvm-general locally for your package you can also add the setting to your project.cabal file. |
@tinco i got the same problem and inspired by @samvher , i solve it adding an explicit absolute path to the
but this solution is hard coded and maybe will encounter the same issue when building the project in other place e.g. travis-ci etc. |
In OS X El Capitan, DYLD_LIBRARY_PATH doesn't get passed to GHC anymore due to System Integrity Protection. There's not a lot we can do about it, so I'm not sure if this issue can be addressed. Best to just add the extra-lib-dirs in your |
@borsboom excellent! thx for mention this way. |
When I build the package LLVM.General.AST with lts-5.4 on OSX I get the following error:
I have two versions installed:
The second one is the one we need, this is the one homebrew installed. Stack itself was installed with homebrew as well. LLVM 3.5 was also installed using homebrew. Since lts 5.4 (for me) stack is supplying its own ghc which I think is the root of the issue.
It could be a problem of homebrew or llvm.general as well of course, though I am suspecting stack might fix this by setting $LD_LIBRARY_PATH or something, I'm not really a homebrew expert.
The text was updated successfully, but these errors were encountered: