# Issue Compiling Cardano Node and CLI

**URL:** <https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274>\
**Category:** Setup a Stake Pool\
**Created:** [10 April 2024 01:23 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274 "2024-04-10T01:23:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivid](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vivid/32/56691_2.png) [@vivid](https://forum.cardano.org/u/vivid)\
**Post date:** [10 April 2024 01:23 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/1 "2024-04-10T01:23:01Z")

</div>

There doesn’t seem to be as many people monitoring IOG Technical Community Discord these days…So I’ll bring the question here in hopes of a fix.

Hey guys, I’m running into an issue with compiling.

Failed to build cardano-crypto-class-2.1.4.0. The failure occurred during the configure step. Build log ( /root/.cabal/logs/ghc-8.10.7/cardano-crypto-class-2.1.4.0-57ff6d5dac9e424486497c239c0282176e030208ae85190337ff0ffefa3a86af.log ): Configuring library for cardano-crypto-class-2.1.4.0… Error: cabal-3.8.1.0: Missing dependency on a foreign library:

- Missing (or bad) C library: blst

I’ve downloaded and installed the blst library as per the Coin Cashew guide. This is a new relay I am setting up.

Thanks in advance,  
Michael Phillips (Vivid)

---

<div class="post-metadata">

**Author:** ![Zyroxa](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/zyroxa/32/17790_2.png) [@Zyroxa](https://forum.cardano.org/u/Zyroxa)\
**Post date:** [10 April 2024 05:30 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/2 "2024-04-10T05:30:20Z")

</div>

In case you dont find the answer here aswell, you might want to ask here : [Telegram: Contact @CardanoStakePoolWorkgroup](https://t.me/CardanoStakePoolWorkgroup)

this is probably the most active channel for such questions.

---

<div class="post-metadata">

**Author:** ![vivid](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vivid/32/56691_2.png) [@vivid](https://forum.cardano.org/u/vivid)\
**Post date:** [11 April 2024 02:44 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/3 "2024-04-11T02:44:29Z")

</div>

Highly surprised. Used to have a response in 10 minutes with any of these routes. 24 hours later, nothing.

---

<div class="post-metadata">

**Author:** ![Terminada](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/terminada/32/80229_2.png) [@Terminada](https://forum.cardano.org/u/Terminada)\
**Post date:** [11 April 2024 07:25 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/4 "2024-04-11T07:25:36Z")

</div>

You are missing the blst library.

Follow the instructions at: [cardano-node-wiki/docs/getting-started/install.md at main · input-output-hk/cardano-node-wiki · GitHub](https://github.com/input-output-hk/cardano-node-wiki/blob/main/docs/getting-started/install.md)

Those IOG instructions explain how to build and install the IOG specified versions of sodium, secp256k1, and blst libraries before you build cardano-node.

Alternatively, if you are keen to build the dependent libraries and cardano-node into deb packages for easy install using your package manager onto any Debian/Ubuntu system without needing to customise you ld\_library\_path and binary path or needing to manually copy libraries and binaries around, then you can follow my instructions here: [GitHub - TerminadaPool/cardano-node-debian](https://github.com/TerminadaPool/cardano-node-debian)

I don’t know why everyone in Cardano land seems to prefer installing the entire build chain onto every machine they intend to run cardano-node, and to manually build everything on every relay machine. Or why they want to manually copy files around in an error prone way and remove/overwrite the old versions when they upgrade. Or why they want to customise their ld\_library\_path and bin path and install everything Cardano related in non-standard locations. Most people running Linux prefer to use a package manager for every other piece of software on their system. Anyway… Whatever.

---

<div class="post-metadata">

**Author:** ![vivid](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vivid/32/56691_2.png) [@vivid](https://forum.cardano.org/u/vivid)\
**Post date:** [11 April 2024 16:17 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/5 "2024-04-11T16:17:03Z")

</div>

I used CoinCashew’s guide, as usual, to install libsecp256k1 and blst. Which is why I find it weird that I’m having an issue. [Installing the Glasgow Haskell Compiler and Cabal | English | CoinCashew](https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node/part-i-installation/installing-ghc-and-cabal)

I’ll give your instructions a go and see what I come up with. Thanks.

---

<div class="post-metadata">

**Author:** ![vivid](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vivid/32/56691_2.png) [@vivid](https://forum.cardano.org/u/vivid)\
**Post date:** [11 April 2024 16:48 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/6 "2024-04-11T16:48:35Z")

</div>

Looks like I’m running into an issue with your instructions, as well.

```auto
make[1]: Entering directory '/home/builder/src/libblst-iog/libblst-iog-0.3.11'
echo "CFLAGS=-g -O2 -ffile-prefix-map=/home/builder/src/libblst-iog/libblst-iog-0.3.11=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fno-builtin -fPIC -Wextra -Werror"
CFLAGS=-g -O2 -ffile-prefix-map=/home/builder/src/libblst-iog/libblst-iog-0.3.11=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fno-builtin -fPIC -Wextra -Werror
./build.sh
+ cc -g -O2 -ffile-prefix-map=/home/builder/src/libblst-iog/libblst-iog-0.3.11=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fno-builtin -fPIC -Wextra -Werror -c ./src/server.c
clang: error: optimization flag '-ffat-lto-objects' is not supported [-Werror,-Wignored-optimization-argument]
clang: error: optimization flag '-ffat-lto-objects' is not supported [-Werror,-Wignored-optimization-argument]
make[1]: *** [debian/rules:16: override_dh_auto_build] Error 1
make[1]: Leaving directory '/home/builder/src/libblst-iog/libblst-iog-0.3.11'
make: *** [debian/rules:12: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -b failed

```

---

<div class="post-metadata">

**Author:** ![Terminada](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/terminada/32/80229_2.png) [@Terminada](https://forum.cardano.org/u/Terminada)\
**Post date:** [11 April 2024 22:53 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/7 "2024-04-11T22:53:02Z")

</div>

I have never seen that optimization flag is not supported error. Are you running an up to date Debian stable system?

```auto
lsb_release -a

```

> No LSB modules are available.  
> Distributor ID: Debian  
> Description: Debian GNU/Linux 12 (bookworm)  
> Release: 12  
> Codename: bookworm

This my /etc/apt/sources.list file:

> deb [Index of /debian](http://ftp.au.debian.org/debian/) bookworm main non-free-firmware  
> deb [Index of /debian-security](http://security.debian.org/debian-security) bookworm-security main non-free-firmware  
> deb [Index of /debian](http://ftp.au.debian.org/debian/) bookworm-updates main non-free-firmware

```auto
cc --version

```

> Debian clang version 14.0.6  
> Target: x86\_64-pc-linux-gnu  
> Thread model: posix  
> InstalledDir: /usr/bin

I just created a new Debian 12 (bookworm) kvm virtual machine with only the base install packages. Then I followed the instructions at: [GitHub - TerminadaPool/libblst-iog-debian](https://github.com/TerminadaPool/libblst-iog-debian)

The only error I see is the lintian error at the end (which doesn’t matter):

> E: libblst-iog: no-copyright-file

The libblst deb package is built properly:

```auto
sha256sum ../libblst-iog_0.3.11_amd64.deb

```

> ccd9e0dc6f202287c741603654466446a43ecc74bfe652fe831d6d0830647eb3 …/libblst-iog\_0.3.11\_amd64.deb

---

<div class="post-metadata">

**Author:** ![vivid](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vivid/32/56691_2.png) [@vivid](https://forum.cardano.org/u/vivid)\
**Post date:** [12 April 2024 00:06 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/8 "2024-04-12T00:06:37Z")

</div>

I’m running Ubuntu.

```auto
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy

```

```auto
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

```

---

<div class="post-metadata">

**Author:** ![jeremyisme](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/jeremyisme/32/54872_2.png) [@jeremyisme](https://forum.cardano.org/u/jeremyisme)\
**Post date:** [12 April 2024 00:22 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/9 "2024-04-12T00:22:00Z")

</div>

Did you install libssl.so.1.1 manually? 22.04 doesn’t include it

```auto
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

```

---

<div class="post-metadata">

**Author:** ![Terminada](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/terminada/32/80229_2.png) [@Terminada](https://forum.cardano.org/u/Terminada)\
**Post date:** [12 April 2024 07:59 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/10 "2024-04-12T07:59:35Z")

</div>

> [@vivid](#):
>
> ```auto
> Ubuntu clang version 14.0.0-1ubuntu1.1
> Target: x86_64-pc-linux-gnu
> Thread model: posix
> InstalledDir: /usr/bin
> 
> ```

That is a nuisance. The Ubuntu version of clang 14.0.0 doesn’t support one of the default flags configured automatically by the debian build system. You would think that Ubuntu would be very similar to Debian since it is based off it, but alas Debian stable has clang 14.0.6. clang/llvm is not necessary, it just seemed like a good idea because I think using it might produce slightly more optimised binaries.

OK. You inspired me to go install a Ubuntu virtual machine and work through my instructions step by step. My systems all run Debian stable. I haven’t ever used Ubuntu, so this is a learning experience for me. I followed these instructions for how to install a Ubuntu vm: [How to Install Ubuntu 22.04 Virtual Machine on KVM](https://www.wpdiaries.com/ubuntu-on-kvm/)

```auto
lsb_release -a

```

> No LSB modules are available.  
> Distributor ID: Ubuntu  
> Description: Ubuntu 22.04.4 LTS  
> Release: 22.04  
> Codename: jammy

I couldn’t be bothered to figure out how to disable just that one particular clang/llvm compiler option that debuild is setting somewhere, so I elected to simply not use clang/llvm at all and instead use the default gcc and g++ compilers. In other words, you can simply skip that step about installing clang/llvm, and if you have already done it, then you can revert the changes with:

```auto
sudo update-alternatives --remove-all cc; \
sudo update-alternatives --remove-all c++

```

Then uninstall (apt purge) clang/llvm if you like.

I followed my instructions for each dependency library (skipping the clang/llvm option):

- [GitHub - TerminadaPool/libblst-iog-debian](https://github.com/TerminadaPool/libblst-iog-debian)

> sha256sum libblst-iog\_0.3.11\_amd64.deb
> 
> 7fe0a72adc3730e50938bcd0d33b6d2c1cce5c65a5eb1e2202edea2fda082518 libblst-iog\_0.3.11\_amd64.deb

- [GitHub - TerminadaPool/libsodium-iog-debian](https://github.com/TerminadaPool/libsodium-iog-debian)

> sha256sum libsodium{23,-dev}-iog\_1.0.18\_amd64.deb
> 
> 32f04f8d2cdc820acaef827e42a165c532e34ac7ec280085247c6683c41b2d14 libsodium23-iog\_1.0.18\_amd64.deb  
> c3a03bfd420296d2b1291ac969537d99da9b35b8d8ed79219eef84387a332475 libsodium-dev-iog\_1.0.18\_amd64.deb

- [GitHub - TerminadaPool/libsecp256k1-iog-debian](https://github.com/TerminadaPool/libsecp256k1-iog-debian)

> sha256sum libsecp256k1-{2,dev}-iog\_0.3.2\_amd64.deb
> 
> 57ffde970b87ed157a74b814588baa382dd48e1cb52e1ee4a34145ab61f33a90 libsecp256k1-2-iog\_0.3.2\_amd64.deb  
> 6ff4d6cee6b154104dfa95a35dc30ef6f4e610ce8f9f3228d84bee35357a7e4d libsecp256k1-dev-iog\_0.3.2\_amd64.deb

Then I installed all the libraries as root:

```auto
sudo dpkg -i /home/builder/src/libblst-iog/libblst-iog_0.3.11_amd64.deb; \
sudo dpkg -i /home/builder/src/libsodium-iog/libsodium{23,-dev}-iog_1.0.18_amd64.deb; \
sudo dpkg -i /home/builder/src/libsecp256k1-iog/libsecp256k1-{2,dev}-iog_0.3.2_amd64.deb

```

Then I noted @jeremyisme 's advice about Ubuntu and libssl1.1, but I think this might be a newer security updated version of that library:

```auto
wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb; \
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.22_amd64.deb

```

Then I followed my instructions at [GitHub - TerminadaPool/cardano-node-debian](https://github.com/TerminadaPool/cardano-node-debian) (skipping the clang/llvm option).

> sha256sum cardano-{cli,node}\_8.9.1\_amd64.deb
> 
> 9382cd4f24a43c4ec1979322c5197f0bcf806f33220c61e0b2f18641231f3039 cardano-cli\_8.9.1\_amd64.deb  
> 12eff8cef25e8356bb7ae65845b5083a9677a8f6f535752f6c0fa004d606468b cardano-node\_8.9.1\_amd64.deb

Then I installed the cardano-node and cardano-cli packages:

```auto
sudo dpkg -i /home/builder/src/cardano-node/cardano-{cli,node}_8.9.1_amd64.deb; \

cardano-cli --version; \
cardano-node --version

```

> cardano-cli 8.20.3.0 - linux-x86\_64 - ghc-9.8  
> git rev da945ea983d4722a9ffe54250edba9a193a57cf0  
> cardano-node 8.9.1 - linux-x86\_64 - ghc-9.8  
> git rev da945ea983d4722a9ffe54250edba9a193a57cf0

I will add a note to my instructions for Ubuntu users to avoid using clang/llvm and also that they need to manually install libssl1.1

---

<div class="post-metadata">

**Author:** ![vivid](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vivid/32/56691_2.png) [@vivid](https://forum.cardano.org/u/vivid)\
**Post date:** [15 April 2024 18:04 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/11 "2024-04-15T18:04:53Z")

</div>

Now I run into the same blst issue. So confused by this. Followed your instructions exactly.

````auto
Failed to build cardano-crypto-class-2.1.4.0. The failure occurred during the
configure step.
Build log (
/root/.cabal/logs/ghc-9.8.2/cardano-crypto-class-2.1.4.0-5c91bbae7bcf6960f073cb2405cdd1870c70dedfdfc1bc5ad172429e1e9b8c06.log
):
Configuring library for cardano-crypto-class-2.1.4.0..
Error: cabal-3.10.2.1: Missing dependency on a foreign library:
* Missing (or bad) C library: blst
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

Error: cabal: Failed to build cardano-crypto-class-2.1.4.0 (which is required
by exe:cardano-node from cardano-node-8.9.1). See the build log above for
details.

make[1]: *** [debian/rules:57: override_dh_auto_build] Error 1
make[1]: Leaving directory '/root/src/cardano-node/cardano-node-8.9.1'
make: *** [debian/rules:12: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -b failed```
````

---

<div class="post-metadata">

**Author:** ![Terminada](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/terminada/32/80229_2.png) [@Terminada](https://forum.cardano.org/u/Terminada)\
**Post date:** [15 April 2024 21:32 UTC](https://forum.cardano.org/t/issue-compiling-cardano-node-and-cli/130274/12 "2024-04-15T21:32:37Z")

</div>

The error indicates that you are missing the blst library. Did you install the libblst-iog package that you built to your build machine?

You can check the contents of a deb package with this command:

```auto
dpkg -c ~/src/libblst-iog/libblst-iog_0.3.11_amd64.ded

```

> -rw-r–r-- root/root 23220 2024-03-28 16:53 ./usr/include/blst.h  
> -rw-r–r-- root/root 38831 2024-03-28 16:53 ./usr/include/blst.hpp  
> -rw-r–r-- root/root 4706 2024-03-28 16:53 ./usr/include/blst\_aux.h  
> …  
> -rw-r–r-- root/root 298102 2024-03-28 16:53 ./usr/lib/x86\_64-linux-gnu/libblst.a  
> drwxr-xr-x root/root 0 2024-03-28 16:53 ./usr/lib/x86\_64-linux-gnu/pkgconfig/  
> -rw-r–r-- root/root 273 2024-03-28 16:53 ./usr/lib/x86\_64-linux-gnu/pkgconfig/libblst.pc

Now check that those files are installed to your build machine:

```auto
ls -al /usr/include/blst.h; \
ls -al /usr/lib/x86_64-linux-gnu/libblst.a;

```

> -rw-r–r-- 1 root root 23220 Mar 28 16:53 /usr/include/blst.h  
> -rw-r–r-- 1 root root 298102 Mar 28 16:53 /usr/lib/x86\_64-linux-gnu/libblst.a

If you didn’t install the iog specified dependency libraries then ensure you followed this step:

> [@Terminada](#):
>
> Then I installed all the libraries as root:
> 
> ```auto
> sudo dpkg -i /home/builder/src/libblst-iog/libblst-iog_0.3.11_amd64.deb; \
> sudo dpkg -i /home/builder/src/libsodium-iog/libsodium{23,-dev}-iog_1.0.18_amd64.deb; \
> sudo dpkg -i /home/builder/src/libsecp256k1-iog/libsecp256k1-{2,dev}-iog_0.3.2_amd64.deb
> 
> ```
