I’m trying to install cmdstan (via cmdstanpy). I have two nearly identical systems. One one system, it worked fine (using install_cmdstan from the cmdstanpy package). On the other system, I get the error:
(base) lemoinelab2@lemoinelab2:~$ install_cmdstan
Installing CmdStan version: 2.25.0
Install directory: /home/lemoinelab2/.cmdstan
Downloading CmdStan version 2.25.0
Download successful, file: /tmp/tmpb9iingl6
Unpacked download as cmdstan-2.25.0
Building version cmdstan-2.25.0
Command "make build" failed
stan/lib/stan_math/make/libraries:115: *** "Need to set TBB_CXX_TYPE for non-standard compiler other than gcc or clang.". Stop.
deleting tmpfiles dir: /tmp/tmp25rk2x8l
I saw other posts on how to resolve this, but I didn’t understand the solution (and I also don’t understand the error, given that the two systems are nearly identical). Can anyone help me figure this out?
I’m using g++ and gcc version 9.3.0. I don’t know if this is relevant. On my system where install worked, I had to install g++ (sudo apt install g++). I tried that on this second system and I’m getting the error above.
I’m following the other post: Building cmdstan 2.20 with mpi enabled on Linux
I tried creating a file make/local and then adding:
But that didn’t work, I got
bash: mpicxx: command not found
So I edited the local file:
and made it most of the way through the build process until:
g++ -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/lemoinelab2/miniconda3/include -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes -Wno-delete-non-virtual-dtor -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.7 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -fPIC -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/lemoinelab2/miniconda3/include -DBOOST_DISABLE_ASSERTS -DSTAN_MPI -c -o stan/lib/stan_math/stan/math/prim/functor/mpi_cluster_inst.o stan/lib/stan_math/stan/math/prim/functor/mpi_cluster_inst.cpp
In file included from stan/lib/stan_math/lib/boost_1.72.0/boost/mpi/allocator.hpp:15,
stan/lib/stan_math/lib/boost_1.72.0/boost/mpi/config.hpp:20:10: fatal error: mpi.h: No such file or directory
20 | #include <mpi.h>
: recipe for target ‘stan/lib/stan_math/stan/math/prim/functor/mpi_cluster_inst.o’ failed
make: *** [stan/lib/stan_math/stan/math/prim/functor/mpi_cluster_inst.o] Error 1
Do you want to use MPI with your cmdstan or are you trying these out because those encountered a similar error?
If you do not want to use MPI then just put
in make/local, wihtout the first line (STAN_MPI). Then run make clean and make build again.
Well what is MPI? I guess I’m confused because I had two very similar systems, where the build worked on one and not the other and I’m trying to figure the difference.
If you do not know what MPI is, then you did not meant to use it. Just place the latter two linea in make/local and it should work. As for why it does not worknon this system, there is probably some subtle difference I would guess.
Are all of them the same OS?
There are three systems: two Linux Mint 20 and one Linux Mint 19. It worked fine on one LM20 machine, and I got this error on an LM20 and LM19 machine, so it wasn’t related to the OS. To make matters even more confusing, I did a conda update all on the two non-working machines. I then rebooted them. On the LM20 machine, CmdStan installed just fine (the error disappeared). On the LM19 machine, the error persisted and I had to use your fix.
Scratching my head on this one.
The logic in cmdstan works basically this way:
- detect OS with “uname -s”
- if that is “Linux” and the CXX make variable has a “default” we then set CXX = g++ and the rest of the stuff falls in place.
If OS detection would fail that would trigger a different warning, so I am guessing make was set up differently?
Does make --version return the same version?
yea it does. I posted this issue on the github repo for cmdstan and apparently there is a fix for this coming in the next version or so.