2015-06-30 55 views
3

嘗試編譯arch linux x86_64上的rgl。我只複製了安裝的錯誤部分。這是在我最近更新R之後發生的。任何想法如何解決這個問題?R編譯錯誤的RGL包

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 

回答

3

問題出在freetype2 2.6。降級到freetype2 2.5允許rgl正確編譯。

對於archlinux,您可以運行pacman -U /var/cache/pacman/pkg/freetype2-2.5.5-1-x86_64.pkg.tar.xz以降級到較舊的軟件包。

+0

如果你以前沒有安裝過freetype 2 2.5,那麼怎麼辦?乾杯。 – ogogmad

+1

我強迫使用pacman -Udd進行降級。仍然有相同的錯誤。 – ogogmad

0
  1. 從回購獲取二進制:

    sudo易於得到建立-DEP的r-cran-RGL

  • 從源代碼構建rgl之前安裝OpenGL。
  • +0

    呀是在編譯前安裝的OpenGL。該錯誤與freetype相關聯。另外,archlinux不使用apt來存儲庫。 – JJL

    +0

    用於archlinux的yaourt -S r-cran-rgl,但這只是從源代碼構建而不是使用二進制。此外,這是一個不合法的AUR包,意味着它已經過時。使用install.packages(「rgl」)比使用AUR編譯更好。無論哪種方式,錯誤保持不變。這個問題根本與OpenGL無關。 – JJL

    1

    Freetype是可選的。禁用它是最少麻煩的解決方案。

    install.packages( 「RGL」,回購= 「http://cran.r-project.org」,configure.args = 「 - 禁用-ftgl」)