R start message is included in compiling process - r

I am using Microsoft R Open on CentOS 7 system, when I install minqa package, I found a very strange error: the R start up message is included in compiling process. How should I fix this problem?
r$> p_install(minqa)
Installing package into ‘/home/public/R/library’
(as ‘lib’ is unspecified)
--2020-12-04 15:57:01-- http://mirrors.ustc.edu.cn/CRAN/src/contrib/minqa_1.2.4.tar.gz
Resolving mirrors.ustc.edu.cn (mirrors.ustc.edu.cn)... 202.38.95.110
Connecting to mirrors.ustc.edu.cn (mirrors.ustc.edu.cn)|202.38.95.110|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 53548 (52K) [application/octet-stream]
Saving to: ‘/home/wsx/tmp/RtmpKkNTLF/downloaded_packages/minqa_1.2.4.tar.gz’
100%[==================================================================================>] 53,548 --.-K/s in 0.02s
2020-12-04 15:57:16 (2.14 MB/s) - ‘/home/wsx/tmp/RtmpKkNTLF/downloaded_packages/minqa_1.2.4.tar.gz’ saved [53548/53548]
Microsoft R Open 4.0.2
The enhanced R distribution from Microsoft
Microsoft packages Copyright (C) 2020 Microsoft Corporation
Using the Intel MKL for parallel mathematical computing (using 12 cores).
Default CRAN mirror snapshot taken on 2020-07-16.
See: https://mran.microsoft.com/.
Loading required package: pacman
* installing *source* package ‘minqa’ ...
** package ‘minqa’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fpic -g -O2 -c altmov.f -o altmov.o
gfortran -fpic -g -O2 -c bigden.f -o bigden.o
gfortran -fpic -g -O2 -c biglag.f -o biglag.o
gfortran -fpic -g -O2 -c bobyqa.f -o bobyqa.o
gfortran -fpic -g -O2 -c bobyqb.f -o bobyqb.o
gfortran -fpic -g -O2 -c lagmax.f -o lagmax.o
/opt/rh/devtoolset-8/root/usr/bin/g++ -I/opt/microsoft/ropen/4.0.2/lib64/R/include -DNDEBUG -I'/opt/microsoft/ropen/4.0.2/lib64/R/library/Rcpp/include' -DU_STATIC_IMPLEMENTATION -fpic -DU_STATIC_IMPLEMENTATION -O2 -g -c minqa.cpp -o minqa.o
gfortran -fpic -g -O2 -c newuoa.f -o newuoa.o
gfortran -fpic -g -O2 -c newuob.f -o newuob.o
gfortran -fpic -g -O2 -c prelim.f -o prelim.o
gfortran -fpic -g -O2 -c rescue.f -o rescue.o
gfortran -fpic -g -O2 -c trsapp.f -o trsapp.o
gfortran -fpic -g -O2 -c trsbox.f -o trsbox.o
gfortran -fpic -g -O2 -c trstep.f -o trstep.o
gfortran -fpic -g -O2 -c uobyqa.f -o uobyqa.o
gfortran -fpic -g -O2 -c uobyqb.f -o uobyqb.o
gfortran -fpic -g -O2 -c update.f -o update.o
gfortran -fpic -g -O2 -c updatebobyqa.f -o updatebobyqa.o
Loading required package: pacman
/opt/rh/devtoolset-8/root/usr/bin/g++ -shared -L/opt/microsoft/ropen/4.0.2/lib64/R/lib -o minqa.so altmov.o bigden.o biglag.o bobyqa.o bobyqb.o lagmax.o minqa.o newuoa.o newuob.o prelim.o rescue.o trsapp.o trsbox.o trstep.o uobyqa.o uobyqb.o update.o updatebobyqa.o Microsoft R Open 4.0.2 The enhanced R distribution from Microsoft Microsoft packages Copyright (C) 2020 Microsoft Corporation Using the Intel MKL for parallel mathematical computing (using 12 cores). Default CRAN mirror snapshot taken on 2020-07-16. See: https://mran.microsoft.com/. -lgfortran -lm -L/opt/microsoft/ropen/4.0.2/lib64/R/lib -lR
Loading required package: pacman
g++: error: Microsoft: No such file or directory
g++: error: R: No such file or directory
g++: error: Open: No such file or directory
g++: error: 4.0.2: No such file or directory
g++: error: The: No such file or directory
g++: error: enhanced: No such file or directory
g++: error: R: No such file or directory
g++: error: distribution: No such file or directory
g++: error: from: No such file or directory
g++: error: Microsoft: No such file or directory
g++: error: Microsoft: No such file or directory
g++: error: packages: No such file or directory
g++: error: Copyright: No such file or directory
g++: error: (C): No such file or directory
g++: error: 2020: No such file or directory
g++: error: Microsoft: No such file or directory
g++: error: Corporation: No such file or directory
g++: error: Using: No such file or directory
g++: error: the: No such file or directory
g++: error: Intel: No such file or directory
g++: error: MKL: No such file or directory
g++: error: for: No such file or directory
g++: error: parallel: No such file or directory
g++: error: mathematical: No such file or directory
g++: error: computing: No such file or directory
g++: error: (using: No such file or directory
g++: error: 12: No such file or directory
g++: error: cores).: No such file or directory
g++: error: Default: No such file or directory
g++: error: CRAN: No such file or directory
g++: error: mirror: No such file or directory
g++: error: snapshot: No such file or directory
g++: error: taken: No such file or directory
g++: error: on: No such file or directory
g++: error: 2020-07-16.: No such file or directory
g++: error: See:: No such file or directory
g++: error: https://mran.microsoft.com/.: No such file or directory
make: *** [minqa.so] Error 1
ERROR: compilation failed for package ‘minqa’
* removing ‘/home/public/R/library/minqa’
The downloaded source packages are in
‘/home/wsx/tmp/RtmpKkNTLF/downloaded_packages’
Warning messages:
1: In utils::install.packages(package, ...) :
installation of package ‘minqa’ had non-zero exit status
2: In p_install(minqa) :

