18 | import Data.Monoid (mappend)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/bin/ld.gold: error: cannot find -lgmp
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
cabal: Failed to build Diff-0.4.0 (which is required by
test:cardano-cli-golden from cardano-cli-1.33.0).
  • What versions of ghc and cabal are you using? Have you run cabal update ? How much RAM does your machine have? Commented Feb 27, 2022 at 1:05
  • I am facing the same problem and am stuck. [nix-shell:~/cardano-src/cardano-node]$ cat /home/wims/.cabal/logs/ghc-8.10.7/dependent-sum- Configuring library for dependent-sum- Preprocessing library for dependent-sum- Building library for dependent-sum- [1 of 1] Compiling Data.Dependent.Sum ( src/Data/Dependent/Sum.hs, dist/build/Data/Dependent/Sum.o, dist/build/Data/Dependent/Sum.dyn_o ) /nix/store/f0rrfmf8kh5bsiql5bbq7m4h3xgihpnx-binutils-2.38/bin/ld.gold: error: cannot find -lgmp collect2: e Commented Aug 14, 2022 at 20:33
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
    – RdLrT
    Commented Aug 15, 2022 at 5:58

1 Answer 1


Found the same issue when executing : cabal build cardano-node cardano-cli

following steps in https://developers.cardano.org/docs/get-started/installing-cardano-node/

I'm using Ubuntu on Virtual box with 2GB RAM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.