前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >R安装glmnet需要在~/.R下设置Makevars

R安装glmnet需要在~/.R下设置Makevars

原创
作者头像
用户10407347
修改2023-03-21 16:32:42
7400
修改2023-03-21 16:32:42
举报
文章被收录于专栏:bioinformaticsbioinformatics

R安装glmnet报错:

代码语言:javascript
复制
C++14 standard requested but CXX14 is not defined

这时需要在~/.R下新建文件Makevars

代码语言:javascript
复制
$ vim ~/.R/Makevars
CXX14FLAGS=-O3 -march=native -mtune=native -fPIC
CXX14=g++

然后再安装就ok, 安装过程会打印很多log

代码语言:text
复制
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 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档