AWS上的R和data.table [英] R and data.table on AWS

查看:60
本文介绍了AWS上的R和data.table的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个非常奇怪的错误,我正在尝试在AWS EC2实例(Amazon Linux AMI)上安装特定的R库.别人发布的 AWS论坛中的链接,实际上很好地突出了我的问题.

This is a very strange error I am running into trying to install a specific R library on AWS EC2 instance (Amazon Linux AMI). A link in the AWS forums here, posted by someone else, actually highlights my issue well.

错误消息的主要/相关部分是:

The main / relevant part of the error message is:

data.table.h:6:12: fatal error: omp.h: No such file or directory
#include <omp.h> 

我做了一些研究(不确定),我认为这与服务器上是否有启用OpenMP的编译器有关. GitHub本身的 data.table 安装页面在此处进行了一些讨论,但是我不确定如何在我的EC2实例上更新或修复它.

I did some research (while I'm not sure), I think this is related to whether or not there is an OpenMP enabled compiler on the server. The data.table installation page on GitHub itself discusses this a bit here, but I'm not sure how to update or fix this on my EC2 instance.

对此有任何帮助.

编辑-这是一个新问题,因为不到一个月前我就能够在以前的类似EC2实例上成功安装 data.table .

EDIT - this is a new problem, as i was able to successfully install data.table on a previous, similar EC2 instance less than a month ago.

编辑2-我通过使用以前的我的EC2实例(已经安装了data.table)解决了这个问题,并从中创建了一个自定义AMI.通过在启动新实例时使用此自定义AMI,它们已经安装了data.table库.如果我发现AWS自行解决了此问题,我会尽力记得回来并更新本文!

EDIT 2 - I got around this issue by taking a previous EC2 instance of mine with data.table already installed on it, and creating a custom AMI from it. By using this custom AMI when launching new instances, they already came with the data.table library installed. If I notice AWS resolve this issue on its own, I'll try to remember to come back and update this post!

推荐答案

这里的问题是data.table在默认的gcc编译器中不能很好地工作(将gcc72-c ++.x86_64作为R-devel的依赖项进行安装.x86_64).通过添加

The problem here is that data.table doesn't play nice with the default gcc compiler (gcc72-c++.x86_64 gets installed as a dependency of R-devel.x86_64). Point R to an older version by adding

CC=gcc64

中的

.如果您从干净的" Amazon Linux AMI开始,则此文件不存在,您可以键入

in ~/.R/Makevars. If you start from a "clean" Amazon Linux AMI this file doesn't exist and you can just type

mkdir ~/.R
echo "CC=gcc64" >> ~/.R/Makevars

这篇关于AWS上的R和data.table的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