bakdata / aws-lambda-r-runtime

Serverless execution of R code on AWS Lambda
https://medium.com/bakdata/running-r-on-aws-lambda-9d40643551a6
MIT License
143 stars 52 forks source link

libR.so: cannot open shared object file: No such file or directory #21

Closed mbragg02 closed 5 years ago

mbragg02 commented 5 years ago

Hi, Im attempting to install and use the tibble package. I've successfully created a layer containing the binaries of the package and its deps, in aR/library/ directory. When I run the lambda which uses the package I'm receiving the following error:

Error: package or namespace load failed for ‘tibble’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/opt/R/library/rlang/libs/rlang.so':
  libR.so: cannot open shared object file: No such file or directory

I've tried a few things but with no luck. It would appear the rlang package is looking for a libR.so file - which dosent exist. I see there is a libRblas.so file in /opt/R/lib but im not sure how that relates to the missing libR.so file. From reading here it would suggest an additional arg must be set when building R from source.

Flag --enable-R-shlib causes the make process to build R as a dynamic (shared) library, typically called libR.so, and link the main R executable R.bin against that library

Before I attempt to try and build my own R from source I wanted to check with you, as you might have more information/context. Thanks

mbragg02 commented 5 years ago

Ok so I have compiled my own runtime layer using R 3.6.0 and included the --enable-R-shlib flag in the R compile.sh script - this has resolved the issue

philipp94831 commented 5 years ago

Hi @mbragg02, thanks for spotting this. I will include it in the layer.