Having installation issues with RcppParallel ( R) - r

I am a newbie/student to rstanarm and I having issues installing RcppParallel.
I have tried devtools::install_github("RcppCore/RcppParallel") and
install.packages("RcppParallel", dependencies = TRUE) and I am still getting non-zero errors. Any help would be very much appreciated. Error script is pasted below. Thank you. Also, I use windows (not sure if that is needed info).
The downloaded source packages are in
‘C:\Users\X \AppData\Local\Temp\RtmpGEF6un\downloaded_packages’
> install.packages("RcppParallel", dependencies = TRUE)
Installing package into ‘C:/Users/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
There is a binary version available but the source
version is later:
binary source needs_compilation
RcppParallel 5.0.2 5.0.3 TRUE
installing the source package ‘RcppParallel’
trying URL 'https://cran.rstudio.com/src/contrib/RcppParallel_5.0.3.tar.gz'
Content type 'application/x-gzip' length 1469709 bytes (1.4 MB)
downloaded 1.4 MB
* installing *source* package 'RcppParallel' ...
** package 'RcppParallel' successfully unpacked and MD5 sums checked
** using staged installation
** preparing to configure package 'RcppParallel' ...
*** configured file: 'src/Makevars.in' => 'src/Makevars'
** finished configure for package 'RcppParallel'
** libs
*** arch - i386
Created ../build/lib_release directory
../../build/Makefile.tbb:32: CONFIG: cfg=release arch=ia32 compiler=gcc target=windows runtime=mingw
sh: C:/Users/Documents/R: Is a directory
make[2]: *** [../../build/common_rules.inc:119: concurrent_hash_map.o] Error 126
make[1]: *** [Makefile:104: tbb_release] Error 2
cp: cannot stat 'tbb/build/lib_release/tbb*.dll': No such file or directory
make: *** [Makevars:100: tbb] Error 1
ERROR: compilation failed for package 'RcppParallel'
* removing 'C:/Users/Documents/R/win-library/4.0/RcppParallel'
Warning in install.packages :
installation of package ‘RcppParallel’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\AppData\Local\Temp\RtmpGEF6un\downloaded_packages’

Related

R installation of package "BRugs" is failing for Windows 11 64 bit installation

Hi so i'm trying to install R package "BRugs" and it is having an issue finding the Makeconf file. I do have Rtools installed
Sys.which("make")
make
"C:\\RBUILD~1\\4.2\\usr\\bin\\make.exe"
My R_HOME is located here
R.home(component = 'home')
[1] "C:/PROGRA~1/R/R-42~1.2"
But i guess this install can not find the MakeConf file within "etc" folder?
* installing *source* package 'BRugs' ...
** package 'BRugs' successfully unpacked and MD5 sums checked
** using staged installation
** libs
running 'src/Makefile.win' ...
Makefile.win:1: C:/PROGRA~1/R/R-42~1.2/etc/i386/Makeconf: No such file or directory
make: *** No rule to make target 'C:/PROGRA~1/R/R-42~1.2/etc/i386/Makeconf'. Stop.
ERROR: compilation failed for package 'BRugs'
* removing 'C:/Users/antho/AppData/Local/R/win-library/4.2.2/BRugs'
Warning in install.packages :
installation of package ‘BRugs’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\antho\AppData\Local\Temp\Rtmpo58u6i\downloaded_packages’
>
install.packages("C:/Users/antho/Downloads/BRugs_0.9-1.tar.gz", repos = NULL, type = "source")
Installing package into ‘C:/Users/antho/AppData/Local/R/win-library/4.2.2’
(as ‘lib’ is unspecified)
* installing *source* package 'BRugs' ...
** package 'BRugs' successfully unpacked and MD5 sums checked
** using staged installation
** libs
running 'src/Makefile.win' ...
Makefile.win:1: C:/PROGRA~1/R/R-42~1.2/etc/i386/Makeconf: No such file or directory
make: *** No rule to make target 'C:/PROGRA~1/R/R-42~1.2/etc/i386/Makeconf'. Stop.
ERROR: compilation failed for package 'BRugs'
* removing 'C:/Users/antho/AppData/Local/R/win-library/4.2.2/BRugs'
Warning in install.packages :
installation of package ‘C:/Users/antho/Downloads/BRugs_0.9-1.tar.gz’ had non-zero exit status
The error is related to this path "C:/PROGRA~1/R/R-42~1.2/etc/i386/"
list.dirs(paste0(R.home(component='home'),"/etc"))
[1] "C:/PROGRA~1/R/R-42~1.2/etc" "C:/PROGRA~1/R/R-42~1.2/etc/x64"
it looks like my etc folder is missing the expected "i386" folder? any suggestions will be greatly appreciated.
Do i need to edit my .Rprofile.site file?

Error when installing brms package in R - bayesplot cannot be installed

