stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.03k stars 264 forks source link

StanHeaders and Windows 3.6 #920

Closed mattfidler closed 3 years ago

mattfidler commented 3 years ago

Summary:

Compiling against StanHeaders on Windows R 3.6 doesn't seem to work, whereas they seem to work on every other platform;

I am getting the following error:

D:/a/_temp/Library/BH/include/boost/units/quantity.hpp:197:9: error: constexpr constructor does not have empty body

But only on the windows 3.6 platform:

https://github.com/nlmixrdevelopment/RxODE/runs/2047257766?check_suite_focus=true

```sh In file included from D:/a/_temp/Library/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:0, from D:/a/_temp/Library/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26, from D:/a/_temp/Library/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30, from D:/a/_temp/Library/BH/include/boost/numeric/odeint.hpp:25, from D:/a/_temp/Library/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17, from D:/a/_temp/Library/StanHeaders/include/stan/math/prim/arr.hpp:34, from D:/a/_temp/Library/StanHeaders/include/stan/math/prim/mat.hpp:336, from D:/a/_temp/Library/StanHeaders/include/stan/math/rev/mat.hpp:12, from D:/a/_temp/Library/StanHeaders/include/stan/math.hpp:4, from lincmtB.cpp:2: D:/a/_temp/Library/BH/include/boost/units/quantity.hpp: In constructor 'constexpr boost::units::quantity::quantity(const boost::units::quantity&, typename boost::disable_if::type, boost::units::detail::is_non_narrowing_conversion >, typename boost::units::detail::disable_if_is_same::type>::type*)': D:/a/_temp/Library/BH/include/boost/units/quantity.hpp:197:9: error: constexpr constructor does not have empty body } ^ In file included from D:/a/_temp/Library/BH/include/boost/numeric/odeint/util/unit_helper.hpp:23:0, from D:/a/_temp/Library/BH/include/boost/numeric/odeint/algebra/default_operations.hpp:26, from D:/a/_temp/Library/BH/include/boost/numeric/odeint/util/ublas_wrapper.hpp:30, from D:/a/_temp/Library/BH/include/boost/numeric/odeint.hpp:25, from D:/a/_temp/Library/StanHeaders/include/stan/math/prim/arr/functor/integrate_ode_rk45.hpp:17, from D:/a/_temp/Library/StanHeaders/include/stan/math/prim/arr.hpp:34, from D:/a/_temp/Library/StanHeaders/include/stan/math/prim/mat.hpp:336, from D:/a/_temp/Library/StanHeaders/include/stan/math/rev/mat.hpp:12, from D:/a/_temp/Library/StanHeaders/include/stan/math.hpp:4, from lincmtB.cpp:2: D:/a/_temp/Library/BH/include/boost/units/quantity.hpp: In constructor 'constexpr boost::units::quantity::quantity(const boost::units::quantity&, typename boost::enable_if::type, boost::units::detail::is_non_narrowing_conversion >, typename boost::units::detail::disable_if_is_same::type>::type*)': D:/a/_temp/Library/BH/include/boost/units/quantity.hpp:213:9: error: constexpr constructor does not have empty body } ^ make: *** [C:/R/etc/x64/Makeconf:215: lincmtB.o] Error 1 ```

I have the order of headers that are on the vignette:

https://github.com/nlmixrdevelopment/RxODE/blob/f753cea7767fee5edb15d91285d66b4bd3a8b7ed/src/lincmtB.cpp#L2-L5

And I have the windows 3.6 workaround you have:

https://github.com/nlmixrdevelopment/RxODE/blob/f753cea7767fee5edb15d91285d66b4bd3a8b7ed/.github/workflows/R-CMD-check.yaml#L137-L148

The makevars have the same flags (with the exception of RcppParallel since we use OpenMP and I'm unsure the implications of the crossover)

https://github.com/nlmixrdevelopment/RxODE/blob/master/src/Makevars.in

So I'm unsure what is going wrong with the compile. Is there something I can define to remove the units issue. I only use the automatic differentiation in the stan headers.

mattfidler commented 3 years ago

You need BHbelow 1.66.0-1 for R 3.6 to work. Not rstan's issue