s-u / Cairo

R graphics device using cairo graphics library for creating high-quality output
12 stars 10 forks source link

Installation error #13

Closed migueldvb closed 8 years ago

migueldvb commented 9 years ago

I am getting the error below when I install the Cairo package:

cairogd.c: In function ‘ptr_to_raw’:
cairogd.c:490:18: error: expected expression before ‘!=’ token
  if (TYPEOF(ptr) != EXTPTRSXP)
                  ^
cairogd.c: In function ‘raw_to_ptr’:
cairogd.c:508:18: error: expected expression before ‘!=’ token
  if (TYPEOF(ptr) != EXTPTRSXP)
                  ^
cairogd.c:510:18: error: expected expression before ‘!=’ token
  if (TYPEOF(raw) != RAWSXP)
                  ^
/usr/lib64/R/etc/Makeconf:134: recipe for target 'cairogd.o' failed
make: *** [cairogd.o] Error 1
ERROR: compilation failed for package ‘Cairo’
* removing ‘/home/miguel/R/x86_64-unknown-linux-gnu-library/3.2/Cairo’

The gcc compiler version is 5.1.0

PapaNappa commented 9 years ago

I have the same issue. Turns out this is due to freetype2 2.6: https://savannah.nongnu.org/bugs/?45376

The fix is in master, but currently not released.

Edit: Using freetype2 from master (6ec0434ec), I could successfully install.packages("Cairo").

alliquot commented 8 years ago

PapaNappa, could you provide exactly the code you run to install it, please?

When I'm trying to install Cairo by devtools::install_github, I'm getting an error:

installing source package ‘Cairo’ ... \ libs gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c cairobem.c -o cairobem.o In file included from cairobem.c:5:0: backend.h:5:21: fatal error: cconfig.h: No such file or directory

include "cconfig.h"

                 ^

compilation terminated.

Thanks in advance!

s-u commented 8 years ago

install.packages("Cairo",,"http://rforge.net")

Do not use devtools, it doesn't create the correct tar ball and is unnecessary anyway.

FWIW: the work-around for the FT bug is now on CRAN.