Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] - cardano-node failing to build on ppc64 (OpenPOWER) #6036

Open
camberkenpas opened this issue Nov 18, 2024 · 5 comments
Open

[BUG] - cardano-node failing to build on ppc64 (OpenPOWER) #6036

camberkenpas opened this issue Nov 18, 2024 · 5 comments
Labels
needs triage Issue / PR needs to be triaged.

Comments

@camberkenpas
Copy link

Internal/External
External

Area
Other Any other topic (Delegation, Ranking, ...).

Summary
cardano-node failing to build on ppc64:
: error:
loadArchive "/usr/local/lib/libblst.a": failed
[156 of 188] Compiling UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts ( untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/CekMachineCosts.hs, dist/build/UntypedPlutusCore/Evaluation/Machine/Cek/CekMachineCosts.o, dist/build/UntypedPlutusCore/Evaluation/Machine/Cek/CekMachineCosts.dyn_o )
[158 of 188] Compiling UntypedPlutusCore.Evaluation.Machine.Cek.StepCounter ( untyped-plutus-core/src/UntypedPlutusCore/Evaluation/Machine/Cek/StepCounter.hs, dist/build/UntypedPlutusCore/Evaluation/Machine/Cek/StepCounter.o, dist/build/UntypedPlutusCore/Evaluation/Machine/Cek/StepCounter.dyn_o )
[175 of 188] Compiling UntypedPlutusCore.Simplify.Opts ( untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs, dist/build/UntypedPlutusCore/Simplify/Opts.o, dist/build/UntypedPlutusCore/Simplify/Opts.dyn_o )
ghc-9.4.7: /usr/local/lib/libblst.a: RTS linker not implemented on PowerPC 64-bit

That's a portion of the error output where all the errors are complaining about libblst.a, but if the build were to go on longer, we could potentially see similar errors for other dependencies such as secp256k1 and libsodium I would assume.

Steps to reproduce
Followed the steps here
Everything works up until:
cabal build cardano-cli

Expected behavior
This should complete sucessfully:
cabal build cardano-cli

System info (please complete the following information):

  • OS Name: Ubuntu
  • OS Version: 24.04
  • Node version attempting to build 10.1.2
  • CLI version attempt to build 10.1.2
  • ghc version: 9.4.7

Additional context
Even in the latest GHC there is no dynamic linking in the Haskell interpreter for ppc64. This is a ghc/Haskell problem (including in the latest master) that could potentially be worked around on the Cardano side for better compatibility. Possibly by avoiding Template Haskell?

The same limitation in Haskell exists for s390 and RISC-V so likely we would see the same outcome on those. While s390 is probably not particularly common and ppc64 probably isn't too much better, RISC-V may start to see some more adoption.

This issue seems related:
#1484

@camberkenpas camberkenpas added the needs triage Issue / PR needs to be triaged. label Nov 18, 2024
@camberkenpas camberkenpas changed the title [BUG] - [BUG] - cardano-node failing to build on ppc64 (OpenPOWER) Nov 18, 2024
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

@angerman
Copy link
Contributor

angerman commented Dec 31, 2024

@camberkenpas what platform are you trying to compile for? I'm afraid I don't have access to a power machine. My last would have been a pre-Intel Mac, and that's long gone.

The real issue is

RTS linker not implemented on PowerPC 64-bit

Implementing a linker, while possible, is non-trivial. I've done this in the past but without actual power hardware and a clear idea of the target platform, this will be hard.

EDIT: I've implemented the aarch64 NCG and linker and mentored the implementation of the riscv64 NCG and linker. Avoiding TH isn't really feasible in any non-trivial Haskell program, I'm afraid. I wish we didn't have this nonsense, but realistically TH ends up being used somewhere in some dependency :-/ if you can let me know where I can get my hands on a good Power system, please do!

@camberkenpas
Copy link
Author

That sounds like a lot of work... But if you're seriously interested:

https://raptorcs.com/ might be able to provide access.

If not, or if that process took too much time to get something setup, I could absolutely provide a full-time virtual machine (running on real hardware in a data center).

Sorry for the slow replay, but I've been tied up with the holidays.

@angerman
Copy link
Contributor

I might take you up in in in Q2, depending how things shake out in Q1. Good to know there are high quality power machines. Not sure how they stack up compared to the current arm dominated machines, but hey why not. We've just added riscv :-)

@camberkenpas
Copy link
Author

Well, definitely keep me posted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue / PR needs to be triaged.
Projects
None yet
Development

No branches or pull requests

3 participants