我正在运行Ubuntu 16.04 [现在17.04:参见下面的粗体注释]和R 3.4.1.我今天早上安装了后者,所以我认为这是最新版本.我想安装Tidyverse,我在
Windows下度过了许多欢乐时光.但是当我执行install.packages(“tidyverse”)时,我收到有关gcc无法识别的命令行选项的错误.当安装命中颜色空间和munsell包时,这些开始.我将在这篇文章的最后给出一个例子,仅供munsell使用.
我没有找到任何在Ubuntu 16.04上确实存在这个问题的人.但是来自有类似问题的人的帖子表明我的gcc可能是一个太老而无法识别选项-fstack-protector-strong和-Wdate-time的版本.
我想到的可能的解决方法:
1)将Ubuntu更新为16.10或17.04,希望其中一个具有合适的gcc.但是,我在这里缺乏Ubuntu的专业知识:特别是,似乎我必须升级两次,一次升级到16.10再升级到17.04.我甚至无法将系统升级到16.10:https://wiki.ubuntu.com/YakketyYak/ReleaseNotes建议的步骤,“从Ubuntu 16.04 LTS升级”,在我尝试时找不到升级.另外,我不确定这些Ubuntus中是否会有正确的gcc.
第二天补充说:虽然我试图通过跟随https://wiki.ubuntu.com/YakketyYak/ReleaseNotes升级Ubuntu昨天没有做任何事情,但他们今天确实工作了.也许是一个缓存问题?所以我现在有了Ubuntu 17.04.但是,在尝试安装Tidyverse时仍然会遇到相同的错误.
2)找到不需要那些编译器选项的旧版Tidyverse.
3)升级我的Ubuntu的gcc.但是我不知道是否会在我的机器上使用其他需要较旧gcc的软件.
5)废弃Ubuntu并在Windows上完成我的所有工作.我知道人们会嘲笑“Micro $oft”,但至少在Windows上,我不会浪费一个早晨的Linux arcana并且可以完成我的工作,这就是R.这种感觉与https://people.dsv.su.se/~jpalme/s1/hoare.pdf年他们的咒语的牧师非常相似,“软件设计:寓言”.只是说……
来自使用这些版本的R和Ubuntu实际执行此操作的人的任何建议?
这是一个失败的安装:
`> install.packages("munsell")
Installing package into ‘/home/popx/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘colorspace’
trying URL 'https://cran.rstudio.com/src/contrib/colorspace_1.3-2.tar.gz'
Content type 'application/x-gzip' length 293433 bytes (286 KB)
==================================================
downloaded 286 KB
trying URL 'https://cran.rstudio.com/src/contrib/munsell_0.4.3.tar.gz'
Content type 'application/x-gzip' length 97244 bytes (94 KB)
==================================================
downloaded 94 KB
* installing *source* package ‘colorspace’ ...
** package ‘colorspace’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c colorspace.c -o colorspace.o
gcc: error: unrecognized command line option '-fstack-protector-strong'
gcc: error: unrecognized command line option '-Wdate-time'
/usr/lib/R/etc/Makeconf:159: recipe for target 'colorspace.o' Failed
make: *** [colorspace.o] Error 1
ERROR: compilation Failed for package ‘colorspace’
* removing ‘/home/popx/R/x86_64-pc-linux-gnu-library/3.4/colorspace’
Warning in install.packages :
installation of package ‘colorspace’ had non-zero exit status
ERROR: dependency ‘colorspace’ is not available for package ‘munsell’
* removing ‘/home/popx/R/x86_64-pc-linux-gnu-library/3.4/munsell’
Warning in install.packages :
installation of package ‘munsell’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpQ8FW70/downloaded_packages’
Warning message:
R graphics engine version 12 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.