R and data.table on AWS

This is a very strange mistake. I am trying to install a specific R library on an instance of AWS EC2 (Amazon Linux AMI). The link to the AWS forums here posted by someone else really illuminates my issue really well.

The main / relevant part of the error message:

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

I did some research (although I'm not sure), I think this is due to whether there is a compiler with OpenMP support on the server. On the data table setup page on GitHub, this is a bit discussed here , but I'm not sure how to update or fix this on my EC2 instance.

Any help with this is appreciated.

EDIT is a new issue, as I was able to successfully install data.table in a previous similar EC2 instance less than a month ago.

EDIT 2 - I circumvented this problem by taking the previous EC2 instance with the data table already installed on it and creating a custom AMI from it. Using this custom AMI when starting new instances, they already appeared with the data.table library installed. If I notice that AWS will solve this problem on my own, I will try to remember to come back and update this post!

+4
source share
3 answers

The problem here is that data.table doesn’t work very well with the default gcc compiler (gcc72-C ++. X86_64 is set as a dependency on R-devel.x86_64). Point R to an older version by adding

CC=gcc64

c ~/.R/Makevars. If you start with a pure Amazon Linux AMI, this file does not exist, and you can simply enter

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

.

1) ssh.

2)

wget https://cran.r-project.org/src/contrib/data.table_1.10.4-3.tar.gz

3)

R CMD INSTALL data.table_1.10.4-3.tar.gz

, () RStudio.

4) .libPaths() R RStudio, , .

5) sudo cp -R SOURCE DEST.

: , , , .. , data.table .

0

For some reason, installing CC=gcc64in ~/.R/Makevarsdid not work for me. R still used the gccdefault command .

However, there is another option. You can edit the file Makeconfthat R uses during compilation directly. If you are using Amazon Linux, file location /usr/lib64/R/etc/Makeconf. After you find the file, the trick will be the same, that is, change CC = gccto CC = gcc64. You can also make sure that it is gcc64installed by running sudo yum install gcc64.

0
source

Source: https://habr.com/ru/post/1693055/


All Articles