The interesting thing is that I tried to commnet all cat() messages in file ./lib64/R/etc/Rprofile.site and append a cat(" ") make a space passed to the gcc and it works!

Related

Unable to install packages via renv::restore() ("R was unable to find one or more FORTRAN libraries during compilation.")

I've downloaded an old repo on a new laptop (running on MacOS Catalina) and attempted to run a R script.
The repo has a renv lock file - meaning, I should be able to restore all dependencies as they were.
But as I run the renv::restore() command, this error message appears:
Installing pbapply [1.4-3] ...
OK [linked cache]
Installing mvtnorm [1.1-2] ...
FAILED
Error installing package 'mvtnorm':
===================================
* installing to library ‘~/renv/staging/2’
* installing *source* package ‘mvtnorm’ ...
** package ‘mvtnorm’ successfully unpacked and MD5 sums checked
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c C_FORTRAN_interface.c -o C_FORTRAN_interface.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c miwa.c -o miwa.o
gfortran -fPIC -g -O2 -c mvt.f -o mvt.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/usr/local/include -fPIC -Wall -g -O2 -c mvtnorm-init.c -o mvtnorm-init.o
gfortran -fPIC -g -O2 -c tvpack.f -o tvpack.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o mvtnorm.so C_FORTRAN_interface.o miwa.o mvt.o mvtnorm-init.o tvpack.o -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mvtnorm.so] Error 1
ERROR: compilation failed for package ‘mvtnorm’
* removing ‘~/renv/staging/2/mvtnorm’
------------------------------------------------------------------------------
R was unable to find one or more FORTRAN libraries during compilation.
This often implies that the FORTRAN compiler has not been properly configured.
Please see https://stackoverflow.com/q/35999874 for more information.
Reason(s):
- 'ld: library not found for -lgfortran'
Error: install of package 'mvtnorm' failed [error code 1]
Traceback (most recent calls last):
13: renv::restore()
12: renv_restore_run_actions(project, diff, current, lockfile, rebuild)
11: renv_install(records)
10: renv_install_staged(records)
9: renv_install_default(records)
8: handler(package, renv_install_impl(record))
7: renv_install_impl(record)
6: withCallingHandlers(renv_install_package_local(record), error = function(e) {
vwritef("\tFAILED")
writef(e$output)
})
5: renv_install_package_local(record)
4: renv_install_package_local_impl(package, path)
3: r_cmd_install(package, path)
2: r_exec_error(package, output, "install", status)
1: stop(error)
I can't make sense of the link in the error message (copied here: Mac OS X R error "ld: warning: directory not found for option").
From my problem search, I've come across some possible solutions that are above my R knowledge level, e.g.:
"[...] creating the file ~/.R/Makevars within my home directory." (Unable to install fortran based packages in R - "gfortran -m32:not found")
"[...] installed gcc & gcc-fortran and that solved it" (Unable to install a package on R)
Similar ideas here: OS X package installation depends on gfortran-4.8
Some guidance here would be deeply appreciated. Please let me know if there's any other info you need (first time posting here).
Thanks in advance!
Solution
Download and install "gfortran-6.1.pkg (OS X 10.11+, signed, 64-bit)" from this page: https://cran.r-project.org/bin/macosx/tools/

