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

stack install cannot locate library at unconventional location. #4313

Closed
shengc opened this issue Sep 20, 2018 · 4 comments
Closed

stack install cannot locate library at unconventional location. #4313

shengc opened this issue Sep 20, 2018 · 4 comments

Comments

@shengc
Copy link

shengc commented Sep 20, 2018

Please follow the steps below for reporting a bug:

Make sure that you are using the latest release (currently stack-1.9.1).
See the upgrade instructions to upgrade.

shengc@ work $ stack upgrade
Current Stack version: 1.7.1, available download version: 1.7.1
Skipping binary upgrade, you are already running the most recent version

Please use the following schema for your bug report:

General summary/comments (optional)

I am trying to install JuicyPixels-3.2.9.5 using stack install, the process failed with can't load .so/.DLL for: libgmp.so. The nature of my working environment requires me to install linux libraries at unconventional location with linuxbrew. I did included both library path and include path where libgmp.so exists using --extra-lib-dirs and --extra-include-dirs, the error persisted anyway.

Steps to reproduce

PATH=~/.linuxbrew/bin:$PATH stack install JuicyPixels-3.2.9.5 --with-gcc ~/.linuxbrew/bin/gcc --extra-lib-dirs=~/.linuxbrew/lib --extra-include-dirs=~/.linuxbrew/include
shengc@ work $ ls ~/.linuxbrew/lib | grep libgmp
libgmp.a
libgmp.so
libgmp.so.10
libgmp.so.10.3.2
libgmpxx.a
libgmpxx.so
libgmpxx.so.4
libgmpxx.so.4.5.2

Output:

JuicyPixels-3.2.9.5: configure
JuicyPixels-3.2.9.5: build

--  While building custom Setup.hs for package JuicyPixels-3.2.9.5 using:
      /home/shengc/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/shengc/workspace/work/.stack-work/logs/JuicyPixels-3.2.9.5.log

    Configuring JuicyPixels-3.2.9.5...
    Preprocessing library for JuicyPixels-3.2.9.5..
    Building library for JuicyPixels-3.2.9.5..
    [ 1 of 30] Compiling Codec.Picture.InternalHelper ( src/Codec/Picture/InternalHelper.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/Codec/Picture/InternalHelper.o )
    [ 2 of 30] Compiling Codec.Picture.Metadata.Exif ( src/Codec/Picture/Metadata/Exif.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/Codec/Picture/Metadata/Exif.o )
    [ 3 of 30] Compiling Codec.Picture.Metadata ( src/Codec/Picture/Metadata.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/Codec/Picture/Metadata.o )
    [ 4 of 30] Compiling Codec.Picture.Tiff.Types ( src/Codec/Picture/Tiff/Types.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/Codec/Picture/Tiff/Types.o )
    [ 5 of 30] Compiling Codec.Picture.Tiff.Metadata ( src/Codec/Picture/Tiff/Metadata.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/Codec/Picture/Tiff/Metadata.o )
    [ 6 of 30] Compiling Codec.Picture.Types ( src/Codec/Picture/Types.hs, .stack-work/dist/x86_64-linux/Cabal-2.0.1.0/build/Codec/Picture/Types.o )
    <command line>: can't load .so/.DLL for: libgmp.so (libgmp.so: cannot open shared object file: No such file or directory)

Stack version

Version 1.7.1, Git revision 681c800 (5807 commits) x86_64 hpack-0.28.2

@dbaynard
Copy link
Contributor

Hi @shengc,

Would you please paste your stack.yaml file and the output of the same command you ran but with the -v flag?

@shengc
Copy link
Author

shengc commented Sep 23, 2018

@dbaynard
Thanks a lot for your response. I was trying to build this project: https://github.com/bravit/hid-examples

It is obvious that stack insisted looking for the that lib in /lib64, and given the fact there is libgmp.so.10 but not libgmp.so in the same directory, it crapped out. Problem is I don't have the root privilege, otherwise I could just create a symlink there. My question is, since I do have a local installation of libgmp.so at $HOME/.linuxbrew/lib, is it possible to let stack pick up that dependency directly from there ?

@dbaynard
Copy link
Contributor

It should be. It would be really helpful to see the logs from the attempted installation.

@snoyberg
Copy link
Contributor

snoyberg commented Apr 2, 2019

This should be addressed by #4651. Closing as fixed, if there is still a problem, please comment.

@snoyberg snoyberg closed this as completed Apr 2, 2019
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

3 participants