Error running cmdStan on IBM Power9 System

As the title suggests, I’m attempting to run cmdStan on an IBM Power9 system (called Bede) but am running into some errors when compiling models. I am using cmdStan version 2.23.0 and compiling with gcc version 8.4.0. cmdStan itself successfully compiles, but the error below is displayed when compiling the Stan model described here

make ../src/models/deaths_and_111_calls

--- Translating Stan model to C++ code ---
bin/stanc  --o=../src/models/deaths_and_111_calls.hpp ../src/models/deaths_and_111_calls.stan
/bin/bash: bin/stanc: cannot execute binary file
make: *** No rule to make target `../src/models/deaths_and_111_calls.hpp', needed by `../src/models/deaths_and_111_calls'.  Stop.

Another user described similar issues on ARM (see here). As suggested in the comments, I tried to build stanc3 by hand but the system that I am working on does not have Dune or Nix installed which seems to rule out compiling things by hand.

I wondered if anyone has experience running cmdStan on a Power9 system and previously overcome these issues? Are there any other ways to compile stanc3 by hand which don’t require Nix/Dune?

Thank you

1 Like

Is there x86 virtualization available on Power9, like there is for ARM?

You would run stanc3 with virtualization to generate the .hpp file and then compile for Power9 like usually.

@StaffanBetner has used this on ARM before we added the pre-built the ARM Linux binary for stanc3.

See Problem compiling models with cmdstan on arm64 - #4 by StaffanBetner and QEMU emulation of stanc3 on architectures without provided binaries · Issue #956 · stan-dev/cmdstan · GitHub

If this isnt available you could generate it using the stanc3.js. For that you would need node install on the Power9 machine.

2 Likes

Rok, thank you for the suggestions and pointers to other posts.

I’m not sure if virtualisation is available on Power9, will have to have a deeper look. node is not available on the Power9 system AFAIK.

A belated follow up for those interested/experiencing similar issues…

I was able to build Stanc3 on Power-9 after manually installing and configuring Opam on the system (thank you Emre@STFC Hartree).

Instructions:

  1. Download Opam Releases · ocaml/opam · GitHub
  2. Compile Opam (you may need to use make cold to compile without OCaml)
  3. Initialise Opam, ensuring to disable sandboxing (this prevents bubblewrap from being required)
  4. Build stanc!
2 Likes

A more detailed, step-by-step solution is available
2021_07_14_Stan_on_Bede.pdf (111.7 KB)

I’ve also raised this as an issue on Github, CmdStan on IBM Power-9 systems · Issue #1026 · stan-dev/cmdstan · GitHub.

1 Like