andrjohns / QuickJSR

R interface for the QuickJS lightweight javascript engine
Other
18 stars 0 forks source link

Unable to compile v1.3.0 #65

Closed coproduct closed 4 months ago

coproduct commented 4 months ago

Hello, thank you for this project! I'm very new to R (currently reading McElreath's "Statistical Rethinking"), so hopefully this issue is legitimate and not caused by mistakes on my end. I get the following output when I try to install the package with install.packages("QuickJSR", repos = c("https://andrjohns.r-universe.dev", "https://cran.r-project.org")):

trying URL 'https://andrjohns.r-universe.dev/src/contrib/QuickJSR_1.3.0.9999.tar.gz'
Content type 'application/x-gzip' length 805886 bytes (786 KB)
==================================================
downloaded 786 KB

* installing *source* package ‘QuickJSR’ ...
** using staged installation
** libs
gcc -I"/usr/share/R/include" -DNDEBUG -I"../inst/include/" -I"../inst/include/quickjs" -D_GNU_SOURCE     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -funsigned-char -std=gnu11 -c libquickjs.c
ar -rs ../inst/lib//libquickjs.a libquickjs.o
ar: creating ../inst/lib//libquickjs.a
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I"../inst/include/" -I"../inst/include/quickjs" -D_GNU_SOURCE     -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4A2Reg/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c quickjsr.cpp -o quickjsr.o
In file included from ../inst/include/cpp11.hpp:11,
                 from quickjsr.cpp:1:
../inst/include/cpp11/environment.hpp: In member function ‘bool cpp11::environment::exists(SEXP) const’:
../inst/include/cpp11/environment.hpp:51:17: error: ‘R_existsVarInFrame’ was not declared in this scope; did you mean ‘Rf_findVarInFrame’?
   51 |     return safe[R_existsVarInFrame](env_, name);
      |                 ^~~~~~~~~~~~~~~~~~
      |                 Rf_findVarInFrame
make: *** [/usr/lib/R/etc/Makeconf:177: quickjsr.o] Error 1
ERROR: compilation failed for package ‘QuickJSR’

However, I was able to install v1.2.2 with no problems using remotes (install_version("QuickJSR", version="1.2.2")). I'm on Ubuntu 22.04 with GCC 11.4.0, if that helps.

andrjohns commented 4 months ago

What version of R do you have installed?

andrjohns commented 4 months ago

Ah reproduced and found the issue, it should be fixed now. Thanks for reporting!

coproduct commented 4 months ago

Thank you!

zboraon commented 4 months ago

Same applies here, cannot install 1.3.0

andrjohns commented 4 months ago

Same applies here, cannot install 1.3.0

You can install from Github or R-Universe via the instructions in the README, I'll be submitting an update to CRAN in the next few days