I’m trying to install PyStan on a raspberry pi 3b+ and it’s obviously struggling to manage the compilation of all the stan libraries. I can successfully compile using distcc from the pi to my macbook and I’d like to do the same for the stan compilation to enable pystan.
I can see there are instructions for using a custom compiler; to export CC, CXX, and include anaconda on path. In may case it would be miniconda, though in any case I am not using miniconda so I have passed on this step.
I wonder if this is something that anyone has experience with? I’m also not sure if there’s a smarter way to achieve the initial installation as I’d like to pursue this path so that I can handoff compilation for models using the same distcc environment later also.
I can export as instructed, then I can immediately compile a hello world program using the $CC and or $CXX compiler as I wish, though when I run
sudo pip3 install pystan -vvv I can see the files copy into place and then something like…
Make sure that Python modules winreg, win32api or win32con are installed. C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC creating build/temp.linux-armv7l-3.6 creating build/temp.linux-armv7l-3.6/pystan creating build/temp.linux-armv7l-3.6/pystan/stan creating build/temp.linux-armv7l-3.6/pystan/stan/src creating build/temp.linux-armv7l-3.6/pystan/stan/src/stan creating build/temp.linux-armv7l-3.6/pystan/stan/src/stan/lang creating build/temp.linux-armv7l-3.6/pystan/stan/src/stan/lang/grammars compile options: '-DBOOST_DISABLE_ASSERTS -DBOOST_NO_DECLTYPE -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_RESULT_OF_USE_TR1 -DFUSION_MAX_VECTOR_SIZE=12 -I./pystan -Ipystan/stan/src -Ipystan/stan/lib/stan_math/ -Ipystan/stan/lib/stan_math/lib/eigen_3.3.3 -Ipystan/stan/lib/stan_math/lib/boost_1.69.0 -Ipystan/stan/lib/stan_math/lib/sundials_4.1.0/include -I/usr/local/include/python3.6m -c' extra options: '-Os -ftemplate-depth-256 -Wno-unused-function -Wno-uninitialized -std=c++1y' gcc: pystan/stan/src/stan/lang/ast_def.cpp gcc: pystan/stan/src/stan/lang/grammars/bare_type_grammar_inst.cpp gcc: pystan/_api.cpp gcc: pystan/stan/src/stan/lang/grammars/block_var_decls_grammar_inst.cpp cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
It picks up the /usr/lib/… compiler which I have taken off the path, so I’mm assuming it launches in another process/environment and picks up default path. So at this stage before affecting change in default paths just to test I thought I’d see if anyone has been down this… path … before?
Update: <this turned out to be a dead end, distutil don't support a gcc option> I can control the compiler with the distutil.cfg tip found [here](https://stackoverflow.com/questions/3297254/how-to-use-mingws-gcc-compiler-when-installing-python-package-using-pip). Though I'm now investigating how to resolve the compiler inspection which I assume is occuring to give; ``` error: don't know how to compile C/C++ code on platform 'posix' with '/usr/lib/distcc/gcc' compiler ``` The referenced /usr/lib/distcc/gcc is a symlink to the distcc command so I expect this is whats going on.
I’ll update when I know more, but if someone can see a ray of light for me I’m very happy to hear of it!