Compilation error when trying to install the Rcplex package in R - r
I've already installed the CplexApi package using the following guide: https://www.r-bloggers.com/using-cplex-in-r-installing-cplexapi-in-windows-10/
I'm now trying to install the Rcplex package in a simillar way. I've edited the makevars.win file to the following:
ifeq "$(WIN)" "64"
PKG_LIBS = -L"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/x64_win64" -lcplex1280 -lm
PKG_CPPFLAGS = -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include"
else
PKG_LIBS = -L"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/bin/x86_win32" -lcplex1280 -lm
PKG_CPPFLAGS = -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include"
endif
I then entered the following in CMD:
C:\Users\A>R CMD build --no-build-vignettes --no-manual --md5 C:\Users\A\Downloads\cPlex\Rcplex_0.3-3.tar\Rcplex_0.3-3\Rcplex
And this was the output:
* checking for file 'C:\Users\A\Downloads\cPlex\Rcplex_0.3-3.tar\Rcplex_0.3-3\Rcplex/DESCRIPTION' ... OK
* preparing 'Rcplex':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* adding MD5 file
* building 'Rcplex_0.3-3.tar.gz'
Warning: file 'Rcplex/cleanup' did not have execute permissions: corrected
Warning: file 'Rcplex/configure' did not have execute permissions: corrected`
Then I entered the following:
C:\Users\A>R CMD INSTALL --build --no-multiarch .\Rcplex_0.3-3.tar.gz
And I got this as the output:
In R CMD INSTALL
* installing to library 'C:/Users/A/Documents/R/win-library/3.5'
* installing *source* package 'Rcplex' ...
** package 'Rcplex' successfully unpacked and MD5 sums checked
** libs
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include" -O2 -Wall -std=gnu99 -mtune=generic -c Rcplex.c -o Rcplex.o
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include" -O2 -Wall -std=gnu99 -mtune=generic -c Rcplex_QCP.c -o Rcplex_QCP.o
Rcplex_QCP.c: In function 'Rcplex_QCP':
Rcplex_QCP.c:37:7: warning: unused variable 'trace' [-Wunused-variable]
int trace = INTEGER(getListElement(control,"trace"))[0];
^
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include" -O2 -Wall -std=gnu99 -mtune=generic -c Rcplex_params.c -o Rcplex_params.o
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -D_LP64 -I"C:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/include" -O2 -Wall -std=gnu99 -mtune=generic -c Rcplex_utils.c -o Rcplex_utils.o
c:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o Rcplex.dll tmp.def Rcplex.o Rcplex_QCP.o Rcplex_params.o Rcplex_utils.o -LC:/Program Files/IBM/ILOG/CPLEX_Studio128/cplex/x64_win64 -lcplex1280 -lm -LC:/PROGRA~1/R/R-35~1.0/bin/x64 -lR
C:/Rtools/mingw_64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcplex1280
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'Rcplex'
* removing 'C:/Users/A/Documents/R/win-library/3.5/Rcplex'
I'm wondering what exactly I did wrong?
Related
Cannot install packages kerndwd, sdwd, and flare packages in R for Caret Machine Learning Requirements
I'm trying to install these packages as a machine learning requirements for Caret, below is the snippets to try to install it: library(devtools) ==============kerndwd=========================== install.packages("kerndwd") install_url("https://cran.r-project.org/src/contrib/Archive/kerndwd/kerndwd_2.0.2.tar.gz") * installing *source* package 'kerndwd' ... ** using staged installation ** libs *** arch - i386 C:/Rtools/mingw_32/bin/gfortran -O3 -mtune=generic -c dwd.f90 -o dwd.o make: C:/Rtools/mingw_32/bin/gfortran: Command not found make: *** [C:/PROGRA~1/R/R-36~1.1/etc/i386/Makeconf:236: dwd.o] Error 127 ERROR: compilation failed for package 'kerndwd' * removing 'C:/Users/User/Documents/R/win-library/3.6/kerndwd' Error: Failed to install 'unknown package' from URL: (converted from warning) installation of package ‘C:/Users/User/AppData/Local/Temp/RtmpgnwPZl/filed8c47c72cf0/kerndwd_2.0.2.tar.gz’ had non-zero exit status ==============sdwd============================== install.packages("sdwd") install_url("https://cran.r-project.org/src/contrib/Archive/sdwd/sdwd_1.0.3.tar.gz") * installing *source* package 'sdwd' ... ** using staged installation ** libs *** arch - i386 C:/Rtools/mingw_32/bin/gfortran -O3 -mtune=generic -c auxiliary.f90 -o auxiliary.o make: C:/Rtools/mingw_32/bin/gfortran: Command not found make: *** [C:/PROGRA~1/R/R-36~1.1/etc/i386/Makeconf:236: auxiliary.o] Error 127 ERROR: compilation failed for package 'sdwd' * removing 'C:/Users/User/Documents/R/win-library/3.6/sdwd' Error: Failed to install 'unknown package' from URL: (converted from warning) installation of package ‘C:/Users/User/AppData/Local/Temp/RtmpgnwPZl/filed8c43f746c9/sdwd_1.0.3.tar.gz’ had non-zero exit status ============flare============================= install.packages("flare") install_url("https://cran.r-project.org/src/contrib/Archive/flare/flare_1.6.0.tar.gz") C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c SFGen.c -o SFGen.o sh: C:/Rtools/mingw_32/bin/gcc: No such file or directory make: *** [C:/PROGRA~1/R/R-36~1.1/etc/i386/Makeconf:208: SFGen.o] Error 127 ERROR: compilation failed for package 'flare' * removing 'C:/Users/User/Documents/R/win-library/3.6/flare' Can anyone clarify me if the package are broken, or is there some way to install it correctly? (Edit) RTools Path Sys.which("make") make "C:\\rtools40\\usr\\bin\\make.exe" Rtools Folder (EDIT 2) It seems that I don't install Rtools completely, Reinstalled Rtools properly with Both 32 Bit and 64 Bit ready for building Packages, and then try to reinstall the packages, kerndwd and sdwd packages already successfully installed, but not with flare packages.. here is the log when I try to install the flare packages > install_url("https://cran.r-project.org/src/contrib/Archive/flare/flare_1.6.0.tar.gz") Downloading package from url: https://cran.r-project.org/src/contrib/Archive/flare/flare_1.6.0.tar.gz √ checking for file 'C:\Users\User\AppData\Local\Temp\RtmpIvesYl\remotes1978219737bd\flare/DESCRIPTION' (5.5s) - preparing 'flare': √ checking DESCRIPTION meta-information ... - cleaning src √ checking vignette meta-information - checking for LF line-endings in source and make files and shell scripts (507ms) - checking for empty or unneeded directories - looking to see if a 'data/datalist' file should be added - building 'flare_1.6.0.tar.gz' Installing package into ‘C:/Users/User/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified) * installing *source* package 'flare' ... ** using staged installation ** libs *** arch - i386 C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c SFGen.c -o SFGen.o C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c euc_proj.c -o euc_proj.o C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c mymath.c -o mymath.o mymath.c: In function 'max_fabs_vc': mymath.c:141:11: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int i,cnt; ^ C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c registerDynamicSymbol.c -o registerDynamicSymbol.o C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c slim_dantzig_ladm_scr.c -o slim_dantzig_ladm_scr.o slim_dantzig_ladm_scr.c: In function 'slim_dantzig_ladm_scr': slim_dantzig_ladm_scr.c:262:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda; ^ slim_dantzig_ladm_scr.c:261:15: warning: variable 'ndata' set but not used [-Wunused-but-set-variable] int j,k,m,ndata,dim,nlambda,ite1,ite2,ite,max_ite0,max_ite1,max_ite2,num_scr,num_scr1,num_scr2,num_scr1_tmp,num_scr2_tmp,flag,flag1,flag2; ^ slim_dantzig_ladm_scr.c: In function 'slim_dantzig_ladm_scr2': slim_dantzig_ladm_scr.c:411:21: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,rho,zero,eps,eps1,ilambda; ^ slim_dantzig_ladm_scr.c:410:15: warning: variable 'ndata' set but not used [-Wunused-but-set-variable] int j,k,m,ndata,dim,nlambda,ite1,ite,max_ite0,max_ite1,num_scr,num_scr1,num_scr1_tmp,flag,flag1; ^ C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c slim_lad_ladm_scr_btr.c -o slim_lad_ladm_scr_btr.o slim_lad_ladm_scr_btr.c: In function 'slim_lad_ladm_scr_btr': slim_lad_ladm_scr_btr.c:236:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda,nrholamb; ^ C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c slim_lasso_ladm_scr.c -o slim_lasso_ladm_scr.o slim_lasso_ladm_scr.c: In function 'lasso_ladm_scr': slim_lasso_ladm_scr.c:12:58: warning: variable 'epsT' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,beta_dif,threshold,tmpd,ratio,epsT; ^ slim_lasso_ladm_scr.c:12:52: warning: variable 'ratio' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,beta_dif,threshold,tmpd,ratio,epsT; ^ slim_lasso_ladm_scr.c: In function 'slim_lasso_ladm_scr': slim_lasso_ladm_scr.c:183:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda; ^ C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c slim_lq_ladm_scr_btr.c -o slim_lq_ladm_scr_btr.o slim_lq_ladm_scr_btr.c: In function 'slim_lq_ladm_scr_btr': slim_lq_ladm_scr_btr.c:242:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda,nrholamb,qrtn; ^ C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c slim_sqrt_ladm_scr.c -o slim_sqrt_ladm_scr.o slim_sqrt_ladm_scr.c: In function 'sqrt_ladm_scr': slim_sqrt_ladm_scr.c:12:92: warning: variable 'epsT' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,alp_dif,beta_dif,mu_dif,threshold,tmpd,alp_tild_sq,alp_th,ratio,epsT; ^ slim_sqrt_ladm_scr.c:12:86: warning: variable 'ratio' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,alp_dif,beta_dif,mu_dif,threshold,tmpd,alp_tild_sq,alp_th,ratio,epsT; ^ slim_sqrt_ladm_scr.c: In function 'slim_sqrt_ladm_scr': slim_sqrt_ladm_scr.c:285:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda,sqrtn,nrholamb; ^ C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c slimh.c -o slimh.o C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c sugm_clime_ladm_scr.c -o sugm_clime_ladm_scr.o sugm_clime_ladm_scr.c: In function 'sugm_clime_ladm_scr': sugm_clime_ladm_scr.c:11:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda; ^ C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O3 -Wall -std=gnu99 -mtune=generic -c sugm_tiger_ladm_scr.c -o sugm_tiger_ladm_scr.o sugm_tiger_ladm_scr.c: In function 'tiger_lasso_ladm_scr': sugm_tiger_ladm_scr.c:12:58: warning: variable 'epsT' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,beta_dif,threshold,tmpd,ratio,epsT,tau0,tau1,tmp; ^ sugm_tiger_ladm_scr.c:12:52: warning: variable 'ratio' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,beta_dif,threshold,tmpd,ratio,epsT,tau0,tau1,tmp; ^ sugm_tiger_ladm_scr.c: In function 'sugm_tiger_ladm_scr': sugm_tiger_ladm_scr.c:205:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda,sqrtn,nrholamb,tau0; ^ C:/Rtools/mingw_32/bin/gcc -shared -s -static-libgcc -o flare.dll tmp.def SFGen.o euc_proj.o mymath.o registerDynamicSymbol.o slim_dantzig_ladm_scr.o slim_lad_ladm_scr_btr.o slim_lasso_ladm_scr.o slim_lq_ladm_scr_btr.o slim_sqrt_ladm_scr.o slimh.o sugm_clime_ladm_scr.o sugm_tiger_ladm_scr.o -LC:/PROGRA~1/R/R-36~1.1/bin/i386 -lR installing to C:/Users/User/Documents/R/win-library/3.6/00LOCK-flare/00new/flare/libs/i386 *** arch - x64 C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c SFGen.c -o SFGen.o C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c euc_proj.c -o euc_proj.o C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c mymath.c -o mymath.o mymath.c: In function 'max_fabs_vc': mymath.c:141:11: warning: variable 'cnt' set but not used [-Wunused-but-set-variable] int i,cnt; ^ C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c registerDynamicSymbol.c -o registerDynamicSymbol.o C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c slim_dantzig_ladm_scr.c -o slim_dantzig_ladm_scr.o slim_dantzig_ladm_scr.c: In function 'slim_dantzig_ladm_scr': slim_dantzig_ladm_scr.c:262:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda; ^ slim_dantzig_ladm_scr.c:261:15: warning: variable 'ndata' set but not used [-Wunused-but-set-variable] int j,k,m,ndata,dim,nlambda,ite1,ite2,ite,max_ite0,max_ite1,max_ite2,num_scr,num_scr1,num_scr2,num_scr1_tmp,num_scr2_tmp,flag,flag1,flag2; ^ slim_dantzig_ladm_scr.c: In function 'slim_dantzig_ladm_scr2': slim_dantzig_ladm_scr.c:411:21: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,rho,zero,eps,eps1,ilambda; ^ slim_dantzig_ladm_scr.c:410:15: warning: variable 'ndata' set but not used [-Wunused-but-set-variable] int j,k,m,ndata,dim,nlambda,ite1,ite,max_ite0,max_ite1,num_scr,num_scr1,num_scr1_tmp,flag,flag1; ^ C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c slim_lad_ladm_scr_btr.c -o slim_lad_ladm_scr_btr.o slim_lad_ladm_scr_btr.c: In function 'slim_lad_ladm_scr_btr': slim_lad_ladm_scr_btr.c:236:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda,nrholamb; ^ C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c slim_lasso_ladm_scr.c -o slim_lasso_ladm_scr.o slim_lasso_ladm_scr.c: In function 'lasso_ladm_scr': slim_lasso_ladm_scr.c:12:58: warning: variable 'epsT' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,beta_dif,threshold,tmpd,ratio,epsT; ^ slim_lasso_ladm_scr.c:12:52: warning: variable 'ratio' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,beta_dif,threshold,tmpd,ratio,epsT; ^ slim_lasso_ladm_scr.c: In function 'slim_lasso_ladm_scr': slim_lasso_ladm_scr.c:183:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda; ^ C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c slim_lq_ladm_scr_btr.c -o slim_lq_ladm_scr_btr.o slim_lq_ladm_scr_btr.c: In function 'slim_lq_ladm_scr_btr': slim_lq_ladm_scr_btr.c:242:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda,nrholamb,qrtn; ^ C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c slim_sqrt_ladm_scr.c -o slim_sqrt_ladm_scr.o slim_sqrt_ladm_scr.c: In function 'sqrt_ladm_scr': slim_sqrt_ladm_scr.c:12:92: warning: variable 'epsT' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,alp_dif,beta_dif,mu_dif,threshold,tmpd,alp_tild_sq,alp_th,ratio,epsT; ^ slim_sqrt_ladm_scr.c:12:86: warning: variable 'ratio' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,alp_dif,beta_dif,mu_dif,threshold,tmpd,alp_tild_sq,alp_th,ratio,epsT; ^ slim_sqrt_ladm_scr.c: In function 'slim_sqrt_ladm_scr': slim_sqrt_ladm_scr.c:285:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda,sqrtn,nrholamb; ^ C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c slimh.c -o slimh.o C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c sugm_clime_ladm_scr.c -o sugm_clime_ladm_scr.o sugm_clime_ladm_scr.c: In function 'sugm_clime_ladm_scr': sugm_clime_ladm_scr.c:11:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda; ^ C:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-36~1.1/include" -DNDEBUG -O2 -Wall -std=gnu99 -mtune=generic -c sugm_tiger_ladm_scr.c -o sugm_tiger_ladm_scr.o sugm_tiger_ladm_scr.c: In function 'tiger_lasso_ladm_scr': sugm_tiger_ladm_scr.c:12:58: warning: variable 'epsT' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,beta_dif,threshold,tmpd,ratio,epsT,tau0,tau1,tmp; ^ sugm_tiger_ladm_scr.c:12:52: warning: variable 'ratio' set but not used [-Wunused-but-set-variable] double gap_ext,max_dif,beta_dif,threshold,tmpd,ratio,epsT,tau0,tau1,tmp; ^ sugm_tiger_ladm_scr.c: In function 'sugm_tiger_ladm_scr': sugm_tiger_ladm_scr.c:205:24: warning: variable 'zero' set but not used [-Wunused-but-set-variable] double T,T1,T2,rho,zero,eps,eps1,eps2,ilambda,sqrtn,nrholamb,tau0; ^ C:/Rtools/mingw_64/bin/gcc -shared -s -static-libgcc -o flare.dll tmp.def SFGen.o euc_proj.o mymath.o registerDynamicSymbol.o slim_dantzig_ladm_scr.o slim_lad_ladm_scr_btr.o slim_lasso_ladm_scr.o slim_lq_ladm_scr_btr.o slim_sqrt_ladm_scr.o slimh.o sugm_clime_ladm_scr.o sugm_tiger_ladm_scr.o -LC:/PROGRA~1/R/R-36~1.1/bin/x64 -lR installing to C:/Users/User/Documents/R/win-library/3.6/00LOCK-flare/00new/flare/libs/x64 ** R ** data ** inst ** byte-compile and prepare package for lazy loading Error: (converted from warning) package 'lattice' was built under R version 3.6.3 Execution halted ERROR: lazy loading failed for package 'flare' * removing 'C:/Users/User/Documents/R/win-library/3.6/flare' Error: Failed to install 'unknown package' from URL: (converted from warning) installation of package ‘C:/Users/User/AppData/Local/Temp/RtmpIvesYl/file1978444e5b5a/flare_1.6.0.tar.gz’ had non-zero exit status
By using publicated archived binaries in https://mran.microsoft.com/timemachine, if there contains old package in the time machine, even package flare can be installed using renv installer with format package#version install.packages("renv") renv::install("flare#1.6.0")
Trouble installing rcpp package on R server- Suse 12 SP3 - R-3.3.2
I am very new to R language. Being an admin I am setting up an rserver and installing the required packages for my use of this R server with SAP HANA 1.0. The fundamental problem here is when i am installing the rcpp.0.12.16 and getting the below error. g++ is 4.8-6.189. Are there an incompatibilities witht the OS version R version and rccp package i am using? Please help resolving this issue. > setwd("/Media/R/R_indep_pack") > install.packages("Rcpp_0.12.16.tar.gz",repos = NULL, type="source") * installing *source* package ‘Rcpp’ ... ** package ‘Rcpp’ successfully unpacked and MD5 sums checked ** libs g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ - I/usr/local/include -fPIC -c Date.cpp -o Date.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ - I/usr/local/include -fPIC -c Module.cpp -o Module.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ - I/usr/local/include -fPIC -c Rcpp_init.cpp -o Rcpp_init.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ - I/usr/local/include -fPIC -c api.cpp -o api.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ - I/usr/local/include -fPIC -c attributes.cpp -o attributes.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ - I/usr/local/include -fPIC -c barrier.cpp -o barrier.o g++ -L/usr/local/lib64/R/lib -L/usr/local/lib64 -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -L/usr/local/lib64/R/lib -lR /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/crt1.o: In function `_start': /home/abuild/rpmbuild/BUILD/glibc-2.22/csu/../sysdeps/x86_64/start.S:114: undefined reference to `main' collect2: error: ld returned 1 exit status /usr/local/lib64/R/share/make/shlib.mk:6: recipe for target 'Rcpp.so' failed make: *** [Rcpp.so] Error 1 ERROR: compilation failed for package ‘Rcpp’ * removing ‘/usr/local/lib64/R/library/Rcpp’ Warning message: In install.packages("Rcpp_0.12.16.tar.gz", repos = NULL, type = "source") : installation of package ‘Rcpp_0.12.16.tar.gz’ had non-zero exit status >
Your linker is looking for a main function since it is not told to build a shared library: g++ -L/usr/local/lib64/R/lib -L/usr/local/lib64 -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -L/usr/local/lib64/R/lib -lR Here a -shared is missing from the command line. The command line flags used here are defined via the Makevars file: $ grep SHLIB.*LDFLAGS $(R RHOME)/etc/Makeconf SHLIB_CXXLDFLAGS = -shared SHLIB_CXX98LDFLAGS = -shared SHLIB_CXX11LDFLAGS = -shared SHLIB_CXX14LDFLAGS = -shared SHLIB_CXX17LDFLAGS = -shared SHLIB_FCLDFLAGS = -shared SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS) SHLIB_LINK = $(SHLIB_LD) $(SHLIB_LDFLAGS) $(LIBR0) $(LDFLAGS) SHLIB_CXX1XLDFLAGS = -shared Either these are incorrectly set on your system or you are overriding them via ~/.R/Makevars.
In ubuntu, in such situation, I would search for apt search rcpp # search in central repository for \ # packages for R packages In this case, this leads to 'r-cran-rcpp' package which I then install with sudo apt install r-cran-rcpp (such packages from 'r-cran-' help, because they install for you the further dependencies in the system - which are often dependencies outside of R - automatically for you. E.g. some packages require java or some other system libraries.). Similarly, you have to search in rpm or yast2 repos for rcpp packages. I found googling http://rpmfind.net/linux/rpm2html/search.php?query=R-Rcpp or http://rpm.pbone.net/index.php3/stat/4/idpl/33595438/dir/opensuse/com/R-RcppArmadillo-0.4.450.1.0-2.38.i586.rpm.html Or: if you are using conda: conda install -c r r-rcpp would definitely help ... If you don't know conda: This tutorial is super! https://www.youtube.com/watch?v=YJC6ldI3hWk Just spend 11 minutes and you will be able to use conda! (With conda, you can install several R versions with all their packages in parallel in your system - sometimes you need that because some versions are not compativle with some R packages - conda creates for you different local environments within which you can install programs with all their specific dependencies. And you can switch between the environments.) I definitely recommend you to use conda. Because this solves many package dependency problems.
Unable to install R packages because of problems with Rcpp
To reproduce: Follow the instructions in the README of https://github.com/yencarnacion/GCP-jupyter-notebook open an R jupyter notebook and execute: system("mkdir -p ~/anaconda3/lib/R/library", intern=TRUE) system("echo R_LIBS=~/anaconda3/lib/R/library > ~/.Renviron", intern=TRUE) * Then do a Kernel>Restart and in the first cell of your notebook put: .libPaths("~/anaconda3/lib/R/library") as user ubuntu do: wget https://cran.rstudio.com/src/contrib/Rcpp_0.12.10.tar.gz as user ubuntu do: /usr/lib/anaconda/lib/R/bin/R CMD INSTALL --library=~/anaconda3/lib/R/library Rcpp_0.12.10.tar.gz This is the output I get from /usr/lib/anaconda/lib/R/bin/R CMD INSTALL --library=~/anaconda3/lib/R/library Rcpp_0.12.10.tar.gz: * installing *source* package ‘Rcpp’ ... ** package ‘Rcpp’ successfully unpacked and MD5 sums checked ** libs g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include -fpic -I/usr/lib/anaconda/include -c Date.cpp -o Date.o g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include -fpic -I/usr/lib/anaconda/include -c Module.cpp -o Module.o g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include -fpic -I/usr/lib/anaconda/include -c Rcpp_init.cpp -o Rcpp_init.o g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include -fpic -I/usr/lib/anaconda/include -c api.cpp -o api.o g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include -fpic -I/usr/lib/anaconda/include -c attributes.cpp -o attributes.o g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include -fpic -I/usr/lib/anaconda/include -c barrier.cpp -o barrier.o g++ -shared -L/usr/lib/anaconda/lib/R/lib -L/usr/lib/anaconda/lib -lgfortran -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -L/usr/lib/anaconda/lib/R/lib -lR installing to /home/ubuntu/anaconda3/lib/R/library/Rcpp/libs ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/ubuntu/anaconda3/lib/R/library/Rcpp/libs/Rcpp.so': /home/ubuntu/anaconda3/lib/R/library/Rcpp/libs/Rcpp.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev Error: loading failed Execution halted ERROR: loading failed * removing ‘/home/ubuntu/anaconda3/lib/R/library/Rcpp’ Because of the Rcpp problem, I am unable to devtools::install_github('rstudio/leaflet') among other things. Note: This question may be related to Rcpp package in R not install ubuntu 14.04
You can install Rcpp through conda: conda install r-rcpp
Fyi, you can create a Jupyter Notebook for R on GCP in seconds by using GCP's new AI Platform Notebooks. In the GCP console go to AI Notebooks -> New Instance -> Select R. You should be able to install any R packages that you need
R Rcpp install error in R 3.1.0
I want to install Rcpp using install.packages("Rcpp"), but it failed. The error message: * installing *source* package ‘Rcpp’ ... ** package ‘Rcpp’ successfully unpacked and MD5 sums checked ** libs g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c Date.cpp -o Date.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c Module.cpp -o Module.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c Rcpp_init.cpp -o Rcpp_init.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c api.cpp -o api.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c attributes.cpp -o attributes.o g++ -I/usr/local/lib64/R/include -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c barrier.cpp -o barrier.o g++ -shared -L/usr/local/lib64 -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o installing to /home/sethbrin/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/libs ** R ** inst ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/sethbrin/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/libs/Rcpp.so': /home/sethbrin/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp/libs/Rcpp.so: undefined symbol: _ZNSt15basic_streambufIcSt11char_traitsIcEE7seekoffExSt12_Ios_SeekdirSt13_Ios_Openmode Error: loading failed Execution halted ERROR: loading failed * removing ‘/home/sethbrin/R/x86_64-redhat-linux-gnu-library/3.1/Rcpp’ The downloaded source packages are in ‘/tmp/Rtmp6PKB8N/downloaded_packages’ Warning message: In install.packages("Rcpp") : installation of package ‘Rcpp’ had non-zero exit status Then I use c++fit _ZNSt15basic_streambufIcSt11char_traitsIcEE7seekoffExSt12_Ios_SeekdirSt13_Ios_Openmode std::basic_streambuf<char, std::char_traits<char> >::seekoff(long long, std::_Ios_Seekdir, std::_Ios_Openmode) I have searched for some solutions for that. It seems that it is because of the gcc version. But I don't know how to change the gcc version that R uses to compile Rcpp package.
CRAN tests Rcpp just like any other of the (by now) 6700+ package. You can see the aggregate test report and the test setups includes two Fedora-based machines: one fedora setup using clang and one fedora setup using g++. As such your problems are possibly local, or simply due to using an older setup. In which case the Archive section gives you access to an older version.
I've encountered a similar problem. And after some searches, here are the solutions to alter the compiler: 1. If you have the root privilege: I found that the Makeconf file in R directory actually sets all the information that is needed for compilation. To find the path to it, echo which R in the command line. e.g. I got like: /data/apps/R/3.1.2/bin/R And then the file is in: /data/apps/R/3.1.2/lib64/R/etc/Makeconf then sudo edit the file on line CC = XXX and maybe more relative lines. Problem solved! 2. If you only have local user privilege. Add your own configurations to ~/.R/Makevars However, #Dirk is probably right. For me, I finally solved my problem by adding -Doff_t=__off_t to CFLAGS (My problem was error: unknown type name 'off_t'). And I got the halted error when I manually altered parts of the compilers...
R shiny Ubuntu 12.04 installation instructions fail when installing Rcpp needed by R shiny library in R 3.0.2
I am trying to install an R shiny server on my local Ubuntu 12.04 machine, and I followed the instructions here https://github.com/rstudio/shiny-server/wiki/Ubuntu-step-by-step-install-instructions: When trying to do a: install.packages('shiny', repos='http://cran.rstudio.com/') It goes through the dependencies, but fails to install Rcpp. See error log below: * installing *source* package 'Rcpp' ... * package 'Rcpp' successfully unpacked and MD5 sums checked * libs g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Date.cpp -o Date.o g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Module.cpp -o Module.o gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Rcpp_init.c -o Rcpp_init.o g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c Timer.cpp -o Timer.o g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c api.cpp -o api.o g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c attributes.cpp -o attributes.o g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c barrier.cpp -o barrier.o g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -O3 -pipe -g -c exceptions.cpp -o exceptions.o g++ -shared -o Rcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -L/usr/lib/R/lib -lR g++ -o libRcpp.so Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o -shared -L/usr/lib/R/lib -lR ar qc libRcpp.a Date.o Module.o Rcpp_init.o Timer.o api.o attributes.o barrier.o exceptions.o cp libRcpp.so ../inst/lib cp libRcpp.a ../inst/lib rm libRcpp.so libRcpp.a installing to /usr/local/lib/R/site-library/Rcpp/libs * R * inst * preparing package for lazy loading Error : package 'codetools' was built before R 3.0.0: please re-install it Error : unable to load R code in package 'Rcpp' ERROR: lazy loading failed for package 'Rcpp' * removing '/usr/local/lib/R/site-library/Rcpp' * installing *source* package 'httpuv' ... * package 'httpuv' successfully unpacked and MD5 sums checked * libs g++ -I/usr/share/R/include -DNDEBUG -I./libuv/include -I./http-parser -I./sha1 -I./base64 -I"/usr/lib/R/site-library/Rcpp/include" -fpic -O3 -pipe -g -c RcppExports.cpp -o RcppExports.o RcppExports.cpp:75:10: error: 'uint32_t' was not declared in this scope RcppExports.cpp: In function 'SEXPREC* httpuv_run(SEXP)': RcppExports.cpp:79:5: error: 'uint32_t' was not declared in this scope RcppExports.cpp:79:14: error: expected ';' before 'timeoutMillis' RcppExports.cpp:80:25: error: 'timeoutMillis' was not declared in this scope RcppExports.cpp:80:38: error: 'run' cannot be used as a function make: * [RcppExports.o] Error 1 ERROR: compilation failed for package 'httpuv' * removing '/usr/local/lib/R/site-library/httpuv' ERROR: dependency 'httpuv' is not available for package 'shiny' * removing '/usr/local/lib/R/site-library/shiny' EDITED: Manually downloading and installing Rcpp gives me: sudo R CMD INSTALL Rcpp_0.10.6.tar.gz Error : package 'codetools' was built before R 3.0.0: please re-install it So I manually downloaded and installed codetools and re-tried Rcpp: sudo R CMD INSTALL codetools_0.2-8.tar.gz sudo R CMD INSTALL Rcpp_0.10.6.tar.gz Then followed the instructions again from the Shiny webpage from "Install R" and "Install shiny" and got a similar error but now with caTools, bitops and xtable, so I did the manual installation of each of them. The shiny was installed correctly. Then followed the next steps in the instructions. Any ideas why I got this 'was built before R 3.0.0' errors?
Ubuntu 12.04 is a pre-R 3.0.0 release. You have to decide whether you want its long-term support and stability "as is", or if you want newer software. You can mix and match. Read the CRAN Ubuntu README, adjust your apt settings and enjoy updated r-cran-* packages. With those you can then install shiny and its dependencies.
Manually downloading and installing Rcpp gives me: sudo R CMD INSTALL Rcpp_0.10.6.tar.gz Error : package 'codetools' was built before R 3.0.0: please re-install it So I manually downloaded and installed codetools and re-tried Rcpp: sudo R CMD INSTALL codetools_0.2-8.tar.gz sudo R CMD INSTALL Rcpp_0.10.6.tar.gz Then followed the instructions again from the Shiny webpage from "Install R" and "Install shiny" and got a similar error but now with caTools, bitops and xtable, so I did the manual installation of each of them. The shiny was installed correctly. Then followed the next steps in the instructions. All went well from there. Not sure why I was getting these was built before 3.0.0 errors.