简体   繁体   English

用于R编译错误的RGL包

[英]RGL package for R compile error

Attempting to compile rgl for r on arch linux x86_64. 试图在arch linux x86_64上为r编译rgl。 I copied just the error portion of the installation. 我只复制了安装的错误部分。 This has occurred after I recently updated R. Any idea how to solve this? 这是在我最近更新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

The issue is with freetype2 2.6. 问题在于freetype2 2.6。 Downgrading to freetype2 2.5 allows rgl to compile properly. 降级到freetype2 2.5允许rgl正确编译。

For archlinux you can just run pacman -U /var/cache/pacman/pkg/freetype2-2.5.5-1-x86_64.pkg.tar.xz to downgrade to the older package. 对于archlinux,您只需运行pacman -U /var/cache/pacman/pkg/freetype2-2.5.5-1-x86_64.pkg.tar.xz即可降级到旧版程序包。

Freetype is optional. Freetype是可选的。 Disabling it is the least hassles solution. 禁用它是最麻烦的解决方案。

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

对于那些libfreetype6-dev我的人,我通过安装libfreetype6-dev在ubuntu上解决了这个问题

  1. Get the binary from the repos: 从repos获取二进制文件:

    sudo apt-get build-dep r-cran-rgl sudo apt-get build-dep r-cran-rgl

or 要么

  1. Install OpenGL before building rgl from source. 在从源构建rgl之前安装OpenGL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM