R安装glmnet报错:
C++14 standard requested but CXX14 is not defined
这时需要在~/.R下新建文件Makevars
$ vim ~/.R/Makevars
CXX14FLAGS=-O3 -march=native -mtune=native -fPIC
CXX14=g++
然后再安装就ok, 安装过程会打印很多log
install.packages('glmnet', ask=F, update=F)
...
installing to /opt/R/R-4.0.2/lib64/R/library/00LOCK-glmnet/00new/glmnet/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (glmnet)
The downloaded source packages are in
‘/tmp/Rtmpa5W3si/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
>
> require(glmnet)
Loading required package: glmnet
Loading required package: Matrix
Attaching package: ‘Matrix’
The following object is masked from ‘package:S4Vectors’:
expand
The following objects are masked from ‘package:tidyr’:
expand, pack, unpack
Loaded glmnet 4.1-6
>
更多关于R使用不同版本C++的设置:
https://cloud.tencent.com/developer/article/1937953?from=article.detail.2243233&areaSource=106000.1&traceId=U5yHvw98CscizXCTZdlM2
https://blog.csdn.net/Damonyugg/article/details/112481346
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。