We made our first block Hooray!! For every stake pool operator it’s a happy and maybe a bit of a nerve wrecking …
A problem I discoverd after compiling the
cardano-node for the first time is that the node would simply would not start.
After some searching I learn there was no SMP support in GHC compiler that comes with the riscv64 version of Unbuntu 21.04 or 21.10.
There is a quick check if you can do to check if you can build a working
cardano-node with the following steps.
You create a file named
main.hs with the content below.
import Control.Concurrent main = do setNumCapabilities 8 putStrLn "Done"
Then compile and run it by running:
ghc -threaded main.hs ./main
If you see the message
main: setNumCapabilities: not supported on this platform the GHC compiler has no SMP support.
Luckily I found patches for the missing SMP support with OpenSUSE
- Download the GHC 8.10.7 sources from the haskell website.
- Download the patches
- Run the commands below
xz -d ghc-8.10.7-src.tar.xz tar xvf ghc-8.10.7-src.tar cd ghc-8.10.7/ tar xvf ../ghc-8.10.7-riscv-patches.tgz patch -p 1 < Disable-unboxed-arrays.patch patch -p 1 < riscv.patch patch -p 1 < libatomic.patch patch -p 1 < riscv-tntc.patch patch -p 1 < riscv-llvm-extend.patch mkdir $HOME/.local CLANG=/usr/bin/clang ./configure --prefix=$HOME/.local make make install
Now we can compile the and run the executable again.
export PATH=$HOME/.local/bin:$PATH ghc -threaded main.hs ./main
You should only see the output
Done if it all worked.
Next thing is to actually build the
cardano-node by mostly following the instructions on coincashew after building cabal 126.96.36.199 by yourself.