{"action":"created","issue":{"url":"https://api.github.com/repos/stan-dev/pystan/issues/272","repository_url":"https://api.github.com/repos/stan-dev/pystan","labels_url":"https://api.github.com/repos/stan-dev/pystan/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/stan-dev/pystan/issues/272/comments","events_url":"https://api.github.com/repos/stan-dev/pystan/issues/272/events","html_url":"https://github.com/stan-dev/pystan/issues/272","id":189870655,"number":272,"title":"Cannot compile any models with Cython 0.25","user":{"login":"ariddell","id":19950,"avatar_url":"https://avatars.githubusercontent.com/u/19950?v=3","gravatar_id":"","url":"https://api.github.com/users/ariddell","html_url":"https://github.com/ariddell","followers_url":"https://api.github.com/users/ariddell/followers","following_url":"https://api.github.com/users/ariddell/following{/other_user}","gists_url":"https://api.github.com/users/ariddell/gists{/gist_id}","starred_url":"https://api.github.com/users/ariddell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariddell/subscriptions","organizations_url":"https://api.github.com/users/ariddell/orgs","repos_url":"https://api.github.com/users/ariddell/repos","events_url":"https://api.github.com/users/ariddell/events{/privacy}","received_events_url":"https://api.github.com/users/ariddell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-11-16T22:37:45Z","updated_at":"2016-12-27T20:53:20Z","closed_at":null,"body":"#### Summary:\r\nPlease provide a short couple sentence summary.\r\n\r\nCannot compile simple models with new Cython 0.25\r\n\r\n#### Description:\r\nDescribe the issue as clearly as possible.\r\n\r\n#### Reproducible Steps:\r\n\r\n```\r\nimport pystan\r\nmodel_code = 'parameters {real y;} model {y ~ normal(0,1);}'\r\nmodel = pystan.StanModel(model_code=model_code, model_name=\"normal1\", verbose=True, obfuscate_model_name=False)\r\n```\r\n\r\ndoes not compile.\r\n\r\nError log attached. First error:\r\n[error-cython-new.txt](https://github.com/stan-dev/pystan/files/596085/error-cython-new.txt)\r\n\r\n```\r\n/home/aspen/.virtualenvs/py35/lib/python3.5/site-packages/pystan/stan/src/stan/model/util.hpp: In function ‘double stan::model::log_prob_grad(const M&, Eigen::VectorXd&, Eigen::VectorXd&, std::ostream*)’:\r\n/home/aspen/.virtualenvs/py35/lib/python3.5/site-packages/pystan/stan/src/stan/model/util.hpp:186:58: error: cannot convert ‘stan::math::var’ to ‘stan::math::vari*’ for argument ‘1’ to ‘void stan::math::grad(stan::math::vari*)’\r\n         stan::math::grad(adLogProb, ad_params_r, gradient);\r\n```\r\n\r\nThe error looks similar to the one just reported in #271 -- but this has nothing to do with cov_exp_quad."},"comment":{"url":"https://api.github.com/repos/stan-dev/pystan/issues/comments/269381228","html_url":"https://github.com/stan-dev/pystan/issues/272#issuecomment-269381228","issue_url":"https://api.github.com/repos/stan-dev/pystan/issues/272","id":269381228,"user":{"login":"Auerilas","id":9372234,"avatar_url":"https://avatars.githubusercontent.com/u/9372234?v=3","gravatar_id":"","url":"https://api.github.com/users/Auerilas","html_url":"https://github.com/Auerilas","followers_url":"https://api.github.com/users/Auerilas/followers","following_url":"https://api.github.com/users/Auerilas/following{/other_user}","gists_url":"https://api.github.com/users/Auerilas/gists{/gist_id}","starred_url":"https://api.github.com/users/Auerilas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Auerilas/subscriptions","organizations_url":"https://api.github.com/users/Auerilas/orgs","repos_url":"https://api.github.com/users/Auerilas/repos","events_url":"https://api.github.com/users/Auerilas/events{/privacy}","received_events_url":"https://api.github.com/users/Auerilas/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T20:53:20Z","updated_at":"2016-12-27T20:53:20Z","body":"Not sure if this is still an issue. I accidentally upgraded to Cython 0.25.2 and the models now compile and work.\r\n\r\n```\r\npython -m cython --version\r\nCython version 0.25.2\r\n\r\ng++ --version\r\ng++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609\r\nCopyright (C) 2015 Free Software Foundation, Inc.\r\nThis is free software; see the source for copying conditions.  There is NO\r\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r\n\r\nipython\r\n[1] import pystan\r\n[2] model_code = 'parameters {real y;} model {y ~ normal(0,1);}'\r\n[3] model = pystan.StanModel(model_code=model_code, model_name=\"normal1\", verbose=True, obfuscate_model_name=False)\r\n\r\nINFO:pystan:COMPILING THE C++ CODE FOR MODEL normal1 NOW.\r\nINFO:pystan:OS: linux, Python: 3.5.2 |Anaconda custom (64-bit)| (default, Jul  2 2016, 17:53:06) \r\n[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)], Cython 0.25.2\r\nCompiling /tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.pyx because it changed.\r\n[1/1] Cythonizing /tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.pyx\r\nbuilding 'stanfit4normal1_3452312573636794117' extension\r\ncreating /tmp/tmpj8zfb4r_/tmp\r\ncreating /tmp/tmpj8zfb4r_/tmp/tmpj8zfb4r_\r\ngcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I/tmp/tm$\r\nj8zfb4r_ -I/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan -I/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/src -I/home/auerilas/anac$\r\nnda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0 -I/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/eigen_\r\n3.2.9 -I/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0 -I/home/auerilas/anaconda3/lib/python3.5/site-package\r\ns/pystan/stan/lib/stan_math_2.12.0/lib/cvodes_2.8.2/include -I/home/auerilas/anaconda3/lib/python3.5/site-packages/numpy/core/include -I/home/auerilas/anaconda3/inc\r\nlude/python3.5m -c /tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp -o /tmp/tmpj8zfb4r_/tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.o -O2 -ftemplate\r\n-depth-256 -Wno-unused-function -Wno-uninitialized\r\ncc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++\r\nIn file included from /home/auerilas/anaconda3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarraytypes.h:1777:0,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,\r\nfrom /home/auerilas/anaconda3/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h:4,\r\n                 from /tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp:505:\r\n/home/auerilas/anaconda3/lib/python3.5/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning \"Using deprecated NumPy API, disable \r\nit by \" \"#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\r\n #warning \"Using deprecated NumPy API, disable it by \" \\\r\n  ^\r\nIn file included from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/multi_array/base.hpp:28:0,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/multi_array.hpp:21,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/numeric/odeint/util/multi_array_a\r\ndaption.hpp:29,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/numeric/odeint.hpp:61,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:13,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/stan/math/prim/arr.hpp:36,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/stan/math/prim/mat.hpp:235,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/stan/math/mix/mat.hpp:12,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/src/stan/model/util.hpp:5,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan_fit.hpp:18,\r\n                 from /tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp:509:\r\n/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/multi_array/concept_checks.hpp: In static member functi\r\non ‘static void boost::multi_array_concepts::detail::idgen_helper<N>::call(Array&, const IdxGen&, Call_Type)’:\r\n/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/multi_array/concept_checks.hpp:42:43: warning: typedef \r\n‘index_range’ locally defined but not used [-Wunused-local-typedefs]\r\n       typedef typename Array::index_range index_range;\r\n                                           ^\r\n/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/multi_array/concept_checks.hpp:43:37: warning: typedef ‘index’ locally defined but not used [-Wunused-local-typedefs]\r\n       typedef typename Array::index index;\r\n                                     ^\r\n/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/multi_array/concept_checks.hpp: In static member funct$on ‘static void boost::multi_array_concepts::detail::idgen_helper<0ul>::call(Array&, const IdxGen&, Call_Type)’:\r\n/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/multi_array/concept_checks.hpp:53:43: warning: typedef ‘index_range’ locally defined but not used [-Wunused-local-typedefs]\r\n       typedef typename Array::index_range index_range;\r\n                                           ^\r\n/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/lib/boost_1.60.0/boost/multi_array/concept_checks.hpp:54:37: warning: typedef ‘index’ locally defined but not used [-Wunused-local-typedefs]\r\n       typedef typename Array::index index;\r\n                                     ^\r\n/tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp: In function ‘PyObject* __pyx_pf_35stanfit4normal1_3452312573636794117_2_call_sampler(PyObject*, PyObject*$ PyObject*, PyObject*)’:\r\n/tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp:8776:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\r\n     __pyx_t_12 = ((__pyx_t_9 != __pyx_v_fitptr->param_names_oi().size()) != 0);\r\n/tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp: In function ‘std::vector<long unsigned int> __pyx_convert_vector_from_py_size_t(PyObject*)’:\r\n/tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp:20681:77: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\r\n     __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_item); if (unlikely(__pyx_t_5 == -1L && PyErr_O\r\n                                                                             ^\r\n/tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp:688:43: note: in definition of macro ‘unlikely’\r\n   #define unlikely(x) __builtin_expect(!!(x), 0)\r\n                                           ^\r\n/tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp: In function ‘std::vector<unsigned int> __pyx_convert_vector_from_py_unsigned_int(PyObject*)’:\r\n/tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp:21263:83: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]\r\n     __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_v_item); if (unlikely(__pyx_t_5 == -1 && Py\r\n                                                                                   ^\r\n/tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp:688:43: note: in definition of macro ‘unlikely’\r\n   #define unlikely(x) __builtin_expect(!!(x), 0)\r\n                                           ^\r\nIn file included from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/stan/math/rev/core/operator_unary_plus.hpp:7:0,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/stan/math/rev/core.hpp:34,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/stan/math/mix/mat.hpp:8,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/src/stan/model/util.hpp:5,\r\n                 from /home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan_fit.hpp:18,\r\n                 from /tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpp:509:\r\n/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/stan/math/prim/scal/fun/constants.hpp: At global scope:\r\n/home/auerilas/anaconda3/lib/python3.5/site-packages/pystan/stan/lib/stan_math_2.12.0/stan/math/prim/scal/fun/constants.hpp:65:18: warning: ‘stan::math::NEGATIVE_EP\r\nSILON’ defined but not used [-Wunused-variable]\r\n     const double NEGATIVE_EPSILON\r\n                  ^\r\ng++ -pthread -shared -L/home/auerilas/anaconda3/lib -Wl,-rpath=/home/auerilas/anaconda3/lib,--no-as-needed /tmp/tmpj8zfb4r_/tmp/tmpj8zfb4r_/stanfit4normal1_34523125\r\n73636794117.o -L/home/auerilas/anaconda3/lib -lpython3.5m -o /tmp/tmpj8zfb4r_/stanfit4normal1_3452312573636794117.cpython-35m-x86_64-linux-gnu.so\r\n\r\n\r\n[4] model\r\n<pystan.model.StanModel at 0x7fe3a607d2b0>\r\n```\r\nSeems to work fine, much to my relief when I realize I might've just broken it again."}}
{"actor":{"display_login":"Auerilas"}}