R: install.package() is not calling compilers on CentOS 6.5 - r

R version: 3.1.1
I want to install this package. I downloaded the source and put it under my home directory. After that I ran install.packages("~/rEDM/",repos=NULL,type="source") to install from source. The error message I got is:
Installing package into ‘/d1/dwuab/R/x86_64-redhat-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
* installing *source* package ‘rEDM’ ...
** libs
I/usr/include/R -DNDEBUG -I/usr/local/include -I"/d1/dwuab/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/include" -I../inst/include -c RcppExports.cpp -o RcppExports.o
/bin/sh: I/usr/include/R: No such file or directory
make: [RcppExports.o] Error 127 (ignored)
I/usr/include/R -DNDEBUG -I/usr/local/include -I"/d1/dwuab/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/include" -I../inst/include -c block_lnlp.cpp -o block_lnlp.o
/bin/sh: I/usr/include/R: No such file or directory
make: [block_lnlp.o] Error 127 (ignored)
I/usr/include/R -DNDEBUG -I/usr/local/include -I"/d1/dwuab/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/include" -I../inst/include -c forecast_machine.cpp -o forecast_machine.o
/bin/sh: I/usr/include/R: No such file or directory
make: [forecast_machine.o] Error 127 (ignored)
I/usr/include/R -DNDEBUG -I/usr/local/include -I"/d1/dwuab/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/include" -I../inst/include -c lnlp.cpp -o lnlp.o
/bin/sh: I/usr/include/R: No such file or directory
make: [lnlp.o] Error 127 (ignored)
I/usr/include/R -DNDEBUG -I/usr/local/include -I"/d1/dwuab/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/include" -I../inst/include -c xmap.cpp -o xmap.o
/bin/sh: I/usr/include/R: No such file or directory
make: [xmap.o] Error 127 (ignored)
-L/usr/local/lib64 -o rEDM.so RcppExports.o block_lnlp.o forecast_machine.o lnlp.o xmap.o -L/usr/lib64/R/lib -lR
/bin/sh: line 2: -L/usr/local/lib64: No such file or directory
make: *** [rEDM.so] Error 127
ERROR: compilation failed for package ‘rEDM’
* removing ‘/d1/dwuab/R/x86_64-redhat-linux-gnu-library/3.1/rEDM’
Warning message:
In install.packages("~/rEDM/", repos = NULL, type = "source") :
installation of package ‘/ghome/dwuab/rEDM/’ had non-zero exit status
Something is very wrong here, as R did not call the compiler at all.
The author of the package said this is due to R and/or GCC being misconfigured.
My question: is there anyone who knows what the problem is? Or how to troubleshoot the problem?
Edit 1: installing the package through zip file using command install.packages("./master.zip",repos=NULL,type="source") led to the following error message:
Installing package into ‘/d1/dwuab/R/x86_64-redhat-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
Error in rawToChar(block[seq_len(ns)]) :
embedded nul in string: 'PK\003\004\n\0\0\0\0\0\x83h,H\0\0\0\0\0\0\0\0\0\0\0\0\f\0\t\0rEDM-master/UT\005\0\001Fj\x95VPK\003\004\n\0\0\0\b\0\x83h,H\x8ewq\xa1\030\0\0\0\034\0\0\0\031\0\t\0rEDM-master/.Rbuild'
Warning message:
In install.packages("./master.zip", repos = NULL, type = "source") :
installation of package ‘./master.zip’ had non-zero exit status
Edit 2: I have no root privilege on the machine.

As a workaround, I used EasyBuild to compile and install R 3.2.1 with GCC 4.9.3. The whole compiling and installing process took me several days ... Now it works.

You can try the following link...
http://www.cyberciti.biz/faq/centos-linux-install-gcc-c-c-compiler/

Related

Issues installing RcppMP in MacOS

