R 编译错误的 RGL 包

标签 r rgl

尝试在 arch linux x86_64 上为 r 编译 rgl。我只复制了安装的错误部分。这发生在我最近更新 R 之后。知道如何解决这个问题吗?

g++ -I/usr/include/R/ -DNDEBUG -DHAVE_PNG_H -I/usr/include/libpng16 -DHAVE_FREETYPE -Iext/ftgl -I/usr/include/freetype2 -Iext -D_FORTIFY_SOURCE=2   -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -fvisibility=hidden -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4  -c init.cpp -o init.o
In file included from /usr/include/freetype2/freetype.h:33:0,
             from ext/ftgl/FTGL/ftgl.h:33,
             from glgui.h:12,
             from gui.h:10,
             from rglview.h:11,
             from Device.h:11,
             from DeviceManager.h:9,
             from init.cpp:6:
init.cpp: In function ‘SEXPREC* rgl::rgl_init(SEXP, SEXP, SEXP)’:
/usr/include/freetype2/config/ftconfig.h:369:26: error: expected primary-expression before ‘__typeof__’
 #define TYPEOF( type )  (__typeof__ (type))
                      ^
init.cpp:58:13: note: in expansion of macro ‘TYPEOF’
   else if ( TYPEOF(initValue) == EXTPTRSXP ) {
         ^
/usr/include/freetype2/config/ftconfig.h:369:26: error: expected ‘)’ before ‘__typeof__’
 #define TYPEOF( type )  (__typeof__ (type))
                      ^
init.cpp:58:13: note: in expansion of macro ‘TYPEOF’
   else if ( TYPEOF(initValue) == EXTPTRSXP ) {
         ^
init.cpp:61:3: error: expected ‘)’ before ‘else’
   else if ( !isNull(initValue) )
   ^
/usr/lib64/R/etc/Makeconf:143: recipe for target 'init.o' failed
make: *** [init.o] Error 1
ERROR: compilation failed for package ‘rgl’
* removing ‘/home/user/R/x86_64-unknown-linux-gnu-library/3.2/rgl’
Warning in install.packages :
  installation of package ‘rgl’ had non-zero exit status

最佳答案

自由类型是可选的。禁用它是最省事的解决方案。

install.packages("rgl", repo="http://cran.r-project.org", configure.args="--disable-ftgl")

关于R 编译错误的 RGL 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31146582/

相关文章:

r - 如何使 RGL 中的平面变厚?

在 R Studio 中运行多个 R 脚本

r - 3d 模型图(3d 散点图 + 模型表面 + 连接点到表面)

r - 如何在 Ubuntu 9.10 上安装 R 包 rgl?

r - 如何有效地将多个 rgl 图连接成一个图?

r - Rcpp中的排序排列,即base::order()

R ValueError : Error when checking input: expected simple_rnn_input to have 3 dimensions, 但得到形状为 (1661, 3) 的数组

r - 从列表列表制作数据框,但每个元素都是一列

r - R 3.5 中的 data.table 包未安装

带有movi3ed的RGL视频