Microsoft R Open + line breaks during package compilation

For some odd reason, the latest version of Microsoft R Open is failing to compile various packages, because of something (Rcpp I think) that spawns multiple R sessions, and the repeated calls to clear the terminal window are introducing line breaks in the middle of the compiler commands. See below. There doesn't seem to be a reliable way to completely suppress the verbose startup message, which appears to be causing this error.
Note the same happens with /opt/microsoft/ropen/4.0.2/lib64/R/bin/R CMD INSTALL as well as /opt/microsoft/ropen/4.0.2/lib64/R/bin/Rscript
Ideas? Suggestions?
$ /opt/microsoft/ropen/4.0.2/lib64/R/bin/R -q
> install.packages('minqa')
Installing package into ‘/raid/users/g-socsldap/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 53548 100 53548 0 0 247k 0 --:--:-- --:--:-- --:--:-- 247k
Microsoft R Open 4.0.2
The enhanced R distribution from Microsoft
Microsoft packages Copyright (C) 2020 Microsoft Corporation
Using the Intel MKL for parallel mathematical computing (using 44 cores).
Default CRAN mirror snapshot taken on 2020-07-16.
See: https://mran.microsoft.com/.
* installing *source* package ‘minqa’ ...
** package ‘minqa’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fpic -g -O2 -c altmov.f -o altmov.o
gfortran -fpic -g -O2 -c bigden.f -o bigden.o
gfortran -fpic -g -O2 -c biglag.f -o biglag.o
gfortran -fpic -g -O2 -c bobyqa.f -o bobyqa.o
gfortran -fpic -g -O2 -c bobyqb.f -o bobyqb.o
gfortran -fpic -g -O2 -c lagmax.f -o lagmax.o
g++ -I/opt/microsoft/ropen/4.0.2/lib64/R/include -DNDEBUG -I'/opt/microsoft/ropen/4.0.2/lib64/R/library/Rcpp/include' -DU_STATIC_IMPLEMENTATION -fpic -DU_STATIC_IMPLEMENTATION -O2 -g -c minqa.cpp -o minqa.o
gfortran -fpic -g -O2 -c newuoa.f -o newuoa.o
gfortran -fpic -g -O2 -c newuob.f -o newuob.o
gfortran -fpic -g -O2 -c prelim.f -o prelim.o
gfortran -fpic -g -O2 -c rescue.f -o rescue.o
gfortran -fpic -g -O2 -c trsapp.f -o trsapp.o
gfortran -fpic -g -O2 -c trsbox.f -o trsbox.o
gfortran -fpic -g -O2 -c trstep.f -o trstep.o
gfortran -fpic -g -O2 -c uobyqa.f -o uobyqa.o
gfortran -fpic -g -O2 -c uobyqb.f -o uobyqb.o
gfortran -fpic -g -O2 -c update.f -o update.o
gfortran -fpic -g -O2 -c updatebobyqa.f -o updatebobyqa.o
g++ -shared -L/opt/microsoft/ropen/4.0.2/lib64/R/lib -o minqa.so altmov.o bigden.o biglag.o bobyqa.o bobyqb.o lagmax.o minqa.o newuoa.o newuob.o prelim.o rescue.o trsapp.o trsbox.o trstep.o uobyqa.o uobyqb.o update.o updatebobyqa.o Microsoft R Open 4.0.2 The enhanced R distribution from Microsoft Microsoft packages Copyright (C) 2020 Microsoft Corporation Using the Intel MKL for parallel mathematical computing (using 44 cores). Default CRAN mirror snapshot taken on 2020-07-16. See: https://mran.microsoft.com/. -lgfortran -lm -L/opt/microsoft/ropen/4.0.2/lib64/R/lib -lR
g++: error: Microsoft: No such file or directory
g++: error: R: No such file or directory
g++: error: Open: No such file or directory
g++: error: 4.0.2: No such file or directory
g++: error: The: No such file or directory
g++: error: enhanced: No such file or directory
g++: error: R: No such file or directory
g++: error: distribution: No such file or directory
g++: error: from: No such file or directory
g++: error: Microsoft: No such file or directory
g++: error: Microsoft: No such file or directory
g++: error: packages: No such file or directory
g++: error: Copyright: No such file or directory
g++: error: (C): No such file or directory
g++: error: 2020: No such file or directory
g++: error: Microsoft: No such file or directory
g++: error: Corporation: No such file or directory
g++: error: Using: No such file or directory
g++: error: the: No such file or directory
g++: error: Intel: No such file or directory
g++: error: MKL: No such file or directory
g++: error: for: No such file or directory
g++: error: parallel: No such file or directory
g++: error: mathematical: No such file or directory
g++: error: computing: No such file or directory
g++: error: (using: No such file or directory
g++: error: 44: No such file or directory
g++: error: cores).: No such file or directory
g++: error: Default: No such file or directory
g++: error: CRAN: No such file or directory
g++: error: mirror: No such file or directory
g++: error: snapshot: No such file or directory
g++: error: taken: No such file or directory
g++: error: on: No such file or directory
g++: error: 2020-07-16.: No such file or directory
g++: error: See:: No such file or directory
g++: error: https://mran.microsoft.com/.: No such file or directory
make: *** [/opt/microsoft/ropen/4.0.2/lib64/R/share/make/shlib.mk:6: minqa.so] Error 1
ERROR: compilation failed for package ‘minqa’
* removing ‘/raid/users/g-socsldap/R/x86_64-pc-linux-gnu-library/4.0/minqa’
The downloaded source packages are in
‘/tmp/RtmpMlXevk/downloaded_packages’
Warning message:
In install.packages("minqa") :
installation of package ‘minqa’ had non-zero exit status
I figured this problem with running R in --vanilla mode (this mode ignores .Rprofile.site located in /opt/microsoft/ropen/4.0.2/lib64/R/etc/Rprofile.site):
R --vanilla
install.packages("minqa")
// select any link you want