I am trying to install RcppMP in MacOS.
However, when I type:
remotes::install_github("Thell/RcppMP",dependencies = T)
I get the following error:
* installing *source* package ‘RcppMP’ ...
** using staged installation
** libs
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
In file included from RcppExports.cpp:4:
In file included from ./../inst/include/RcppMP.h:7:
In file included from ../inst/include/RcppMP_RcppExports.h:7:
../inst/include/RcppMP_types.hpp:15:10: fatal error: 'mpreal.h' file not found
#include <mpreal.h>
^~~~~~~~~~
1 error generated.
make: *** [RcppExports.o] Error 1
ERROR: compilation failed for package ‘RcppMP’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppMP’
Warning message:
In i.p(...) :
installation of package ‘/var/folders/pq/hxwd9my563q_qpy4rbrlgkmw0000gn/T//RtmpIdnyiB/file2184610d74ea/RcppMP_0.1.1.tar.gz’ had non-zero exit status
My ~/.R/Makevars file contain the following specifications:
CC=/usr/local/opt/llvm/bin/clang
CXX=/usr/local/opt/llvm/bin/clang++
CXX1X=/usr/local/opt/llvm/bin/clang++
LDFLAGS=-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib
CXXFLAGS=-I/usr/local/opt/llvm/include
FLIBS=-L/usr/local/Cellar/gcc/11.3.0_1/lib/gcc/11
This was a bit more complicated than I thought; this package requires mpfr, gmp and the very-similarly-named mpfrc++. The steps that worked for me are:
Install gmp and mpfr via homebrew
Download and unzip "mpfrc++-3.6.8.zip" from
http://www.holoborodko.com/pavel/mpfr/#download
Copy the mpreal header file ("mpreal.h") to
/usr/local/include (sudo cp ./mpreal.h /usr/local/include/) or, in your case, perhaps sudo cp ./mpreal.h /usr/local/opt/llvm/include would make more sense
Install/compile RcppMP
(remotes::install_github("Thell/RcppMP",dependencies = TRUE))
I got some warnings but no errors, and the package loaded (library(RcppMP)), so I'm relatively confident it installed successfully. If you find otherwise, please let me know and I'll look into it further.

cannot install R package: CMake errorr

