rstudio / shinytest2

https://rstudio.github.io/shinytest2/
Other
106 stars 18 forks source link

Compilation error during install #321

Open dlcotter opened 1 year ago

dlcotter commented 1 year ago

I am using the following command to install shinytest2:

R -e "install.packages(c('shinytest2'), repos='https://cran.rstudio.com')"

And I am getting the errors:

code.cpp:34:5: error: ‘cpp11::doubles_matrix’ {aka ‘cpp11::matrix<cpp11::r_vector<double>, double>’} is not a template
   34 |     cpp11::doubles_matrix<by_column> diff_matrix,
      |     ^~~~~
code.cpp:34:27: error: ‘by_column’ was not declared in this scope
   34 |     cpp11::doubles_matrix<by_column> diff_matrix,
      |                           ^~~~~~~~~
code.cpp: In function ‘double image_diff_convolution_max_value(cpp11::doubles_matrix, int)’:
code.cpp:47:3: error: ‘cpp11::writable::doubles_matrix’ {aka ‘cpp11::matrix<cpp11::writable::r_vector<double>, cpp11::writable::r_vector<double>::proxy>’} is not a template
   47 |   cpp11::writable::doubles_matrix<by_column>
      |   ^~~~~
code.cpp:47:35: error: ‘by_column’ was not declared in this scope
   47 |   cpp11::writable::doubles_matrix<by_column>
      |                                   ^~~~~~~~~
make: *** [/usr/lib/R/etc/Makeconf:181: code.o] Error 1
ERROR: compilation failed for package ‘shinytest2’

I notice in src/code.cpp the directive #include <cpp11.hpp>; however, there is no such file in the src directory (or in the whole repository). Could this be the issue?

Thanks, Daniel Cotter

schloerke commented 1 year ago

Can you install the latest {cpp11} and see if it fixes the issue?

If so, I'll add a min version to {cpp11}.

dlcotter commented 1 year ago

How do I do that? I have the cpp package, version 4:10.2.1-1, installed via apt, which lists cpp-10 as a dependency; and there doesn't appear to be a cpp-11 package available to install or a cpp that depends on cpp-11.