Can't open `libgmp.so.10` when using `stack build`

367 views
Skip to first unread message

Noah G.

unread,
Apr 18, 2021, 2:40:30 AM4/18/21
to haskell-stack
Hi all,

I am trying to use Stack on Manjaro 21.0.1 Ornara. When I run stack build, I get an error message saying that libgmp.so.10 cannot be found:

appar > configure
appar > /home/noahsg/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.4: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory

This is quite bizarre, because I specifically installed GMP using Nix. And the location shows up when I run locate libgmp.so.10.

$ locate libgmp.so.10
/home/noahsg/.julia/artifacts/39b8e3dea0a701983a8ae84a2c567e1c4e555c7a/lib/libgmp.so.10
# Please ignore the fact that I have Julia installed; I love Haskell!
...
/nix/store/y0kbka0hid1h5a08a7p370c7i7zzn2dx-gmp-6.2.1/lib/libgmp.so.10
/nix/store/y0kbka0hid1h5a08a7p370c7i7zzn2dx-gmp-6.2.1/lib/libgmp.so.10.4.1
/usr/lib/libgmp.so.10
/usr/lib/libgmp.so.10.4.1
...

I have tried installing Stack using multiple package managers, including Nix (my first choice), Pacman, the generic install script, and Homebrew. I always seem to get this error when I run stack build.

I would appreciate any help you can provide.

Best wishes,
Noah G.

Michael Snoyman

unread,
Apr 19, 2021, 11:22:10 PM4/19/21
to haskel...@googlegroups.com
I have no experience with Manjaro, so I'm not sure exactly may be happening here. Perhaps setting LD_LIBRARY_PATH to the dir that contains the .so may help?
--
You received this message because you are subscribed to the Google Groups "haskell-stack" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haskell-stac...@googlegroups.com.

Noah G.

unread,
Apr 23, 2021, 12:31:31 AM4/23/21
to haskel...@googlegroups.com
Thank you for the suggestion! I did try adding /usr/lib to LD_LIBRARY_PATH. I now get a different error:

 $ stack build
*** stack smashing detected ***: terminated
Aborted (core dumped)


Not sure what that means. Google says it has something to do with GCC.

Manjaro is a distribution based on Arch, but geared more towards beginners… if that helps.
You received this message because you are subscribed to a topic in the Google Groups "haskell-stack" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/haskell-stack/jGU-zpvw3NE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to haskell-stac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/haskell-stack/29d6b2ad-4c72-40a6-8f3c-a145b186a16a%40www.fastmail.com.

--
Noah G.
ProvocaTeach
+1 (651) 314 9422

Noah G.

unread,
Apr 23, 2021, 1:03:51 AM4/23/21
to haskel...@googlegroups.com
Hey, never mind! I got it to work by using Nix, i.e. adding the following lines to my stack.yaml:

nix:
  enable: true
  packages: [pkgconfig zeromq zlib]


I will let you know if there are any other problems based on the dependencies.
Reply all
Reply to author
Forward
0 new messages