I am trying to install factoextra, but I gets stuck during the CMake part, in particular with error like:
CMake Error: The source directory "/tmp/..." does not exist.
(same when I try to install its dependencies: nloptr, pbkrtest, lme4, car, rstatix, FactoMineR, ggpubr )
any idea?
thanks
ps:
R version 4.0.0
centos 7
last part of logs:
CMake Error: The source directory "/tmp/RtmpgJySdf/R.INSTALL20c31df42f6/nloptr/src/nlopt-build" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Unknown argument -j
Unknown argument 2
Usage: cmake --build <dir> [options] [-- [native-options]]
Options:
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Don't merge stdout/stderr output and pass the
original stdout/stderr handles to the native
tool so it can use the capabilities of the
calling terminal (e.g. colored output).
-- = Pass remaining options to the native tool.
CMake Error: The source directory "/tmp/RtmpgJySdf/R.INSTALL20c31df42f6/nloptr/src/nlopt" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
cp: cannot stat 'nlopt/include/*': No such file or directory
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I"/opt/R/4.0.0/lib/R/include" -DNDEBUG -I../inst/include -I'/opt/R/4.0.0/lib/R/library/testthat/include' -I/usr/local/include -fpic -g -O2 -c init_nloptr.c -o init_nloptr.o
gcc -std=gnu99 -I"/opt/R/4.0.0/lib/R/include" -DNDEBUG -I../inst/include -I'/opt/R/4.0.0/lib/R/library/testthat/include' -I/usr/local/include -fpic -g -O2 -c nloptr.c -o nloptr.o
g++ -std=gnu++11 -I"/opt/R/4.0.0/lib/R/include" -DNDEBUG -I../inst/include -I'/opt/R/4.0.0/lib/R/library/testthat/include' -I/usr/local/include -fpic -g -O2 -c test-C-API.cpp -o test-C-API.o
g++ -std=gnu++11 -I"/opt/R/4.0.0/lib/R/include" -DNDEBUG -I../inst/include -I'/opt/R/4.0.0/lib/R/library/testthat/include' -I/usr/local/include -fpic -g -O2 -c test-runner.cpp -o test-runner.o
g++ -std=gnu++11 -shared -L/opt/R/4.0.0/lib/R/lib -L/usr/local/lib -o nloptr.so init_nloptr.o nloptr.o test-C-API.o test-runner.o -L/opt/R/4.0.0/lib/R/lib -lRlapack -L/opt/R/4.0.0/lib/R/lib -lRblas -lgfortran -lm -lquadmath -Lnlopt/lib -lnlopt -L/opt/R/4.0.0/lib/R/lib -lR
/bin/ld: cannot find -lnlopt
collect2: error: ld returned 1 exit status
make: *** [nloptr.so] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/opt/R/4.0.0/lib/R/library/nloptr’
ERROR: dependency ‘nloptr’ is not available for package ‘lme4’
* removing ‘/opt/R/4.0.0/lib/R/library/lme4’
ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’
* removing ‘/opt/R/4.0.0/lib/R/library/pbkrtest’
ERROR: dependencies ‘pbkrtest’, ‘lme4’ are not available for package ‘car’
* removing ‘/opt/R/4.0.0/lib/R/library/car’
ERROR: dependency ‘car’ is not available for package ‘rstatix’
* removing ‘/opt/R/4.0.0/lib/R/library/rstatix’
ERROR: dependency ‘car’ is not available for package ‘FactoMineR’
* removing ‘/opt/R/4.0.0/lib/R/library/FactoMineR’
ERROR: dependency ‘rstatix’ is not available for package ‘ggpubr’
* removing ‘/opt/R/4.0.0/lib/R/library/ggpubr’
ERROR: dependencies ‘FactoMineR’, ‘ggpubr’ are not available for package ‘factoextra’
* removing ‘/opt/R/4.0.0/lib/R/library/factoextra’
The downloaded source packages are in
‘/tmp/Rtmp98DJqK/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("factoextra") :
installation of package ‘nloptr’ had non-zero exit status
2: In install.packages("factoextra") :
installation of package ‘lme4’ had non-zero exit status
3: In install.packages("factoextra") :
installation of package ‘pbkrtest’ had non-zero exit status
4: In install.packages("factoextra") :
installation of package ‘car’ had non-zero exit status
5: In install.packages("factoextra") :
installation of package ‘rstatix’ had non-zero exit status
6: In install.packages("factoextra") :
installation of package ‘FactoMineR’ had non-zero exit status
7: In install.packages("factoextra") :
installation of package ‘ggpubr’ had non-zero exit status
8: In install.packages("factoextra") :
installation of package ‘factoextra’ had non-zero exit status
I solved this problem by sudo apt-get install libnlopt-dev.
so,
I think I finally figure out!
factoextra (or better, nloptr) currently needs a combination of
R v. >= 4 (not trial for centos! https://stackoverflow.com/a/67341871 )
cmake v. >= 3 (yum install cmake3 -- credits to https://github.com/astamm/nloptr/issues/104#issuecomment-1034229550)
In Ubuntu install cmake v3.20.2 from the source and it will solve the issue:
sudo apt install build-essential libssl-dev
wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz
tar -zxvf cmake-3.20.2.tar.gz
cd cmake-3.20.2
./bootstrap
make
sudo make install

Installing a package on MRO 3.4.2 error: /bin/sh: /usr/local/clang4/bin/clang++: No such file or directory

I am trying to install a package which finally needs clang. In particular, the error is the following:
install.packages("httpuv")
versuche URL 'https://mran.microsoft.com/snapshot/2017-10-15/src/contrib/httpuv_1.3.5.tar.gz'
Content type 'application/octet-stream' length 427638 bytes (417 KB)
==================================================
downloaded 417 KB
Warnung in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz)
unknown timezone 'default/Europe/Berlin'
* installing *source* package ‘httpuv’ ...
** Paket ‘httpuv’ erfolgreich entpackt und MD5 Summen überprüft
** libs
/usr/local/clang4/bin/clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./libuv/include -I./http-parser -I./sha1 -I./base64 -I"/Library/Frameworks/R.framework/Versions/3.4.2-MRO/Resources/library/Rcpp/include" -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -fPIC -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -c RcppExports.cpp -o RcppExports.o
/bin/sh: /usr/local/clang4/bin/clang++: No such file or directory
make: *** [RcppExports.o] Error 127
ERROR: compilation failed for package ‘httpuv’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4.2-MRO/Resources/library/httpuv’
Warning in install.packages :
installation of package ‘httpuv’ had non-zero exit status
In general I have some versions of clang installed. After reading some things about this issue I found out, that "/bin/sh: /usr/local/clang4/bin/clang++:" is not available. Therefore I edit the R makeconf changing the following lines
CC=/usr/local/clang4/bin/clang
CXX=/usr/local/clang4/bin/clang++
CXX11=$CXX
CXX14=$CXX
CXX17=$CXX
CXX1X=$CXX
LDFLAGS=-L/usr/local/clang4/lib
to
CC=/usr/local/Cellar/llvm/5.0.0/bin/clang
CXX=/usr/local/Cellar/llvm/5.0.0/bin/clang++
CXX11=$CXX
CXX14=$CXX
CXX17=$CXX
CXX1X=$CXX
LDFLAGS=-L/usr/local/Cellar/llvm/5.0.0/lib
But nevertheless the installer seems to seek for the other folder...
Do I have to change the folders elsewhere? What I am doing wrong?
Thanks for help.
Best wishes

loop_apply.o: file not recognized: File format not recognized

I am trying to install R’s plyr package. Here is the error message:
* installing *source* package ‘plyr’ ...
** package ‘plyr’ successfully unpacked and MD5 sums checked
** libs
clang++ -I/opt/R-3.4.1/include -DNDEBUG -I"/home/isomorphismes/R/i686-pc-linux-gnu-library/3.4/Rcpp/include" -I/usr/local/include -fpic -I/opt/boost_1_61_0/boost -c RcppExports.cpp -o RcppExports.o
clang -I/opt/R-3.4.1/include -DNDEBUG -I"/home/cd/R/i686-pc-linux-gnu-library/3.4/Rcpp/include" -I/usr/local/include -fpic -g -O2 -flto -c loop_apply.c -o loop_apply.o
clang++ -I/opt/R-3.4.1/include -DNDEBUG -I"/home/isomorphismes/R/i686-pc-linux-gnu-library/3.4/Rcpp/include" -I/usr/local/include -fpic -I/opt/boost_1_61_0/boost -c split-numeric.cpp -o split-numeric.o
clang++ -shared -L/usr/local/lib -o plyr.so RcppExports.o loop_apply.o split-numeric.o
loop_apply.o: file not recognized: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/opt/R-3.4.1/share/make/shlib.mk:6: recipe for target 'plyr.so' failed
make: *** [plyr.so] Error 1
ERROR: compilation failed for package ‘plyr’
* removing ‘/home/cd/R/i686-pc-linux-gnu-library/3.4/plyr’
The *.o files are in /opt/plyr/src, from github.com/hadley/plyr. They look like this on my system:
i#scheherezade:/opt/plyr/src$ file *o
loop_apply.o: LLVM IR bitcode
RcppExports.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
split-numeric.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
In case you didn't know, -flto specifies link time optimization, and has been added by R. How did you manage to end up with such a mis-configured R install?
Adding -flto to the link command may work? Or remove it from the loop_apply compilation line. If either of those works, you need to fix your R install.
Compiling with -flto using clang requires (on Ubuntu) installing the llvm-dev package. Otherwise, the linker is unable to handle -flto object files.
apt-get install clang-10 llvm-10-dev
Now the linking should succeed.

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?

Resources