macOS Big Sur 11.4 Compiling Error for PyStan

Hi, I’m trying to run a simple Stan model to back out the mean and standard deviation out of a toy example (following Stan’s Youtube video on intro to pystan) but I am having some issues with the compiler and couldn’t find any work arounds.

I tried the suggestions on here but to no avail or change in the error message.

Any help is much appreciated.

# generate some fake data 
mu = 0.42
tau = 0.1

np.random.seed(42)
X = np.random.normal(mu, tau, 1000)

stan_model = pystan.StanModel(file = 'base_gaussian.stan', verbose = True)

With the following output:

Compiling /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/stanfit4anon_model_874424a682788de829ec2b0dc8209b26_2970466036662672368.pyx because it changed.
[1/1] Cythonizing /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/stanfit4anon_model_874424a682788de829ec2b0dc8209b26_2970466036662672368.pyx
building ‘stanfit4anon_model_874424a682788de829ec2b0dc8209b26_2970466036662672368’ extension
creating /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/var
creating /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/var/folders
creating /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/var/folders/_q
creating /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/var/folders/_q/07k1y14x087brt3tmd2bs1740000gn
creating /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T
creating /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol
x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map={SRC_DIR}=/usr/local/src/conda/{PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/alinmorariu/opt/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/alinmorariu/opt/anaconda3/include -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/alinmorariu/opt/anaconda3/include -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I/var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol -I/Users/alinmorariu/opt/anaconda3/lib/python3.8/site-packages/pystan -I/Users/alinmorariu/opt/anaconda3/lib/python3.8/site-packages/pystan/stan/src -I/Users/alinmorariu/opt/anaconda3/lib/python3.8/site-packages/pystan/stan/lib/stan_math -I/Users/alinmorariu/opt/anaconda3/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/eigen_3.3.3 -I/Users/alinmorariu/opt/anaconda3/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0 -I/Users/alinmorariu/opt/anaconda3/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/sundials_4.1.0/include -I/Users/alinmorariu/opt/anaconda3/lib/python3.8/site-packages/numpy/core/include -I/Users/alinmorariu/opt/anaconda3/include/python3.8 -c /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/stanfit4anon_model_874424a682788de829ec2b0dc8209b26_2970466036662672368.cpp -o /var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/var/folders/_q/07k1y14x087brt3tmd2bs1740000gn/T/pystan_83vdb7ol/stanfit4anon_model_874424a682788de829ec2b0dc8209b26_2970466036662672368.o -O2 -ftemplate-depth-256 -Wno-unused-function -Wno-uninitialized -std=c++1y

  • Operating System: MacOS 11.4
  • Python Version: 3.8.8
  • PyStan Version: 2.19.1
1 Like

Sorry, can’t help directly (not a Mac user), but I believe @ahartikainen has seen a bunch of those problems so hopefully can help.

Hi, did you run that code in notebook? Can you try check the terminal for C++ output?