r-lib / sodium

R bindings to libsodium

Home Page:https://docs.ropensci.org/sodium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libsodium not found although installed

markheckmann opened this issue · comments

On a Linux AWS instance, I installed libsodium and the R sodium package without errors. However, when loading sodium I get (sorry for the non-reproducable example):

> library(sodium)
Error: package or namespace load failed for ‘sodium’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/usr/lib64/R/library/sodium/libs/sodium.so':
  libsodium.so.23: cannot open shared object file: No such file or directory

The .so file is there however:

> system("ls /usr/lib64/R/library/sodium/libs")
sodium.so

And so is libsodium:

> head(system("sudo find / -iname libsodium.*"))
/usr/local/lib/libsodium.a
/usr/local/lib/libsodium.la
/usr/local/lib/libsodium.so.23.3.0
/usr/local/lib/libsodium.so
/usr/local/lib/pkgconfig/libsodium.pc
/usr/local/lib/libsodium.so.23
/home/ec2-user/libsodium-1.0.18/libsodium.vcxproj.filters

Any ideas?

Did you install libsodium from source? It's better to use the system provided sodium. For example on CentOS you do:

yum install epel-release
yum install libsodium-devel

I tried that, but it said:

[ec2-user@xxx]$ sudo yum install libsodium-devel
Loaded plugins: priorities, update-motd, upgrade-helper
No package libsodium-devel available.

So I used the source as I did not know how to make the provided sodium release available (linux rookie) PS. on EC2 Linux AMI

PSS: Might be a lack of whitelisting here. I will check and talk to the admins before I can retry to install the system version. I will get back to this as soon as I have done that.

Did you install epel-release? libsodium is part of EPEL, not the regular EL repositories.

If you want to use your custom libsodium from /usr/local/lib, you need to set LD_LIBRARY_PATH when starting R.

Not being able to update the EPEL repolist was a proxy issue. By adding the line proxy=<your proxy> to /etc/yum.repos.d/epel.repo and /etc/yum.repos.d/epel-testing.repo it worked to install libsodium by sudo yum install libsodium. However, the version I got know appears to be old, i.e.

/usr/lib64/libsodium.so.4.5.0
/usr/lib64/libsodium.so.4
/usr/lib64/libsodium.so

Any hints for EPEL / linux noobs how to get the latest one from EPEL?