I am trying to install an R package from source:
https://sourceforge.net/projects/pdq-qnm-pkg/files/PDQ-R%20Source/6.1-1/pdq_6.1-1.tar.gz
I cannot install RTools to compile but I have Cygwin. How can install this package from source using Cygwin?
when I do this:
install.packages("pdq_6.1-1.tar.gz",repos=NULL,type="source")
I get this error:
Warning in install.packages :
installation of package ‘PDQ-6.2.0.tar.gz’ had non-zero exit status
Without knowing the failures, you can not solve the issue.
I assume you are missing some tools or libraries.
See http://kbroman.org/pkg_primer/pages/build.html
and try
R CMD INSTALL pdq_6.1-1.tar.gz
On my cygwin system with R-3.2.4
$ R CMD INSTALL pdq_6.1-1.tar.gz
* installing to library ‘/usr/lib/R/site-library’
* installing *source* package ‘pdq’ ...
** libs
gcc -I/usr/lib/R/include -DNDEBUG -D__R_PDQ -ggdb -O2 -pipe -Wimplicit-function-declaration -std=gnu99 -fdebug-prefix-map=/cygdrive/e/cyg_pub/devel/R/R-3.2.4-1.x86_64/build=/usr/src/debug/R-3.2.4-1 -fdebug-prefix-map=/cygdrive/e/cyg_pub/devel/R/R-3.2.4-1.x86_64/src/R-revised=/usr/src/debug/R-3.2.4-1 -c MVA_Approx.c -o MVA_Approx.o
[cut]
gcc -shared -L/usr/lib/R/lib -o pdq.dll MVA_Approx.o MVA_Canon.o MVA_Solve.o PDQ_Build.o PDQ_Exact.o PDQ_Globals.o PDQ_MServer.o PDQ_Report.o PDQ_Utils.o pdq.o -L/usr/lib/R/lib -lR -lintl -lpcre -llzma -lbz2 -lz -ltirpc -lrt -ldl -lm -liconv -licuuc -licui18n
installing to /usr/lib/R/site-library/pdq/libs
** R
** demo
** preparing package for lazy loading
Creating a generic function for ‘print’ from package ‘base’ in package ‘pdq’
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (pdq)
Related
I need to install a package from source in renv. I can install packages from binaries in renv no problem. I can also install packages from both source & binary outside renv no problem. I am doing this within Rstudio
The error (below) makes me think it cant find the compiler. Digging around I found a thread about this that says renv cant find Rtools and then you need to run renv:::renv_scope_rtools() to resolve this but this just gives the message FAIL and the problem remains. Can anyone help?
thanks
install.packages("xfun")
Retrieving 'https://cloud.r-project.org/src/contrib/xfun_0.37.tar.gz' ...
OK [file is up to date]
Installing xfun [0.37] ...
FAILED
Error installing package 'xfun':
================================
* installing *source* package 'xfun' ...
** package 'xfun' successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c base64.c -o base64.o
sh: line 1: gcc: command not found
make: *** [C:/PROGRA~1/R/R-42~1.2/etc/x64/Makeconf:253: base64.o] Error 127
ERROR: compilation failed for package 'xfun'
* removing 'D:/Dropbox/project X/renv/staging/3/xfun'
when installing a R package from github
install_github("DataSlingers/ExclusiveLasso")
I get the error messages:
* installing *source* package 'ExclusiveLasso' ...
** using staged installation
** libs
g++ -std=gnu++11 -I"/include" -DNDEBUG -I'D:/R-4.2.2/library/Rcpp/include' -I'D:/R-4.2.2/library/RcppArmadillo/include' -I"D:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c ExclusiveLasso.cpp -o ExclusiveLasso.o
In file included from D:/R-4.2.2/library/Rcpp/include/RcppCommon.h:30,
from D:/R-4.2.2/library/RcppArmadillo/include/RcppArmadillo/interface/RcppArmadilloForward.h:25,
from D:/R-4.2.2/library/RcppArmadillo/include/RcppArmadillo.h:29,
from ExclusiveLasso.cpp:23:
D:/R-4.2.2/library/Rcpp/include/Rcpp/r/headers.h:66:10: fatal error: R.h: No such file or directory
66 | #include <R.h>
| ^~~~~
compilation terminated.
make: *** [D:/R-4.2.2/etc/x64/Makeconf:260:ExclusiveLasso.o] 错误 1
ERROR: compilation failed for package 'ExclusiveLasso'
* removing 'D:/R-4.2.2/library/ExclusiveLasso'
I know where my R.h at, and I tried change
#include <R.h>
into
#include <D:/R-4.2.2/include>,
but there's too many files and errors like this
It seems that I should tell the g++ where to find D:/R-4.2.2/include, can someone guide me whether I should do that or what should I do.
I's using:
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Using vscode
Works fine here on Ubuntu 22.10. Note in the log below how it uses -I"/usr/share/R/include" (which is something R itself adds) to point to R's headers. So to me it looks like your R installation is at fault because the src/Makevars.win in that repo is very standard and mostly likely correct.
edd#rob:~$ installGithub.r DataSlingers/ExclusiveLasso # wrapper around install_github()
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo DataSlingers/ExclusiveLasso#HEAD
Skipping 1 packages ahead of CRAN: Rcpp
── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ checking for file ‘/tmp/remotes2ac86f2646632b/DataSlingers-ExclusiveLasso-ed6b729/DESCRIPTION’ ...
─ preparing ‘ExclusiveLasso’:
✔ checking DESCRIPTION meta-information ...
─ cleaning src
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘ExclusiveLasso_0.0.tar.gz’
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘ExclusiveLasso’ ...
** using staged installation
** libs
ccache g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I'/usr/local/lib/R/site-library/RcppArmadillo/include' -fpic -g -O3 -Wall -pipe -pedantic -Wno-ignored-attributes -c ExclusiveLasso.cpp -o ExclusiveLasso.o
ccache g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I'/usr/local/lib/R/site-library/Rcpp/include' -I'/usr/local/lib/R/site-library/RcppArmadillo/include' -fpic -g -O3 -Wall -pipe -pedantic -Wno-ignored-attributes -c RcppExports.cpp -o RcppExports.o
ccache g++ -std=gnu++11 -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o ExclusiveLasso.so ExclusiveLasso.o RcppExports.o -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
if test -e "/usr/bin/strip" & test -e "/bin/uname" & [[ `uname` == "Linux" ]] ; then /usr/bin/strip --strip-debug *.o *.so; fi
if test -e "/usr/bin/strip" & test -e "/bin/uname" & [[ `uname` == "Darwin" ]] ; then /usr/bin/strip -S *.o *.so; fi
installing to /usr/local/lib/R/site-library/00LOCK-ExclusiveLasso/00new/ExclusiveLasso/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ExclusiveLasso)
edd#rob:~$
Looking at your installation attempt confirms that because you have
g++ -std=gnu++11 -I"/include"
so R does not figure out where its installation is. Normally you should have
edd#rob:~$ R RHOME
/usr/lib/R
edd#rob:~$
but I suspect that too is borked at your end.
I am trying to install an R package from Github. But I come across the following issue. Does anyone has does how to solve this? Any comments or suggestions would be greatly appreciated. Thanks!
devtools::install_github("gregorkb/QregBB")
Downloading GitHub repo gregorkb/QregBB#master
✔ checking for file ‘/private/var/folders/sq/lj12xtts7r9fbjblz_y8q8dh0000gn/T/RtmpSg1adc/remotes18a031a3335d/gregorkb-QregBB-cf0ee46/DESCRIPTION’ (372ms)
─ preparing ‘QregBB’:
✔ checking DESCRIPTION meta-information ...
─ cleaning src
─ installing the package to process help pages
─ saving partial Rd database (14.9s)
─ cleaning src
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘QregBB_1.0.tar.gz’
installing source package ‘QregBB’ ...
** using staged installation
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -Wall -g -O2 -c QregBB.c -o QregBB.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 QregBB.so QregBB.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-QregBB/00new/QregBB/libs
** R
** byte-compile and prepare package for lazy loading
** help
Error : (converted from warning) /private/var/folders/sq/lj12xtts7r9fbjblz_y8q8dh0000gn/T/Rtmp0W7UGP/Rbuild191c5c79437f/QregBB/man/QregBB-package.Rd:28: All text must be in a section
ERROR: installing Rd objects failed for package ‘QregBB’
removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/QregBB’
Error: Failed to install 'QregBB' from GitHub:
(converted from warning) installation of package ‘/var/folders/sq/lj12xtts7r9fbjblz_y8q8dh0000gn/T//RtmpSg1adc/file18a07a8be6ad/QregBB_1.0.tar.gz’ had non-zero exit status
I just installed R on linux. Now I try to install some packages on it. When I try on install the
the RCurl package using:
install.packages("RCurl")
I however get the following:
* installing *source* package ‘bitops’ ...
** package ‘bitops’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c bit-ops.c -o bit-ops.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c cksum.c -o cksum.o
gcc -std=gnu99 -shared -o bitops.so bit-ops.o cksum.o -L/usr/lib/R/lib -lR
installing to /home/marc/R/x86_64-pc-linux-gnu-library/3.0/bitops/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (bitops)
* installing *source* package ‘RCurl’ ...
** package ‘RCurl’ successfully unpacked and MD5 sums checked
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/marc/R/x86_64-pc-linux-gnu-library/3.0/RCurl’
The downloaded source packages are in
‘/tmp/RtmpAXtKXQ/downloaded_packages’
Warning message:
In install.packages("RCurl") :
installation of package ‘RCurl’ had non-zero exit status
In the beginning everything seems to go fine but then I trows a non-zero exit status error. Any thoughts
what goes wrong here?
I have 64bit R (R version 2.15.2 (2012-10-26) -- "Trick or Treat") on Mac OSX 10.8.5, and Oracle Instantclient Version 11.2.0.3.0 from Oracle installed. I've gotten sqlplus, as well as Perl and Python to run on these. Now I am trying to build ROracle. It needs to be built from source, so I downloaded it and have tried running:
R CMD INSTALL ROracle_1.1-10.tar.gz
However, I think it is expecting a different directory structure than what the Instant Client has given me. For instance, when I try to run that command, I get:
$ R CMD INSTALL ROracle_1.1-10.tar.gz
* installing to library ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
configure: error: "/Applications/instantclient_11_2/lib" directory does not exist
ERROR: configuration failed for package ‘ROracle’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/ROracle’
It is true, that I don't have a 'lib' directory in my '/Applications/instantclient_11_2' directory. I did however try to fake it out by creating one and linking to the .dylib files in the '/Applications/instantclient_11_2' directory, and I got past that error to a new one:
$ R CMD INSTALL ROracle_1.1-10.tar.gz
* installing to library ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
configure: error: "/Applications/instantclient_11_2/rdbms/public" directory does not exist
ERROR: configuration failed for package ‘ROracle’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/ROracle’
So it is now looking for another directory that isn't there. I don't want to keep going and guessing at the directories it is expecting and trying to back-populate it with links to files it should be expecting in those directories (I don't even know what it might be expecting here).
Is there another way to go about installing this? I'm thinking I should be able to do this based upon the fact that Perl and Python can use these drivers.
Thanks,
Matt
I think you have "ORACLE_HOME" variable set. I had the same problem and as soon as I did
export ORACLE_HOME=""
I could successfully compile ROracle.
Before:
me#my-laptop:~/Downloads$ R CMD INSTALL ROracle_1.1-10.tar.gz
*installing to library ‘/opt/R/library’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
configure: error: "/usr/lib/oracle/12.1/rdbms/public" directory does not exist
ERROR: configuration failed for package ‘ROracle’
* removing ‘/opt/R/library/ROracle’
After:
me#my-laptop:~/Downloads$ export ORACLE_HOME=""
me#my-laptop:~/Downloads$ R CMD INSTALL ROracle_1.1-10.tar.gz
* installing to library ‘/opt/R/library’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/opt/oracle/sdk/include -fpic -O2 -pipe -g -c rodbi.c -o rodbi.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/opt/oracle/sdk/include -fpic -O2 -pipe -g -c rooci.c -o rooci.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/opt/oracle/sdk/include -fpic -O2 -pipe -g -c routl.c -o routl.o
gcc -std=gnu99 -shared -o ROracle.so rodbi.o rooci.o routl.o -L/opt/oracle -lclntsh -L/usr/lib/R/lib -lR
installing to /opt/R/library/ROracle/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (ROracle)