Stan on ARM-architecture system


Has anybody tested if Stan works on ARM-architecture systems (say, Raspberry Pi with Linux, or Android phone)?



Raspberry pi is more or less a normal linux, so it should work.


On android you can use Termux + clang. I have a working pystan installed. Only thing is that I need to create models without obfuscation due to maximum path problem (android 5). On android 6 there is a fix for it.

Officially one can not get gcc+gfortran but there is an unofficial release that works (mostly) so in theory one could install R.

Edit. CmdStan works. Build failed probably due to memory error (-j4 / -j3). Without -jx build did run normally.

CmdStan build is crashing. I don’t know why.


Thank you! Great! I will proceed then with Raspberry Pi and report my experience.


We don’t currently compile wheels for arm64 (e.g., Raspberry Pi). If
there was a lot of interest in this we could figure out a way to do this.


A while ago I tried to compile PyStan on Raspberry Pi, but it was taking an eternity to finish (also had to extend the virtual memory size), so then I tried cross compiling on Docker, but it didn’t workout after a lot of attempts and I gave up. My guess is that, even if successful, it would run awfully slowly.


Running would depend on floating-point performance. Compilation will probably be very slow; it’s slow enough on a multicore i7.


Compiling 8 schools (/or any other model) on android phone (ZTE5) takes 8 minutes, sampling takes milliseconds).

But some pads/phones are nowdays quite fast due to 4k video stuff.

On raspberry pi the latest version (3) could have decent compilation times.

But it’s not always about the performance. Sometimes phone /raspberry pi is the only thing you got and you can still practice with it.