Ubuntu 16.04上的R:rgl赢得';t安装正确

Ubuntu 16.04上的R:rgl赢得';t安装正确,r,rgl,R,Rgl,试图将rgl安装到R3.4.4、Ubuntu 16.04上,但效果不佳: Warning in install.packages : installation of package ‘rgl’ had non-zero exit status 我已经尝试了每一篇文章建议的每一个修复方法。没有任何改进 我是不是忽略了什么?有什么想法吗 版本信息: > version platform x86_64-pc-linux-gnu arch x

试图将rgl安装到R3.4.4、Ubuntu 16.04上,但效果不佳:

Warning in install.packages :
  installation of package ‘rgl’ had non-zero exit status
我已经尝试了每一篇文章建议的每一个修复方法。没有任何改进

我是不是忽略了什么?有什么想法吗

版本信息:

> version
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          3                           
minor          4.4                         
year           2018                        
month          03                          
day            15                          
svn rev        74408                       
language       R                           
version.string R version 3.4.4 (2018-03-15)
nickname       Someone to Lean On   
以下是完整的输出:

> install.packages("rgl")
Installing package into ‘/home/brandon/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rgl_0.99.16.tar.gz'
Content type 'application/x-gzip' length 3058794 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

* installing *source* package ‘rgl’ ...
** package ‘rgl’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ISO C89... (cached) none needed
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... libraries , headers 
checking GL/gl.h usability... yes
checking GL/gl.h presence... yes
checking for GL/gl.h... yes
checking GL/glu.h usability... yes
checking GL/glu.h presence... yes
checking for GL/glu.h... yes
checking for glEnd in -lGL... yes
checking for gluProject in -lGLU... yes
checking for pkg-config... yes
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
configure: using Freetype and FTGL
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++  -I/usr/share/R/include -DNDEBUG -DHAVE_PNG_H -I/usr/include/libpng12 -DHAVE_FREETYPE -Iext/ftgl  -Iext     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ABCLineSet.cpp -o ABCLineSet.o
g++  -I/usr/share/R/include -DNDEBUG -DHAVE_PNG_H -I/usr/include/libpng12 -DHAVE_FREETYPE -Iext/ftgl  -Iext     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c BBoxDeco.cpp -o BBoxDeco.o
In file included from glgui.h:12:0,
                 from BBoxDeco.cpp:4:
ext/ftgl/FTGL/ftgl.h:32:22: fatal error: ft2build.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'BBoxDeco.o' failed
make: *** [BBoxDeco.o] Error 1
ERROR: compilation failed for package ‘rgl’
* removing ‘/home/brandon/R/x86_64-pc-linux-gnu-library/3.4/rgl’
Warning in install.packages :
  installation of package ‘rgl’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpWrldzM/downloaded_packages’
> # Spinning 3D scatterplot
> # Install and load rgl package
> install.packages("rgl")
Installing package into ‘/home/brandon/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rgl_0.99.16.tar.gz'
Content type 'application/x-gzip' length 3058794 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

* installing *source* package ‘rgl’ ...
** package ‘rgl’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ISO C89... (cached) none needed
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... libraries , headers 
checking GL/gl.h usability... yes
checking GL/gl.h presence... yes
checking for GL/gl.h... yes
checking GL/glu.h usability... yes
checking GL/glu.h presence... yes
checking for GL/glu.h... yes
checking for glEnd in -lGL... yes
checking for gluProject in -lGLU... yes
checking for pkg-config... yes
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
configure: using Freetype and FTGL
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++  -I/usr/share/R/include -DNDEBUG -DHAVE_PNG_H -I/usr/include/libpng12 -DHAVE_FREETYPE -Iext/ftgl  -Iext     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ABCLineSet.cpp -o ABCLineSet.o
g++  -I/usr/share/R/include -DNDEBUG -DHAVE_PNG_H -I/usr/include/libpng12 -DHAVE_FREETYPE -Iext/ftgl  -Iext     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c BBoxDeco.cpp -o BBoxDeco.o
In file included from glgui.h:12:0,
                 from BBoxDeco.cpp:4:
