R package kernlab installation issue - r

I am facing issues while installing the kernlab R package on CentOS using the following command:
install.packages("/home/R_Libraries/kernlab_0.9-20.tar.gz", repos = NULL, type="source")
I get the following error:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/opt/vertica/R/library/kernlab/libs/kernlab.so':
libgfortran.so.3: wrong ELF class: ELFCLASS32
gfortran is installed as confirmed by the following command:
ldconfig -v|grep fortran
libgfortran.so.1 -> libgfortran.so.1.0.0
Can someone help with fixing this issue?

This error:
libgfortran.so.3: wrong ELF class: ELFCLASS32
means that you've tried to load 32-bit libgfortran into a 64-bit program.
Unfortunately you didn't tell us anything that would allow us to help you. Not even where this libgfortran is coming from.
You should make sure that a 64-bit libgfortran is installed in the system location, and the above error would go away.

Related

RGDAL installation error: libnetcdf.so.6: cannot open shared object file: No such file or directory

I run RStudio Server on ubuntu 14.04. When trying to install the rgdal package I get the following error message:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/admin2/R/x86_64-pc-linux-gnu- library/2.14/rgdal/libs/rgdal.so':
libnetcdf.so.6: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
I upgraded RStudio Server, R-Core and all Ubuntu packages to their latest versions but no success. I also tried apt-get install lib32stdc++6 as suggested here, but also no changes. I think it is a problem specific to GDAL and the indexing of shared libraries in unix. Can anyone help please?
Ok I got it done removing Gdal completly, compiling it from source again and setting library paths correctly as described here. Later adding /usr/local/lib/ to /etc/ld.so.conf and run sudo ldconfig as described here.

tcltk error in R [duplicate]

After upgrading to OS X 10.10 Yosemite I started to receive the following error log when running my Rcmdr package in R using library(Rcmdr):
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /usr/X11/lib/libXft.2.dylib
Referenced from: /usr/local/lib/libtk8.6.dylib
Reason: image not found
Error: package or namespace load failed for 'Rcmdr'
Could you help me understand how to fix it?
This mac os x troubleshooting didn't help.
Execute the following in a terminal window:
locate libXft.2.dylib
or do it from an R console:
system("locate libXft.2.dylib")
On my Yosemite install it's in /opt/X11/lib/libXft.2.dylib.
If your setup is similar, then:
sudo ln -s /opt/X11 /usr/X11
should help fix this temporarily, but I'd keep looking for a Yosemite R package (since that will accommodate all the changes Apple made to the filesystem structure).
Of note: On my work Mac (Mavericks) this symlink is already there.
Reinstalling XQuartz worked for me.
I added a symlink from /usr/X11 to /opt/X11 and this resolved the problem without the locate command.

RPostgreSQL installation Error - RPostgreSQL.so: undefined symbol: PQpass

I am trying to install R-Package RPostgreSQL, but getting the following error,
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib64/R/library/RPostgreSQL/libs/RPostgreSQL.so':
/usr/lib64/R/library/RPostgreSQL/libs/RPostgreSQL.so: undefined symbol: PQpass
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/lib64/R/library/RPostgreSQL’
I have libpq and postgresql-dev installed. All the library files are in the directory
/usr/lib64/pgsql/ and all header files are in the directory
/usr/include/pgsql/
Postgre Version - 9.3.4
R Version - 3.0.2
Operating System - CentOS-6.4
I am missing some small thing, but unable to find out why this is happening.
What am I doing wrong? How to correct this?
Looks like the pgsql libraries are no longer installed in their previous locations. I linked both:
ln -s /usr/pgsql-9.3/lib /usr/lib/pgsql
ln -s /usr/pgsql-9.3/include /usr/include/pgsql
This worked for me :)
The package RPostgreSQL checks for PostgreSQL libraries only in the following directory paths,
/usr/lib
/usr/lib/pgsql
/usr/lib/postgresql
/usr/local/lib
/usr/local/lib/pgsql
/usr/local/lib/postgresql
/usr/local/pgsql/lib
/usr/local/postgresql/lib
/opt/lib
/opt/lib/pgsql
/opt/lib/postgresql
/opt/local/lib
/opt/local/lib/postgresql
/opt/local/lib/postgresql84
/sw/opt/postgresql-8.4/lib
/Library/PostgresPlus/8.4SS/lib
/sw/lib
It does not check for the directories either in LD_LIBRARY_PATH or in /etc/ld.so.conf.
So RPostgreSQL installation will be successful only if the PostgreSQL libraries exist in any of the above directories.
When I copied the libraries from /usr/lib64/pgsql to /usr/lib/pgsql and tried installing the package. It worked. :)

