0

I am trying to compile plutus script on 'Intel(R) Xeon(R) CPU E5-2680 v2' machine. I initialized nix flake from input-output-hk/iogx haskell template (tried with ghc96 and ghc92), entered development environment with nix develop and tried to compile simple code like

integerOne :: CompiledCode Integer
integerOne = $$(compile [|| (1 :: Integer) ||])

Compilation fails with

Error: cabal: Failed to build hello-1.0.0.2. The build process terminated with exit code -4

And when I try to load the code to ghci, it reports

Illegal instruction (core dumped)

On my laptop it compiles successfully.

Looking at the coredump I discovered that the instruction was mulx from adx cpu feature. /proc/cpuinfo says that my laptop has that feature, but the server does not.

Except for compiling with PlutusTx.compile anything other from ghc seems to work on the server well.

The question is, is there any way to run this on my server? Any flag or fix to plutus-tx or ghc? Can anyone point me to the part of plutus-tx package (or the proper ghc?) that generates that instruction?

1

2 Answers 2

0

try this flake.nix, it uses the iogx as well with plutus-tx >= 1.21. The corresponding code builds on my lenovo p1 laptop with Xeon CPU. Although, I am not sure if it is the exact CPU as your specs.

1
  • Thank you for the reply. I tried your flake. I cloned the repo and tried to enter development environment. When nix built it, it dumped core while compiling plutus-script-utils so I believe the repo also has the same problem.
    – amakarov
    Commented Mar 25 at 16:44
0

The problem lies in the blst C library that is a dependency of cardano-crypto-class Haskell library. blst should be built with -D__BLST_PORTABLE__ flags as in iohk-nix.

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.