ext/ftgl/FTGL/ftgl.h:32:22: fatal error: ft2build.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'BBoxDeco.o' failed
make: *** [BBoxDeco.o] Error 1
ERROR: compilation failed for package ‘rgl’
* removing ‘/home/brandon/R/x86_64-pc-linux-gnu-library/3.4/rgl’
Warning in install.packages :
  installation of package ‘rgl’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpWrldzM/downloaded_packages’
编辑:安装libftgl2后,我得到

install.packages("rgl")
Installing package into ‘/home/brandon/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rgl_0.99.16.tar.gz'
Content type 'application/x-gzip' length 3058794 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

* installing *source* package ‘rgl’ ...
** package ‘rgl’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ISO C89... (cached) none needed
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... libraries , headers 
checking GL/gl.h usability... yes
checking GL/gl.h presence... yes
checking for GL/gl.h... yes
checking GL/glu.h usability... yes
checking GL/glu.h presence... yes
checking for GL/glu.h... yes
checking for glEnd in -lGL... yes
checking for gluProject in -lGLU... yes
checking for pkg-config... yes
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
configure: using Freetype and FTGL
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++  -I/usr/share/R/include -DNDEBUG -DHAVE_PNG_H -I/usr/include/libpng12 -DHAVE_FREETYPE -Iext/ftgl  -Iext     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ABCLineSet.cpp -o ABCLineSet.o
g++  -I/usr/share/R/include -DNDEBUG -DHAVE_PNG_H -I/usr/include/libpng12 -DHAVE_FREETYPE -Iext/ftgl  -Iext     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c BBoxDeco.cpp -o BBoxDeco.o
In file included from glgui.h:12:0,
                 from BBoxDeco.cpp:4:
ext/ftgl/FTGL/ftgl.h:32:22: fatal error: ft2build.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'BBoxDeco.o' failed
make: *** [BBoxDeco.o] Error 1
ERROR: compilation failed for package ‘rgl’
* removing ‘/home/brandon/R/x86_64-pc-linux-gnu-library/3.4/rgl’
Warning in install.packages :
  installation of package ‘rgl’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmpv0TEaW/downloaded_packages’
Edit2:在安装了Rachit Kinger建议的PPA和包之后,我仍然没有得到一个工作的rgl

输出:

> install.packages("rgl")
Installing package into ‘/home/brandon/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rgl_0.99.16.tar.gz'
Content type 'application/x-gzip' length 3058794 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

* installing *source* package ‘rgl’ ...
** package ‘rgl’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ISO C89... (cached) none needed
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... libraries , headers 
checking GL/gl.h usability... yes
checking GL/gl.h presence... yes
checking for GL/gl.h... yes
checking GL/glu.h usability... yes
checking GL/glu.h presence... yes
checking for GL/glu.h... yes
checking for glEnd in -lGL... yes
checking for gluProject in -lGLU... yes
checking for pkg-config... yes
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
configure: using Freetype and FTGL
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++  -I/usr/share/R/include -DNDEBUG -DHAVE_PNG_H -I/usr/include/libpng12 -DHAVE_FREETYPE -Iext/ftgl  -Iext     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ABCLineSet.cpp -o ABCLineSet.o
g++  -I/usr/share/R/include -DNDEBUG -DHAVE_PNG_H -I/usr/include/libpng12 -DHAVE_FREETYPE -Iext/ftgl  -Iext     -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c BBoxDeco.cpp -o BBoxDeco.o
In file included from glgui.h:12:0,
                 from BBoxDeco.cpp:4:
ext/ftgl/FTGL/ftgl.h:32:22: fatal error: ft2build.h: No such file or directory
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'BBoxDeco.o' failed
make: *** [BBoxDeco.o] Error 1
ERROR: compilation failed for package ‘rgl’
* removing ‘/home/brandon/R/x86_64-pc-linux-gnu-library/3.4/rgl’
Warning in install.packages :
  installation of package ‘rgl’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpGobsUA/downloaded_packages’

问题不在于R。看起来Ubuntu中缺少了一些基本的安装包

尝试从终端安装libftgl2软件包。您可以使用以下代码:

