Cabal Failed to build cardano-crypto-class-2.0.0 when building Cardano Node

Hi there,

I’m having the following error after executing the command cabal build all :

cabal: Failed to build cardano-crypto-class-2.0.0 (which is required by
cardano-ledger-shelley-ma-test-0.1.0.0, test:cardano-api-test from
cardano-api-1.27.0 and others). The failure occurred during the configure
step.

I’m following Cardano’s Stake Pool Course on setting up a Cardano Node.

I’m running on an AWS Instance, with Linux.

Best Regards.

José Araújo

Hello, so, you’ve already installed libsodium, and you are using tag 1.27.0 ? What happens when you run cabal configure --with-compiler=ghc-8.10.4 ?

Hi Raph.

thanks for reply.

on the first try I did everything ok but the console crashed before finishing the build.

In the second and third, I was too confident, I didn’t do the commands

export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

And I ignored the error in the cabal configure --with-compiler=ghc-8.10.4

now it’s ok

many thanks

Best Regards

José Araújo

Ok then, glad you found the solution :+1:

Please help me.
Starting cardano-crypto-class-2.0.0 (lib)
Building cardano-crypto-class-2.0.0 (lib)

Failed to build cardano-crypto-class-2.0.0.
Build log (
/home/bluesky/.cabal/logs/ghc-8.10.4/cardano-crypto-class-2.0.0-0d2eb9f272e87e63 5f122b73579c6aba33ca7520fc719baebe5d42e298708f8b.log
):
Configuring library for cardano-crypto-class-2.0.0…
Preprocessing library for cardano-crypto-class-2.0.0…
compiling dist/build/Cardano/Crypto/Libsodium/Constants_hsc_make.c failed (exit code 1)
rsp file was: “dist/build/Cardano/Crypto/Libsodium/hsc2hscall6620-0.rsp”
command was: /usr/bin/gcc -c dist/build/Cardano/Crypto/Libsodium/Constants_hsc_m ake.c -o dist/build/Cardano/Crypto/Libsodium/Constants_hsc_make.o -fuse-ld=gold -D__GLASGOW_HASKELL__=810 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_ OS=1 -Dx86_64_HOST_ARCH=1 -I/usr/local/include -I/usr/local/include -Idist/build /autogen -Idist/build/global-autogen -include dist/build/autogen/cabal_macros.h -I/home/bluesky/.cabal/store/ghc-8.10.4/vector-0.12.3.0-cca7c995fc6c42d181a4cbf3 90413b490bb68cf9cedcd654462583ccb8094aee/lib//include -I/home/bluesky/.ghcup/ghc /8.10.4/lib/ghc-8.10.4/unix-2.7.2.2/include -I/home/bluesky/.ghcup/ghc/8.10.4/li b/ghc-8.10.4/time-1.9.3/include -I/home/bluesky/.cabal/store/ghc-8.10.4/primitiv e-0.7.2.0-d2e83e23a08b7166c6c4a5abbaa5eee537ad2da1627b781da800f9c8e71cae15/lib// include -I/home/bluesky/.ghcup/ghc/8.10.4/lib/ghc-8.10.4/bytestring-0.10.12.0/in clude -I/home/bluesky/.ghcup/ghc/8.10.4/lib/ghc-8.10.4/base-4.14.1.0/include -I/ home/bluesky/.ghcup/ghc/8.10.4/lib/ghc-8.10.4/integer-gmp-1.0.3.0/include -I/hom e/bluesky/.ghcup/ghc/8.10.4/lib/ghc-8.10.4/include -I/home/bluesky/.ghcup/ghc/8. 10.4/lib/ghc-8.10.4/include/
error: In file included from Constants.hsc:15:
/usr/local/include/sodium.h:50:10: fatal error: sodium/crypto_vrf.h: No such fil e or directory
50 | #include “sodium/crypto_vrf.h”
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

cabal: Failed to build cardano-crypto-class-2.0.0 (which is required by
exe:create-smart-contract from jpg-store-bulk-purchase-1.0.0.0). See the build
log above for details.