R编译错误的RGL包

R编译错误的RGL包,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

正在尝试在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
  • 从repos获取二进制文件:

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

  • 在从源代码构建
    rgl
    之前安装OpenGL

  • 问题在于freetype2.6。降级到freetype2 2.5允许rgl正确编译


    对于archlinux,您只需运行pacman-U/var/cache/pacman/pkg/freetype2-2.5.5-1-x86_64.pkg.tar.xz即可降级到较旧的软件包。

    Freetype是可选的。禁用它是最简单的解决方案


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

    对于前来查看的其他人,我通过在ubuntu上安装
    libfreetype6 dev
    解决了这个问题。是的,OpenGL是在编译之前安装的。该错误与freetype关联。此外,archlinux没有将apt用于repositories.yaourt-S r-cran-rgl用于archlinux,但这只是从源代码而不是使用二进制文件构建它。而且,它是一个不属于AUR的软件包,意味着它已经过时了。使用install.packages(“rgl”)从R内部编译比使用AUR更好。无论哪种方式,错误都保持不变。这个问题根本与OpenGL无关。如果您以前没有安装freetype 2.5,该怎么办?干杯。我用pacman-Udd强制降级。仍然得到相同的错误。