I am trying to install the R package brms on my Ubuntu 22.04 LTS computer. My R version is 4.2.2 and I am using RStudio RStudio 2022.07.2 "Spotted Wakerobin".
rstan is installed and I have successfully verified the installation. My stan version is 2.21.0.
When I try installing brms in RStudio this is the output:
> install.packages("brms")
Installing package into ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘bayesplot’, ‘shinystan’, ‘bridgesampling’, ‘nleqslv’
trying URL 'https://cloud.r-project.org/src/contrib/bayesplot_1.10.0.tar.gz'
Content type 'application/x-gzip' length 4993447 bytes (4.8 MB)
==================================================
downloaded 4.8 MB
trying URL 'https://cloud.r-project.org/src/contrib/shinystan_2.6.0.tar.gz'
Content type 'application/x-gzip' length 2399890 bytes (2.3 MB)
==================================================
downloaded 2.3 MB
trying URL 'https://cloud.r-project.org/src/contrib/bridgesampling_1.1-2.tar.gz'
Content type 'application/x-gzip' length 1679600 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
trying URL 'https://cloud.r-project.org/src/contrib/nleqslv_3.3.3.tar.gz'
Content type 'application/x-gzip' length 84686 bytes (82 KB)
==================================================
downloaded 82 KB
trying URL 'https://cloud.r-project.org/src/contrib/brms_2.18.0.tar.gz'
Content type 'application/x-gzip' length 4486548 bytes (4.3 MB)
==================================================
downloaded 4.3 MB
* installing *source* package ‘bayesplot’ ...
** package ‘bayesplot’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in element_line(linewidth = 0.3) :
unused argument (linewidth = 0.3)
Error: unable to load R code in package ‘bayesplot’
Execution halted
ERROR: lazy loading failed for package ‘bayesplot’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/bayesplot’
Warning in install.packages :
installation of package ‘bayesplot’ had non-zero exit status
* installing *source* package ‘bridgesampling’ ...
** package ‘bridgesampling’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (bridgesampling)
* installing *source* package ‘nleqslv’ ...
** package ‘nleqslv’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/usr/share/R/include" -DNDEBUG -I"/usr/lib/R/site-library/Rcpp/include/" -I"/usr/lib/R/site-library/RcppEigen/include/" -I"/usr/lib/R/site-library/RcppEigen/include/unsupported" -I"/usr/lib/R/site-library/BH/include" -I"/usr/lib/R/site-library/StanHeaders/include/src/" -I"/usr/lib/R/site-library/StanHeaders/include/" -I"/usr/lib/R/site-library/RcppParallel/include/" -I"/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/rstan/include" -DEIGEN_NO_DEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -DSTAN_THREADS -DBOOST_NO_AUTO_PTR -include '/usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp' -D_REENTRANT -DRCPP_PARALLEL_USE_TBB=1 -fpic -g -O2 -ffile-prefix-map=/build/r-base-Faorqz/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c init.c -o init.o
In file included from /usr/lib/R/site-library/RcppEigen/include/Eigen/Core:88,
from /usr/lib/R/site-library/RcppEigen/include/Eigen/Dense:1,
from /usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
from <command-line>:
/usr/lib/R/site-library/RcppEigen/include/Eigen/src/Core/util/Macros.h:628:1: error: unknown type name ‘namespace’
628 | namespace Eigen {
| ^~~~~~~~~
/usr/lib/R/site-library/RcppEigen/include/Eigen/src/Core/util/Macros.h:628:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
628 | namespace Eigen {
| ^
In file included from /usr/lib/R/site-library/RcppEigen/include/Eigen/Dense:1,
from /usr/lib/R/site-library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
from <command-line>:
/usr/lib/R/site-library/RcppEigen/include/Eigen/Core:96:10: fatal error: complex: No such file or directory
96 | #include <complex>
| ^~~~~~~~~
compilation terminated.
make: *** [/usr/lib/R/etc/Makeconf:169: init.o] Error 1
ERROR: compilation failed for package ‘nleqslv’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/nleqslv’
Warning in install.packages :
installation of package ‘nleqslv’ had non-zero exit status
ERROR: dependency ‘bayesplot’ is not available for package ‘shinystan’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/shinystan’
Warning in install.packages :
installation of package ‘shinystan’ had non-zero exit status
ERROR: dependencies ‘bayesplot’, ‘shinystan’, ‘nleqslv’ are not available for package ‘brms’
* removing ‘/home/iplank/R/x86_64-pc-linux-gnu-library/4.2/brms’
Warning in install.packages :
installation of package ‘brms’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpS56F1Q/downloaded_packages’
There seems to be a problem when installing bayesplot but I'm not sure how to solve it.
Does anyone have any suggestions?
Just in case someon encounters the same problem:
I installed devtools to be able to install bayesplot directly from github using:
install_github("stan-dev/bayesplot", dependencies = TRUE, build_vignettes = FALSE)
This only worked for me after installing all the packages that throw compilation errors in R directly and not in RStudio.
After bayesplot was installed, I was able to install brms.

R rJava will not install on Windows 10

I am trying to install RWeka in RStudio 1.2.5033
I have tried many different ways to install it, I re-installed Java64. Here is my latest try:
install.packages("rJava")
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Jesse's PC/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
rJava 0.9-12 0.9-13 TRUE
installing the source package ‘rJava’
trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-13.tar.gz'
Content type 'application/x-gzip' length 664898 bytes (649 KB)
downloaded 649 KB
* installing *source* package 'rJava' ...
** package 'rJava' successfully unpacked and MD5 sums checked
** using staged installation
Generate Windows-specific files (src/jvm-w32) ...
make: Entering directory '/c/Users/JESSE'~1/AppData/Local/Temp/RtmpuOekjT/R.INSTALL24344ae86868/rJava/src/jvm-w32'
c:/Rtools/mingw_64/bin/dlltool --as c:/Rtools/mingw_64/bin/as --input-def jvm64.def --kill-at --dllname jvm.dll --output-lib libjvm.dll.a
make: c:/Rtools/mingw_64/bin/dlltool: Command not found
make: *** [Makefile:20: libjvm.dll.a] Error 127
make: Leaving directory '/c/Users/JESSE'~1/AppData/Local/Temp/RtmpuOekjT/R.INSTALL24344ae86868/rJava/src/jvm-w32'
ERROR: configuration failed for package 'rJava'
* removing 'C:/Users/Jesse's PC/Documents/R/win-library/3.6/rJava'
* restoring previous 'C:/Users/Jesse's PC/Documents/R/win-library/3.6/rJava'
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Jesse's PC\AppData\Local\Temp\Rtmps5Y5TC\downloaded_packages’

macos: configure: error: C compiler cannot create executables while install R pachage

I was facing this problem while installing R package devtools. My R studio is in Anaconda, and it's the latest version. The code is this:
install.packages("devtools")
And I got response as follows:
also installing the dependency ‘git2r’
trying URL 'https://cran.rstudio.com/src/contrib/git2r_0.21.0.tar.gz'
Content type 'application/x-gzip' length 1155512 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
trying URL 'https://cran.rstudio.com/src/contrib/devtools_1.13.5.tar.gz'
Content type 'application/x-gzip' length 486555 bytes (475 KB)
==================================================
downloaded 475 KB
* installing *source* package ‘git2r’ ...
** package ‘git2r’ successfully unpacked and MD5 sums checked
checking build system type... x86_64-apple-darwin17.6.0
checking host system type... x86_64-apple-darwin17.6.0
checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/private/var/folders/mh/df2k68vs4g3714qyztvg2y980000gn/T/RtmppuLmjL/R.INSTALL8f6b17805a/git2r':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘git2r’
* removing ‘/Users/nora/anaconda3/lib/R/library/git2r’
Warning in install.packages :
installation of package ‘git2r’ had non-zero exit status
ERROR: dependency ‘git2r’ is not available for package ‘devtools’
* removing ‘/Users/nora/anaconda3/lib/R/library/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/mh/df2k68vs4g3714qyztvg2y980000gn/T/Rtmpyjv9BV/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
To fix this problem, I've tried the following but nothing changed:
check Xcode and command line tools, and make surethe command line tools is the latest version.
update all the anaconda package.
update homebrew
update gcc
restart my laptop.
Now I've installed this package by using this code in terminal:
conda install -c r r-devtools
when I type install.packages("devtools") in my R console, nothing seems wrong and I saw feedback as following:
trying URL 'https://cran.rstudio.com/src/contrib/devtools_1.13.5.tar.gz'
Content type 'application/x-gzip' length 486555 bytes (475 KB)
==================================================
downloaded 475 KB
* installing *source* package ‘devtools’ ...
** package ‘devtools’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (devtools)
The downloaded source packages are in
‘/private/var/folders/mh/df2k68vs4g3714qyztvg2y980000gn/T/Rtmpyjv9BV/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
But I'm not sure whether I still have C compiler problem. If so, I still want to fix that for future's convenience. And still, I don't know why I countered this problem in the first place.

Issue installing rDEA - compilation failed for package

I'm trying to use the package rDEA. I have most recent r version 3.4.4 ("Someone to Lean On"). I'm using most recent R Studio 1.1.423.
I get the error compilation failed for package 'rDEA'. Can anyone help?
Precise details:
install.packages("rDEA")
Package which is only available in source form, and may need
compilation of C/C++/Fortran: ‘rDEA’
Do you want to attempt to install these from sources?
y/n:
I type y, and get the following:
installing the source package ‘rDEA’
trying URL 'https://cran.rstudio.com/src/contrib/rDEA_1.2-5.tar.gz'
Content type 'application/x-gzip' length 57007 bytes (55 KB)
==================================================
downloaded 55 KB
* installing *source* package ‘rDEA’ ...
** package ‘rDEA’ successfully unpacked and MD5 sums checked
** libs
/bin/sh: line 0: cd: GLPK: No such file or directory
make: *** [GLPK.ts] Error 1
ERROR: compilation failed for package ‘rDEA’
* removing
‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rDEA’
Warning in install.packages :
installation of package ‘rDEA’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/b1/_pstgqks0r3gb3t972tk8zh00000gn/T/RtmpuvqGid/downloaded_packages’

Resources