ERROR cmdstanpy:model.py:549 Stan program failed to compile:
WARNING cmdstanpy:model.py:550
--- Translating Stan model to C++ code ---
bin/stanc --o=/Users/mitzi/github/stan-dev/cmdstanpy/test/data/complex_var.hpp /Users/mitzi/github/stan-dev/cmdstanpy/test/data/complex_var.stan
Syntax error in '/Users/mitzi/github/stan-dev/cmdstanpy/test/data/complex_var.stan', line 17, column 13 to column 20, parsing error:
-------------------------------------------------
15: int a = 1;
16: array[2,3,2] int ys = {{{3,0},{0,4}, {5,0}}, {{0,1}, {0,2}, {0,3}}};
17: array[2,3] complex zs = {{3,4i,5},{1i,2i,3i}};
^
18: complex z = 3 + 4i;
19:
-------------------------------------------------
Ill-formed phrase. Found L-value. This can be completed in many ways.
make: *** [make/program:47: /Users/mitzi/github/stan-dev/cmdstanpy/test/data/complex_var.hpp] Error 1
Command ['make', '/Users/mitzi/github/stan-dev/cmdstanpy/test/data/complex_var']
error during processing No such file or directory
================================================================================== short test summary info ==================================================================================
FAILED test/test_sample.py::CmdStanMCMCTest::test_complex_output - ValueError: Unable to compile Stan model file: /Users/mitzi/github/stan-dev/cmdstanpy/test/data/complex_var.stan.
transformed data {
array[10] int<lower=0,upper=1> y = {0,1,0,0,0,0,0,0,0,1};
}
parameters {
real<lower=0,upper=1> theta;
}
model {
theta ~ beta(1,1);
y ~ bernoulli(theta);
}
// model segment is just so that VB works
generated quantities {
int a = 1;
array[2,3,2] int ys = {{{3,0},{0,4}, {5,0}}, {{0,1}, {0,2}, {0,3}}};
array[2,3] complex zs = {{3,4i,5},{1i,2i,3i}};
complex z = 3 + 4i;
array[2] int imag = {3,4};
}
Environment:
MacOS 10.15.7 (Catalina)
stanc3 e101bce (Unix)
also fails for stanc3 distributed with 2.29.2
Current Behavior:
CmdStanPy test model fails to compile with error:
This test was added to CmdStanPy via PR https://github.com/stan-dev/cmdstanpy/pull/537
Expected Behavior:
Should compile
Model Code
Environment:
MacOS 10.15.7 (Catalina) stanc3 e101bce (Unix) also fails for stanc3 distributed with 2.29.2