Linux issue happens on Windows? "fatal error: fftw3.h: No such file or directory"

I am running MRO 3.5.0 on Win10, and trying to install a package image.CannyImage from bnosac/image on the github. But it keeps reporting fatal errors as following.
* installing *source* package 'image.CannyEdges' ...
** libs
c:/Rtools/mingw_64/bin/g++ -m64 -I"C:/PROGRA~1/MICROS~1/ROPEN~1/R-35~1.0/include" -DNDEBUG -I"C:/Users/eric1/Documents/R/win-library/3.5/Rcpp/include" -I"C:/swarm/workspace/External-R-3.5.0/vendor/extsoft/include" -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o
c:/Rtools/mingw_64/bin/gcc -m64 -I"C:/PROGRA~1/MICROS~1/ROPEN~1/R-35~1.0/include" -DNDEBUG -I"C:/Users/eric1/Documents/R/win-library/3.5/Rcpp/include" -I"C:/swarm/workspace/External-R-3.5.0/vendor/extsoft/include" -O2 -Wall -std=gnu99 -mtune=core2 -c adsf.c -o adsf.o
c:/Rtools/mingw_64/bin/g++ -m64 -I"C:/PROGRA~1/MICROS~1/ROPEN~1/R-35~1.0/include" -DNDEBUG -I"C:/Users/eric1/Documents/R/win-library/3.5/Rcpp/include" -I"C:/swarm/workspace/External-R-3.5.0/vendor/extsoft/include" -O2 -Wall -mtune=core2 -c rcpp_canny.cpp -o rcpp_canny.o
In file included from rcpp_canny.cpp:13:0:
canny.h:8:19: fatal error: fftw3.h: No such file or directory
#include <fftw3.h>
^
compilation terminated.
make: *** [C:/PROGRA~1/MICROS~1/ROPEN~1/R-35~1.0/etc/x64/Makeconf:215: rcpp_canny.o] Error 1
ERROR: compilation failed for package 'image.CannyEdges'
* removing 'C:/Users/eric1/Documents/R/win-library/3.5/image.CannyEdges'
In R CMD INSTALL
Installation failed: Command failed (1)
^
compilation terminated.
Google says I can solve the issue by sudo apt-get remove libfftw3-dev. Unfortunately, I am on Windows, and some advised, apply lib /machine:i386 /def:libfftw3-3.def on cmd mode. Ouch, there is no such command or file called lib.exe on Win10.
Please advise, how I can solve this issue on my Win10+MRO system. Thanks.
Even though this question is already a bit old:
By now (Feb 2020) there are precompiled packages available that work also under Windows:
Canny Edges - Package
and more general:
List of all available packages
I have tried installing them and (at least for me) it worked.

