r-rust / gifski

R wrapper for the 'gifski' Rust Cargo crate.
Other
73 stars 4 forks source link

Unable to install gifski #3

Closed tcash21 closed 6 years ago

tcash21 commented 6 years ago

This is ultimately so I can install gganimate but having issues with installing. Found one post recommending install r-development but wondering if there's another workaround. Included my sessionInfo() at the bottom.

 install.packages('gifski')
Package which is only available in source form, and may need compilation of C/C++/Fortran:
  ‘gifski’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘gifski’

trying URL 'https://cran.rstudio.com/src/contrib/gifski_0.8.3.tar.gz'
Content type 'application/x-gzip' length 11652 bytes (11 KB)
==================================================
downloaded 11 KB

Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018c.1.0/zoneinfo/America/New_York'
* installing *source* package ‘gifski’ ...
** package ‘gifski’ successfully unpacked and MD5 sums checked
Using /Users/tanyacashorali/.cargo/bin/cargo (cargo 1.28.0 (96a2c7d16 2018-07-13))
** libs
rm -Rf gifski.so myrustlib/target/release/libmyrustlib.a wrapper.o myrustlib/target
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include   -pthread -fPIC  -Wall -mtune=core2 -g -O2  -c wrapper.c -o wrapper.o
wrapper.c:65:14: error: unknown type name 'R_CallMethodDef'
static const R_CallMethodDef CallEntries[] = {
             ^
wrapper.c:66:21: error: use of undeclared identifier 'DL_FUNC'
  {"R_png_to_gif", (DL_FUNC) &R_png_to_gif, 7},
                    ^
wrapper.c:70:20: error: unknown type name 'DllInfo'
void R_init_gifski(DllInfo *dll) {
                   ^
wrapper.c:71:3: warning: implicit declaration of function 'R_registerRoutines' is invalid in C99 [-Wimplicit-function-declaration]
  R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
  ^
wrapper.c:72:3: warning: implicit declaration of function 'R_useDynamicSymbols' is invalid in C99 [-Wimplicit-function-declaration]
  R_useDynamicSymbols(dll, FALSE);
  ^
2 warnings and 3 errors generated.
make: *** [wrapper.o] Error 1
ERROR: compilation failed for package ‘gifski’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/gifski’
Warning in install.packages :
  installation of package ‘gifski’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/n3/gz151gvn2xn3xzh5t6nkp3qm0000gn/T/RtmpyhOsMa/downloaded_packages’
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.13.1 (unknown)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] httr_1.2.1      R6_2.2.2        tools_3.3.1     withr_2.1.1     curl_2.3        memoise_1.1.0  
 [7] knitr_1.15.1    git2r_0.19.0    digest_0.6.15   devtools_1.13.3
jeroen commented 6 years ago

Can you try upgrading R to the latest version?

tcash21 commented 6 years ago

Yep that did it, thanks!

XavierPrudent commented 6 years ago

Hello, I need to stay with R 3.3.3, how can I then compile gifsky? I get the exact same error.