I am trying to install R 3.3.2 on a server running centos 6. I have to install it in my Home directory on the server because i don't have the permissions anywhere else. I downloaded it using wget and then tar. But when I reach the point of "./configure" in order to run "make" afterwards it stops with an error.
checking if zlib version >= 1.2.5... no
checking whether zlib support suffices... configure: error: zlib library and headers are required
I installed zlib 1.2.8 and added its path to my bash_profile then tried to run the command ./configure for the R again but i got the same error. It seems that it still sees that I am using an old version of zlib (1.2.3) (The one that is already installed on the server). Have anyone had a similar issue or have any advices regarding this ? Thanks in advance
and added its path to my bash_profile
I am curious if you prepended or appended the path. In the latter case, configure will detect the old zlib.
In order to prepend, do like
export LD_LIBRARY_PATH=/path/to/zlib/inst/dir/lib:${LD_LIBRARY_PATH}
Related
Periodically – I think whenever I update R – I have problems installing packages from source on my 64-bit Windows machine.
Today I'm trying to install a package using devtools::install_github(). The installation proceeded fine on my laptop, but my not on my desktop, which can install the package under *** arch - i386, but under *** arch - x64, which reports the error message
C:/PROGRA~1/R/R-34~1.4/bin/x64/R.dll: file not recognized: File format not recognized
The command that caused the error is
C:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o PACKAGENAME.dll [...]
I believe that the error is arising because R is using mingw_32 to attempt to compile a 64-bit package. The question is, where can I tell R to use mingw_64? I've already checked all the places that I can recall:
R-3.4.4/etc/x64/Makeconf states
BINPREF ?= c:/Rtools/mingw_64/bin/
My system PATH (verified from within R using Sys.getenv('PATH')) includes mingw_64 ahead of mingw_32.
R must be looking somewhere else to decide which compiler to use... but where?
Via R CMD check not looking for gcc in Rtools directory:
R was looking in C:/Users/MYUSERNAME/Documents/.R/Makevars for the value of BINPREF. Deleting the contents of this file removed the incorrect location.
$RPATH/etc/i386/Makeconf is re-created with each new installation of R, and contains the line
BINPREF ?= c:/Rtools/mingw_32/bin/.
The ?= operator will set the value of BINPREF if it is not already set, as it was in the Makevars file mentioned above. So replacing ?= with = will work until a new version of R is installed and the Makeconf file is overwritten – updating, or uninstalling, R will not modify the Makevars file in the User directory.
If you start digging from devtools::install_github, it will lead you through the following functions:
devtools::install_github
devtools:::install_remotes
devtools:::try_install_remote
devtools:::install_remote
devtools:::install
devtools:::check_build_tools
devtools:::setup_rtools
devtools:::scan_path_for_rtools
And when you run the following code:
devtools:::scan_path_for_rtools(TRUE)
devtools:::setup_rtools(debug=TRUE)
Most likely, it is saying that Rtools is not currently installed. (Yes, a bit counterintuitive given that you already have it installed in C:/Rtools but maybe not registered in registry)
To fix it, you will need to run (which is in essence the solution in Rtools is not being detected from RStudio)
Sys.setenv(PATH=paste0("C:\\Rtools\\bin;", Sys.getenv("PATH")))
devtools:::set_rtools_path(structure(list(path="c:/Rtools/mingw_64/bin", version=3.4), class="rtools"))
devtools:::set_rtools_path(structure(list(path="c:/Rtools/mingw_32/bin", version=3.4), class="rtools"))
Please let me know if this works.
BINPREF ?= c:/Rtools/mingw_64/bin/
remove ? before =
I'm currently trying to install gtk3 on scientific linux (It is not available on official repositories)
I'm well used to yum, apt, pacman etc but i'm a little lost here when it's about compiling ...
to install gtk3, i need glib, to install glib, i need pcre 8.32.
I thus downloaded the tarball from their site.
Once 'untarred', i followed what is written on that link :
http://www.linuxfromscratch.org/blfs/view/svn/general/pcre.html
but once i've made './configure' with its options, 'make', and then 'make install' glib doesn't configure any better... it says my version is still the old version
configure: error: Package requirements (libpcre >= 8.13) were not met:
Requested 'libpcre >= 8.13' but version of libpcre is 7.8
The files seems to be well compiled but not 'moved correctly to the right place' ...
Did i miss something ?
By the way moving to another distro is not an option :P
I am trying to check a package that I have built (with vignette) using R CMD check --as-cran [my package] in my windows command prompt. All goes well until I get the message,
WARNING 'qpdf' is needed for checks on size reduction of PDFs
I have downloaded qpdf, put the unzipped folder in my program files directory, and added the bin folder to the PATH.
Not quite sure what else I need to do? I have the feeling I have not installed qpdf correctly or I need to build this program itself? I have read through the readme files and manual for qpdf which appear to be more aimed at unix users (which I have no experience with... I am your standard/regular windows user with little to no programming experience outside of statistical languages). I have had a go at trying to build qpdf using cgywin, but ended up failing to install zlib and prec. Any tips?
I would try
Sys.which(Sys.getenv("R_QPDF", "qpdf"))
Sys.getenv("PATH")
to establish that R is really not finding the qpdf executable, and see where it is looking. You probably shouldn't need to rebuild everything, just figure out why R is not finding the qpdf executable ... does running qpdf from a terminal window work ... ? How are you starting R, and did it have a chance to get the new PATH definition (i.e. do you need to open a new terminal window, or ?? reboot ??)
The incantation above was extracted from tools::compactPDF, from the default value of the qpdf argument, on a Linux machine. You should check for yourself, in case (e.g.) the Windows version is looking for qpdf.exe rather than qpdf ...
There are a couple of other things to consider on a Windows machine:
If you are running the 32-bit version of R, it is important that you download the 32-bit version of qpdf, which is the version linked from the SourceForge homepage. If you are running a 64-bit installation of R, you will need to do a bit of digging to locate the 64-bit version of qpdf, which is buried a little more deeply (version 7.0 is listed here).
Once you have extracted the zipped qpdf directory to your hard disk, perhaps under C:\Program Files\, added C:\Program Files\qpdf-version_number\bin to your system PATH under the environment variables, and re-launched R, Windows needs to establish that pqdf is safe to run.
Navigate to C:\Program Files\qpdf-version_numer\bin and execute qpdf.exe (by double-clicking). Windows 10 throws up a security warning, as it's an unrecognized executable file. You'll need to use the more options link to find the button to run the program. This done, Windows will recognize the file as safe to run and allow other software, including R, to use it.
Recent developments: If you install Rtools 3.5 qpdf is included and that warning is gone. Rtools is a toolset for building packages on Windows and is recently reworked by Jeroen Ooms.
More information : https://cran.r-project.org/bin/windows/Rtools/
Note that the changelog is incomplete, as Rtools 3.5 isn't frozen yet at the time of writing (2019-03-01). Even though it's not visible on the page yet, qpdf.exe is included in the bin directory after installation.
After installing the latest version of RTools, the warning still popped up.
However, I noticed that the Windows "where" command gave two paths to qpdf (different versions). After removing the R_QPDF environment variable and removing the new install of qpdf from the Windows path, so that only qpdf in RTools was found, the warning disappeared.
I got the same warning on Ubuntu so here's a Ubuntu solution for completeness:
First update packages
sudo apt update
Then install qpdf with
sudo apt install qpdf
Tested on Ubuntu 20.04.
I'm running Rstudio on its own server.
Java is installed with good java_home and bin.
R is installed. rJava is installed.
Tried to do command: library("rJava") but had issues with libjvm.so, do following Rstudio recommandation I did sudo R CMD javareconf with root.
Here is the output of my javareconf:
Java interpreter : /home/scoremd/jdk1.7.0_03/jre/bin/java
Java version : 1.7.0_03
Java home path : /home/scoremd/jdk1.7.0_03
Java compiler : /home/scoremd/jdk1.7.0_03/bin/javac
Java headers gen.: /home/scoremd/jdk1.7.0_03/bin/javah
Java archive tool: /home/scoremd/jdk1.7.0_03/bin/jar
NOTE: Your JVM has a bogus java.library.path system property!
Trying a heuristic via sun.boot.library.path to find jvm library...
Java library path: $(JAVA_HOME)/jre/lib/amd64:$(JAVA_HOME)/jre/lib/amd64/server
JNI linker flags : -L$(JAVA_HOME)/jre/lib/amd64 -L$(JAVA_HOME)/jre/lib/amd64/server -ljvm
JNI cpp flags : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
Seems there is issue with finding the java library path... but my java is working fine and R also.
I didn't receive any solution from RStudio support and community (told me to ask in SO ....).
I have rstudio-server installed on my Centos server. There are a couple of users using rstudio and we decided to upgrade R from 3.6 to 4.0.
After the upgrade :
all users were running R 4.0.
No user could install rJava using install.package('rJava'). This error always popped up
configure: error: Cannot compile a simple JNI program. See config.log for details.
Make sure you have Java Development Kit installed and correctly registered in R.
If in doubt, re-run "R CMD javareconf" as root.
ERROR: configuration failed for package ‘rJava’
Running SUDO R CMD javareconf went smoothly, and also when I opened R as root and went along and tried install.packages('rJava') it installed the package just fine. (unbeknownst to me, root ran R 3.6 and users 4.0, see solution below)
However it did not work installing the package for users in R studio server. Always stating the same "try running sudo R CMD javareconf" as if the Java path for the users was wrong.
so we tried setting the "JAVA_HOME" variable to the same path that java jdk was installed in (found by searching installed packages in yum). That did not solve it.
my solution
I saw that root was running version 3.6 of R while all users ran 4.0. This was because I had installed 4.0 in another directory.. The directory of R 4.0 happens to be found first by the users. However for the root user... it finds the path of R 3.6 first.
So I set the path to the 4.0 folder in the $PATH variable of the root user, so that would find version 4.0 before finding R 3.6
echo $PATH
export PATH="/usr/local/bin:$PATH"
echo $PATH
Then I ran R as that user and ran "R CMD javareconf", installed the packages and all users are happy and working again.
(disclaimer, I'm not a experienced linux admin, there may be a better solution for running different R versions)
It's been some time since I used rJava, and it was on Windows, but I have some notes which may help you:
Make sure that the JRI native library is in a directory listed in java.library.path
(also confirmed using Process Explorer that jri.dll is being loaded)
The R process loads up jvm.dll when you do library(rJava)
Replace jvm.dll iny my notes above with libjvm.so in your case, and jri.dll with whatever .so file is relevant to you.
Im facing the problem during installation :
>>setup configure
Configuring HDBC-sqlite3-2.3.0.0...
setup: Missing dependency on a foreign library:
* Missing C library: sqlite3
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
what should I do ?
thanks for any help
OK,
I downloaded sqlite3.dll and sqlite3.h from source zip.
then I inserted sqlite3.dll in system32 dir and in setup configure i used
--extra-lib-dirs=... --extra-include-dirs=... parameters with correct paths to header and dll.
You need to install the C library implementation and headers of SQLite.
On Ubuntu and other Debian-based Linux distros, it's simply
sudo apt-get install sqlite3 libsqlite3-dev
Other Linux distros will have similarly named packages.
On Windows, you'll have to do some more work.
On OS X, I have no idea.