0

我正在尝试semPlot在 Linux Mint 上使用带有 R 版本 3.2.3 的包。是降级我的 R 版本的唯一解决方案吗?我已经安装包 XML 没有错误。下面更新

跑:install.packages("semPlot",dependencies=T)错误:

....
g++ -I/usr/share/R/include -DNDEBUG   -I"/home/king/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c minqa.cpp -o minqa.o
/bin/bash: g++: command not found
make: *** [minqa.o] Error 127
ERROR: compilation failed for package ‘minqa’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/minqa’
Warning in install.packages :
  installation of package ‘minqa’ had non-zero exit status
* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether the C++ compiler works... no
configure: error: in `/tmp/Rtmpw7bRnY/R.INSTALL5fd12b68373/nloptr':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘nloptr’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/nloptr’
Warning in install.packages :
  installation of package ‘nloptr’ had non-zero exit status
* installing *source* package ‘RcppEigen’ ...
** package ‘RcppEigen’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG   -I"/home/king/R/x86_64-pc-linux-gnu-library/3.2/Rcpp/include"  -I../inst/include -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c RcppEigen.cpp -o RcppEigen.o
/bin/bash: g++: command not found
make: *** [RcppEigen.o] Error 127
ERROR: compilation failed for package ‘RcppEigen’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/RcppEigen’
Warning in install.packages :
  installation of package ‘RcppEigen’ had non-zero exit status
ERROR: dependencies ‘minqa’, ‘nloptr’, ‘RcppEigen’ are not available for package ‘lme4’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/lme4’
Warning in install.packages :
  installation of package ‘lme4’ had non-zero exit status
ERROR: dependency ‘lme4’ is not available for package ‘arm’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/arm’
Warning in install.packages :
  installation of package ‘arm’ had non-zero exit status
ERROR: dependency ‘lme4’ is not available for package ‘rockchalk’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/rockchalk’
Warning in install.packages :
  installation of package ‘rockchalk’ had non-zero exit status
ERROR: dependency ‘arm’ is not available for package ‘mi’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/mi’
Warning in install.packages :
  installation of package ‘mi’ had non-zero exit status
ERROR: dependency ‘mi’ is not available for package ‘sem’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/sem’
Warning in install.packages :
  installation of package ‘sem’ had non-zero exit status
ERROR: dependency ‘sem’ is not available for package ‘qgraph’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/qgraph’
Warning in install.packages :
  installation of package ‘qgraph’ had non-zero exit status
ERROR: dependencies ‘qgraph’, ‘sem’, ‘rockchalk’ are not available for package ‘semPlot’
* removing ‘/home/king/R/x86_64-pc-linux-gnu-library/3.2/semPlot’
Warning in install.packages :
  installation of package ‘semPlot’ had non-zero exit status

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

更新 根据我发现我必须安装的评论:

sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install build-essential

我现在得到:

/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status

再次感谢我发现我必须安装的评论:

sudo apt-get install liblapack-dev

终于解决了我的问题,我能够安装软件包

4

0 回答 0