sudo apt-get install libftgl2 
sudo add-apt-repository ppa:glasen/freetype2
如果您可以添加另一个PPA,也可以尝试直接安装Freetype2。请尝试以下代码:

sudo apt-get install libftgl2 
sudo add-apt-repository ppa:glasen/freetype2
那么这个,

sudo apt update && sudo apt install freetype2-demos  
然后重新启动R会话并再次尝试安装rgl。 如果这不能解决问题,您可以通过以下命令卸载刚刚安装的PPA:

sudo apt install ppa-purge && sudo ppa-purge ppa:glasen/freetype2

问题不在于R。看起来Ubuntu中缺少了一些基本的安装包

尝试从终端安装libftgl2软件包。您可以使用以下代码:

sudo apt-get install libftgl2 
sudo add-apt-repository ppa:glasen/freetype2
如果您可以添加另一个PPA,也可以尝试直接安装Freetype2。请尝试以下代码:

sudo apt-get install libftgl2 
sudo add-apt-repository ppa:glasen/freetype2
那么这个,

sudo apt update && sudo apt install freetype2-demos  
然后重新启动R会话并再次尝试安装rgl。 如果这不能解决问题,您可以通过以下命令卸载刚刚安装的PPA:

sudo apt install ppa-purge && sudo ppa-purge ppa:glasen/freetype2
在Linux Mint MATE 19.1上(以及之前的19和18.3中!)

是的

sudo apt-get install libftgl2 
然后尝试

sudo apt-get install libfreetype6
已安装,但未修复

这一建议行:

sudo add-apt-repository ppa:glasen/freetype2
出现以下错误:

无法添加PPA:“预期值:第1行第1列(字符0)”

解决问题的办法是:

从下载文件夹下载并解压缩最新的FreeType2。然后从该文件夹:

sudo make
sudo make install
重新打开R并
安装。软件包(“rgl”)
应该可以工作

在Linux Mint MATE 19.1上(以及之前的19和18.3中!)

是的

sudo apt-get install libftgl2 
然后尝试

sudo apt-get install libfreetype6
已安装,但未修复

这一建议行:

sudo add-apt-repository ppa:glasen/freetype2
出现以下错误:

无法添加PPA:“预期值:第1行第1列(字符0)”

解决问题的办法是:

从下载文件夹下载并解压缩最新的FreeType2。然后从该文件夹:

sudo make
sudo make install
重新打开R并
安装。软件包(“rgl”)
应该可以工作

解决方案:

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

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

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

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

还是没修好(我用我得到的输出更新了问题。用一个通过PPA安装Freetype2的选项编辑了我的答案。它仍然不起作用。我用新的输出更新了我的问题。我感谢你的帮助。
SystemRequirements:OpenGL、GLU库、XQuartz(在OSX上)、zlib(可选)、libpng(>=1.2.9,可选)、FreeType(可选)、pandoc(>=1.14,渐晕图需要)
这些是本手册规定的系统要求。此外,您可能会转到您的R-package文件夹并执行
ls-l
可能其中一些文件夹归root所有。然后,除非您使用
sudo
执行R,或者使用
chmod
@stripticchips
freetype2演示文件
执行R,否则无法写入这些文件夹。您需要相应的文件ponding
libfreetype?-dev
包。这里的
代表我未知的版本号。在我的Debian stable上,这将是
6
。仍然没有修复它:(我用我得到的输出更新了问题。用一个通过PPA安装Freetype2的选项编辑了我的答案。它仍然不起作用。我用新的输出更新了我的问题。我感谢你的帮助。
SystemRequirements:OpenGL、GLU库、XQuartz(在OSX上)、zlib(可选)、libpng(>=1.2.9,可选)、FreeType(可选)、pandoc(>=1.14,渐晕图需要)
这些是本手册规定的系统要求。此外,您可能会转到您的R-package文件夹并执行
ls-l
可能其中一些文件夹归root所有。然后,除非您使用
sudo
执行R,或者使用
chmod
@stripticchips
freetype2演示文件
执行R,否则无法写入这些文件夹。您需要相应的文件ponding
libfreetype?-dev
包。这里的
代表我未知的版本号。在我的Debian stable上,这将是
6