I have installed the R package "Rglpk" manually in following manner as root
user on ec2-instance of Redhat 7
:
mkdir -p GLPK
wget http://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz
tar xvf glpk-4.47.tar.gz
cd glpk-4.47
./configure --prefix=/home/ec2-user/GLPK
make
make install
cd ..
wget https://cran.r-project.org/src/contrib/Rglpk_0.6-3.tar.gz
tar xvf Rglpk_0.6-3.tar.gz
mv glpk-4.47 /home/ec2-user/Rglpk/src/GLPK
export LD_LIBRARY_PATH=/home/ec2-user/GLPK/lib
export LIBRARY_PATH=/home/ec2-user/GLPK/lib
export CPATH=/home/ec2-user/GLPK/include
R CMD INSTALL Rglpk
The issue is when i am calling this library in R
cli with root as user,it works fine but when i switch to my user i.e. ec2-user
and once call this library in R
cli ,it starts giving following error for all users,even for root.
library("Rglpk")
Loading required package: slam
Error: package or namespace load failed for ‘Rglpk’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/lib64/R/library/Rglpk/libs/Rglpk.so':
libglpk.so.0: cannot open shared object file: No such file or directory
The file is still present in that location:
0(ec2-user@resuerdsfdfsfdn02 [~])$ cd /usr/lib64/R/library/Rglpk/libs/
0(ec2-user@resuerdsfdfsfdn02 [/usr/lib64/R/library/Rglpk/libs])$ ls
Rglpk.so*