Building and installing JAGS locally - r

I'm trying to build and install JAGS on a cluster that uses GPFS as its filesystem. I'm running into problems with the configure script:
./configure --prefix=$HOME/JAGS/ --with-lapack=/cm/shared/apps/lapack/gcc/64/3.6.0/liblapack.so
Error:
configure: error: "You need to install the LAPACK library"
I'm specifying the location of the dynamic library, but the script doesn't accept that it exists on the system. What is the cause of this?

I figured out the issue. I needed to link to BLAS by using the "--with-blas" flag. The configure script does not have an error message for a missing BLAS link, it instead treats it as a missing reference to the LAPACK library.

Related

why does an error happen when I compile R source code on linux server?

I'm new to R and linux. I'm trying to install R on linux server by compiling source code. After executing "./configure" command, an error prompts:
configure: error: Building R requires the 'opendir' system call.
Does anybody know the cause behind it and the ways to fix it?

Install Rmpfr package in RStudio on remote server

I often use R / RStudio that is located on a remote server. Unfortunately, I do not have root / sudo / administrator access on this server, so any installations need to be done only in ~/.
I know that Rmpfr relies on libmpfr4 and mpfr.h. I have mpfr and gmp installed on my local folder (~/), but it seems R / RStudio only knows to look in /usr. I have tried the following command:
install.packages("Rmpfr", type = "source", configure.args = c("--with-mpfr-include=~/include", "--with-mpfr-lib=~/lib"))
and I got the following error:
In file included from Ops.c:12:0:
Rmpfr_utils.h:22:18: fatal error: mpfr.h: No such file or directory
#include <mpfr.h>
^
compilation terminated.
make: *** [Ops.o] Error 1
ERROR: compilation failed for package ‘Rmpfr’
I confirmed that mpfr.h is in the "~/include" folder and libmpfr.a is in the "~/lib" folder. I also have all of the following in my .bash_profile:
export PATH="~/mpfr-4.1.0/src/:$PATH"
export PATH="~/bin/:$PATH"
export PATH="~/gmp-6.2.1/:$PATH"
I'm pretty far out of my element with the more technical Linux / command line stuff, but I'm trying to learn and use Google / manuals as much as possible. My server runs a redhat distro. For some reason, apt-get doesn't seem to be a valid command on my server, yum requires root access that I don't have, and I can't figure out how to install homebrew for any brew solutions.
Please let me know if I need to provide any more information. Thanks in advance.

embend a RInside c++ application under linux

I developed an application whose main graphical outputs relie on R through the very useful RInside. I would like to "deploy" my application under linux systems without having to systematically install R and the needed packages. For that purpose I simply copied all the R directory /usr/lib/R, all the needed .so library and set R_HOME variables to the correct path.
However, I get when executing:
Error in loadNamespace(name) : there is no package called ‘Rcpp’
Execution halted
While RInside is in the directory $R_HOME/site-library/RInside. I guess that I have more to do (and that my approach was quite naive). Does anyone already tries such a task and can help on what to do ?
Yes you need to install the other dependencies as well -- and Rcpp is needed to convert data seamlessly between R and C++.

How can I install rJava for use with 64bit R on a 64 bit Windows computer?

I installed iplots and rjava packages. When I do this library(iplots), I get the following error. I do have JDK installed on my pc.
Loading required package: rJava
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
Error: package ‘rJava’ could not be loaded
The error is telling you that there is no entry in your Registry that tells R where Java is located on your machine. Either your registry is corrupt, but more likely you haven't installed Java. You can install either the Java Runtime Environment or the Java Development Kit.
(You can download Java here.)
If you installed Java, try reinstalling it. This should put the entries back in your Registry.
If that doesn't work, you can start looking at exactly where R is looking for your Registry entries. The function that rJava uses to find Java is in the rJava:::.onLoad function. Within that function there is a subfunction called find.java. I copy the contents here:
find.java <- function() {
for (root in c("HLM", "HCU")) for (key in c("Software\\JavaSoft\\Java Runtime Environment",
"Software\\JavaSoft\\Java Development Kit")) {
hive <- try(utils::readRegistry(key, root, 2),
silent = TRUE)
if (!inherits(hive, "try-error"))
return(hive)
}
hive
}
Copy and paste this into your R window, and then run it find.java(). rJava is looking for an entry for JavaHome. If that isn't listed, then it is missing from your registry.
You could also manually set the directory of your Java location by setting it before loading the library:
Sys.setenv(JAVA_HOME='C:\\Your\\Java\\Directory')
library(rJava)
If like me you do not have admin rights to install 64-bit Java, just open 32-bit R and it should work ok on your 64 bit PC as part of the problem seems to be the rJava library function calls embedded Java functions/routines, which may only have being designed for 32-bit interface with Excel/Windows and possibly too large a task at the time to change everything.
Answer in link resolved my issue.
Before resolution, I tried by adding JAVA_HOME to windows environments. It resolved this error but created another issue. The solution in above link resolves this issue without creating additional issues.
Any Linux users here, run command:
sudo R CMD javareconf
That typically needs to be run after an update of the system Java installation,
as suggested here

RApache Configure Does Not Recognize R Installed with Shared Library

All: Apologies in advance for what I hope is an easy question. It's been many years since I've worked in a Unix(-like) environment...
I'm trying to install RApache on a web server running the RHEL5 64-bit OS. I've successfully installed Apache and confirmed it works. I've also successfully installed R (R-2.13.0) with shared library. I've confirmed that libBlas.so and libR.so are installed; location: /R/R-2.13.0/lib
However, when I try to configure RApache ( sudo ./configure --with-apache2-apxs=/usr/local/apache2/bin/ --with-R=/R/R-2.13.0/) I get the following error:
R was not built as a shared
library Either build it with one,
or use another install of R
configure: error: aborting!
I've reinstalled R twice now and have confirmed in libtool that it says:
# Whether or not to build shared
libraries. build_libtool_libs=yes
Finally, I've searched high and low for some path or flag I need to set without success. Any help would be greatly appreciated.
Thanks,
Ron
You need to compile R with the appropriate flags. At the configure stage you need to include --enable-R-shlib so that R is built as a shared library.
You may need to further consult appendix B1 of http://cran.r-project.org/doc/manuals/R-admin.pdf which describes further issues.

Resources