pkg-config: command not found error

I am setting up R with Hadoop. I am getting the following error on installing package "rhbase": (other packages[see below] and their dependencies have been installed successfully)
bash-3.2$ ls
plyrmr_0.4.0.tar rhbase_1.2.1.tar rhdfs_1.0.8.tar rmr2_3.2.0.tar
ERROR:
> install.packages("/Users/raunak/Downloads/rlibs/rhbase_1.2.1.tar", repos = NULL, type="source")
* installing *source* package ‘rhbase’ ...
** libs
clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I. -g -DHAVE_UINTPTR_T -DHAVE_NETDB_H=1 -fpermissive -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H -I./gen_cpp `pkg-config --cflags thrift` -Wall -fPIC -Wall -mtune=core2 -g -O2 -c Hbase.cpp -o Hbase.o
/bin/sh: pkg-config: command not found
In file included from Hbase.cpp:7:
./Hbase.h:10:10: fatal error: 'TProcessor.h' file not found
\#include <TProcessor.h>
^
1 error generated.
make: *** [Hbase.o] Error 1
ERROR: compilation failed for package ‘rhbase’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rhbase’
Warning in install.packages :
installation of package ‘/Users/raunak/Downloads/rlibs/rhbase_1.2.1.tar’ had non-zero exit status
bash-3.2$ which pkg-config
/usr/local/bin/pkg-config
What could be the cause?

Error Installing minqa in R/3.0.2