R does not recognize the correct libstdc++.so library

When I try to install the kernlab package on R 2.15.2 on Scientific Linux 5.5, I get the following error message:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '~/bin/lib64/R/library/kernlab/libs/kernlab.so':
/usr/java/jdk1.6.0_41/jre/../lib/amd64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ~/bin/lib64/R/library/kernlab/libs/kernlab.so)
R 2.11 is installed on the same system, which installs kernlab just fine. Additionally, the following reports no errors:
ldd -r ~/bin/lib64/R/library/kernlab/libs/kernlab.so
So it seems that R simply doesn't manage to use the right libraries. I set LD_LIBRARY_PATH to /usr/local/gcc-4.6.0/lib64/, which is where the working version of libstdc++.so.6 seems to be, but that did not help.
How can it be that R refuses to use the right libraries? And how can I make it use the correct one?
How can it be that R refuses to use the right libraries?
Something else in the process must be loading the older libstdc++.so before the R shared lib gets loaded. I'm surprised LD_LIBRARY_PATH doesn't help though.

Problems installing rjags and JAGS on Mac OsX 10.5.8

I am having issues getting rjags the R package for R to call JAGS (Just Another Gibbs Sampler http://www-ice.iarc.fr/~martyn/software/jags/ ).
I am running Mac Os X. 10.5.8 Leopard and using R64 2.12.1. I compiled JAGS from the command line. Then I installed rjags in the R command line.
install.packages(rjags)
When I try to call rjags within R, I get the following error.
> library(rjags)
Error : .onLoad failed in loadNamespace() for 'rjags', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/2.12/Resources /library/rjags/libs/x86_64/rjags.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.12/Resources/library/rjags/libs/x86_64/rjags.so, 10): Library not loaded: /usr/local/lib/libjags.2.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/2.12/Resources/library/rjags/libs/x86_64/rjags.so
Reason: no suitable image found. Did find:
/usr/local/lib/libjags.2.dylib: mach-o, but wrong architecture
/usr/local/lib/libjags.2.dylib: mach-o, but wrong architecture
Error: package/namespace load failed for 'rjags'
I am guessing there is some issue with rjags referencing an unknown file in the library, but I am not sure. I am a fairly novice at the command line and messing around with directories, so any help would be much appreciated.
I found (after downloading and installing the dmg from SourceForge) that the following commands worked for me:
wget http://cran.r-project.org/src/contrib/rjags_2.2.0-4.tar.gz
wget http://cran.r-project.org/src/contrib/R2jags_0.02-15.tar.gz
sudo R --with-jags-modules=/usr/local/lib/JAGS/modules-2.2.0 CMD INSTALL rjags_2.2.0-4.tar.gz
sudo R --with-jags-modules=/usr/local/lib/JAGS/modules-2.2.0 CMD INSTALL R2jags_0.02-15.tar.gz
sudo R --with-jags-modules=/usr/local/lib/JAGS/modules-2.2.0 --arch=i386 CMD INSTALL rjags_2.2.0-4.tar.gz
sudo R --with-jags-modules=/usr/local/lib/JAGS/modules-2.2.0 --arch=x86_64 CMD INSTALL rjags_2.2.0-4.tar.gz
They certainly aren't all necessary, but they were sufficient!
I had the same problem while running Rstudio 0.97.237 and R 2.15.2. The issue had something to do with JAGS.
The fix: Update to JAGS 3-3 by downloading and installing it from here.
I encountered the error: unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so': on my Mac and DuckDuckGo led me to this post. I was using R from the command line, so I can't speak to how it works with RStudio although I'm pretty sure it's the fix for that too. I updated JAGS from the SourceForge link provided in another answer. I can at least verify that it worked for me, though the developer was unsigned (I needed to ignore a MacOS warning during the installation procedure).

Resources