stack setup fails with libgmp in non-standard location

20 views
Skip to first unread message

Stephan Schiffels

unread,
Mar 28, 2017, 6:03:04 PM3/28/17
to haskell-stack
Hi, I am trying to install a package and so far fail in the "stack setup" step. Here is the error:

$ stack setup
The GHC located at /home/ss839/.stack/programs/x86_64-linux/ghc-gmp4-8.0.1/bin/ghc failed to compile a sanity check. Please see:


for more information. Exception was:
Running /home/ss839/.stack/programs/x86_64-linux/ghc-gmp4-8.0.1/bin/ghc /tmp/stack-sanity-check30968/Main.hs -no-user-package-db in directory /tmp/stack-sanity-check30968/ exited with ExitFailure 1

[1 of 1] Compiling Main             ( /tmp/stack-sanity-check30968/Main.hs, /tmp/stack-sanity-check30968/Main.o )
Linking /tmp/stack-sanity-check30968/Main ...

/usr/bin/ld: cannot find -lgmp
collect2: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)


The problem is that libgmp is in a non-standard location: /opt/gmp-6.1.1/lib. I know how I can point "stack build" to that location, using --extra-lib-dirs. But there doesn't seem to be such an option for stack setup, is there?

Any help is much appreciated, thanks!

Stephan
Reply all
Reply to author
Forward
Message has been deleted
0 new messages