I am installing lme4 using the README.md file on their github account and I fail during installing the dependencies. I tried to install them separately and still crash at installing the minqa package. I'm using R/3.0.2 on RHEL6. During the build the compiler argues about RScript not existing which as I check it is in the R/bin folder.
Here is the log to the R INSTALL:
$ R CMD INSTALL minqa_1.2.2.tar.gz
* installing to library ‘/gpfs/apps/x86_64-rhel6/R/3.0.2/R/library’
* installing *source* package ‘minqa’ ...
** package ‘minqa’ successfully unpacked and MD5 sums checked
** libs
gfortran -fpic -g -O2 -c altmov.f -o altmov.o
gfortran -fpic -g -O2 -c bigden.f -o bigden.o
gfortran -fpic -g -O2 -c biglag.f -o biglag.o
gfortran -fpic -g -O2 -c bobyqa.f -o bobyqa.o
gfortran -fpic -g -O2 -c bobyqb.f -o bobyqb.o
gfortran -fpic -g -O2 -c lagmax.f -o lagmax.o
g++ -I/gpfs/apps/x86_64-rhel6/R/3.0.2/R/include -DNDEBUG -I/usr/local/include -I"/gpfs/apps/x86_64-rhel6/R/3.0.2/R/library/Rcpp/include" -fpic -g -O2 -c minqa.cpp -o minqa.o
gfortran -fpic -g -O2 -c newuoa.f -o newuoa.o
gfortran -fpic -g -O2 -c newuob.f -o newuob.o
gfortran -fpic -g -O2 -c prelim.f -o prelim.o
gfortran -fpic -g -O2 -c rescue.f -o rescue.o
gfortran -fpic -g -O2 -c trsapp.f -o trsapp.o
gfortran -fpic -g -O2 -c trsbox.f -o trsbox.o
gfortran -fpic -g -O2 -c trstep.f -o trstep.o
gfortran -fpic -g -O2 -c uobyqa.f -o uobyqa.o
gfortran -fpic -g -O2 -c uobyqb.f -o uobyqb.o
gfortran -fpic -g -O2 -c update.f -o update.o
gfortran -fpic -g -O2 -c updatebobyqa.f -o updatebobyqa.o
Rscript execution error: No such file or directory
g++ -shared -L/usr/local/lib64 -o minqa.so altmov.o bigden.o biglag.o bobyqa.o bobyqb.o lagmax.o minqa.o newuoa.o newuob.o prelim.o rescue.o trsapp.o trsbox.o trstep.o uobyqa.o uobyqb.o update.o updatebobyqa.o -lgfortran -lm -L/gpfs/apps/x86_64-rhel6/R/3.0.2/R/lib -lR
Rscript execution error: No such file or directory
installing to /gpfs/apps/x86_64-rhel6/R/3.0.2/R/library/minqa/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/gpfs/apps/x86_64-rhel6/R/3.0.2/R/library/minqa/libs/minqa.so':
/gpfs/apps/x86_64-rhel6/R/3.0.2/R/library/minqa/libs/minqa.so: undefined symbol: _ZTIN4Rcpp7RObjectE
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/gpfs/apps/x86_64-rhel6/R/3.0.2/R/library/minqa’
A similar error also occurs when trying to upgrade lme4 from 1.0-5 to 1.0-6. The error message is something like:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/local/lib/R/site-library/minqa/libs/minqa.so':
libRcpp.so: cannot open shared object file: No such file or directory
ERROR: lazy loading failed for package ‘lme4’
To resolve this install the packages in the order below:
install.packages('Rcpp')
install.packages('RcppEigen')
install.packages('minqa')
install.packages('lme4')
I guess it's related to RCpp; just upgrade the version from 0.10.6 to 0.11.0 and some ABI break change happens?
Credit from dmbates
/usr/share/R/share/make/shlib.mk:6: recipe for target 'minqa.so' failed make: *** [minqa.so] Error 1
I got the same error when installing minqa (needed for lme4). It was due to modify .First() in /etc/R/Rprofile.site
Desactive .First or use R --vanilla.

Resources