I've been trying to install an older version of stringi using renv and am getting the following error. I've had a few earlier errors using restore, but a few restarts have been able to move things through. I tried removing and reinstalling stringi, but still end up with the same error when trying to load the appropriate version.
Installing stringi [1.4.3] ...
FAILED
Error installing package 'stringi':
===================================
* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0 -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c stri_ICU_settings.cpp -o stri_ICU_settings.o
g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0 -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c stri_TODO_justify.cpp -o stri_TODO_justify.o
g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0 -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c stri_TODO_splitpos.cpp -o stri_TODO_splitpos.o
g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0 -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c stri_TODO_uchar.cpp -o stri_TODO_uchar.o
g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.0/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0 -I"C:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c stri_brkiter.cpp -o stri_brkiter.o
stri_brkiter.cpp: In member function 'void StriBrkIterOptions::setType(SEXP, const char*)':
stri_brkiter.cpp:60:8: error: 'isNull' was not declared in this scope; did you mean 'Rf_isNull'?
60 | if (isNull(opts_brkiter)) {
| ^~~~~~
| Rf_isNull
stri_brkiter.cpp: In member function 'void StriBrkIterOptions::setLocale(SEXP)':
stri_brkiter.cpp:130:8: error: 'isNull' was not declared in this scope; did you mean 'Rf_isNull'?
130 | if (isNull(opts_brkiter)) {
| ^~~~~~
| Rf_isNull
stri_brkiter.cpp: In member function 'void StriBrkIterOptions::setSkipRuleStatus(SEXP)':
stri_brkiter.cpp:171:8: error: 'isNull' was not declared in this scope; did you mean 'Rf_isNull'?
171 | if (isNull(opts_brkiter)) {
| ^~~~~~
| Rf_isNull
make: *** [C:/PROGRA~1/R/R-42~1.0/etc/x64/Makeconf:259: stri_brkiter.o] Error 1
ERROR: compilation failed for package 'stringi'
* removing 'D:/Projects/project1/renv/staging/1/stringi'
Error: install of package 'stringi' failed [error code 1]
When I try to load the version directly using devtools it conflicts with renv
require(devtools)
install_version("stringi", version = "1.4.3", repos = "http://cran.us.r-project.org")
require(devtools)
Loading required package: devtools
Loading required package: usethis
Warning messages:
1: package ‘devtools’ was built under R version 4.2.2
2: package ‘usethis’ was built under R version 4.2.2
> install_version("stringi", version = "1.4.3", repos = "http://cran.us.r-project.org")
Downloading package from url: http://cran.us.r-project.org/src/contrib/Archive/stringi/stringi_1.4.3.tar.gz
Installing package into ‘D:/Projects/project1/renv/library/R-4.2/x86_64-w64-mingw32’
(as ‘lib’ is unspecified)
ℹ Using R 4.2.0 (lockfile was generated with R 4.0.3)
* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
ERROR: cannot remove earlier installation, is it in use?
* removing 'D:/Projects/project1/renv/library/R-4.2/x86_64-w64-mingw32/stringi'
* restoring previous 'D:/Projects/project1/renv/library/R-4.2/x86_64-w64-mingw32/stringi'
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
problem copying D:\Projects\project1\renv\library\R-4.2\x86_64-w64-mingw32\00LOCK-stringi\stringi\libs\icudt69l.dat to D:\Projects\project1\renv\library\R-4.2\x86_64-w64-mingw32\stringi\libs\icudt69l.dat: Invalid argument
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
problem copying D:\Projects\project1\renv\library\R-4.2\x86_64-w64-mingw32\00LOCK-stringi\stringi\libs\x64\stringi.dll to D:\Projects\project1\renv\library\R-4.2\x86_64-w64-mingw32\stringi\libs\x64\stringi.dll: Permission denied
Warning message:
In i.p(...) :
installation of package ‘C:/Users/user/AppData/Local/Temp/RtmpK41CGy/remotesce6857a77e39/stringi’ had non-zero exit status
>
The OS/platform by jay.sf made me check over my setup and I realized that I was working with different versions of R. I installed the earlier version, called renv::restore() and the packages successfully installed.
Related
I am writing an example of an R-package that uses C++ to call a C-function from an external library (I used the chron.dll from the R-package chron).
The version of R is R-4.2.2. On my machine (Windows 10) rtools42 is installed in C:/Program Files aka C:/PROGRA~1.
Since this is not the standard location I am running
Sys.setenv(PATH = paste("C:/PROGRA~1/rtools42/bin/", Sys.getenv("PATH"), sep=";"))
Sys.setenv(BINPREF = "C:/PROGRA~1/rtools42/x86_64-w64-mingw32.static.posix/bin/")
prior to the build. Then I check the build with devtools::check() and it seems that compilation and linking works but the installation
fails. The 00install.out file is as follows:
* installing *source* package 'PackageExample' ...
** using staged installation
** libs
C:/PROGRA~1/rtools42/x86_64-w64-mingw32.static.posix/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I../chron/include -I. -I'C:/Users/JohnDoe/PROJECTS/R/libraries/Rcpp/include' -I"C:/Programme/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c RcppExports.cpp -o RcppExports.o
C:/PROGRA~1/rtools42/x86_64-w64-mingw32.static.posix/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I../chron/include -I. -I'C:/Users/JohnDoe/PROJECTS/R/libraries/Rcpp/include' -I"C:/Programme/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c callchron.cpp -o callchron.o
C:/PROGRA~1/rtools42/x86_64-w64-mingw32.static.posix/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I../chron/include -I. -I'C:/Users/JohnDoe/PROJECTS/R/libraries/Rcpp/include' -I"C:/Programme/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c matrix.cpp -o matrix.o
C:/PROGRA~1/rtools42/x86_64-w64-mingw32.static.posix/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I../chron/include -I. -I'C:/Users/JohnDoe/PROJECTS/R/libraries/Rcpp/include' -I"C:/Programme/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c rcpp_hello_world.cpp -o rcpp_hello_world.o
C:/PROGRA~1/rtools42/x86_64-w64-mingw32.static.posix/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-42~1.2/include" -DNDEBUG -I../chron/include -I. -I'C:/Users/JohnDoe/PROJECTS/R/libraries/Rcpp/include' -I"C:/Programme/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c vector.cpp -o vector.o
C:/PROGRA~1/rtools42/x86_64-w64-mingw32.static.posix/bin/g++ -shared -s -static-libgcc -o PackageExample.dll tmp.def RcppExports.o callchron.o matrix.o rcpp_hello_world.o vector.o -L../chron/libs/x64 -lchron -LC:/Programme/rtools42/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/Programme/rtools42/x86_64-w64-mingw32.static.posix/lib -LC:/PROGRA~1/R/R-42~1.2/bin/x64 -lR
installing to C:/Users/JohnDoe/AppData/Local/Temp/Rtmpg9Wn7W/file43d46e066097/PackageExample.Rcheck/00LOCK-PACKAG~1/00new/PackageExample/libs/x64
** R
** byte-compile and prepare package for lazy loading
Reading Tests.R.
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
Error: loading of pakckage or namespace 'PackageExample' in inDL(x, as.logical(local), as.logical(now), ...): failed
cannot load shared object 'C:/Users/JohnDoe/AppData/Local/Temp/Rtmpg9Wn7W/file43d46e066097/PackageExample.Rcheck/00LOCK-PACKAG~1/00new/PackageExample/libs/x64/PackageExample.dll':
LoadLibrary failure: the referenced module was not found.
Error: loading failed
Execution terminated
ERROR: loading failed
* removing 'C:/Users/JohnDoe/AppData/Local/Temp/Rtmpg9Wn7W/file43d46e066097/PackageExample.Rcheck/PackageExample'
(Some error messages translatd from German).
Interestingly the folder
C:/Users/JohnDoe/AppData/Local/Temp/Rtmpg9Wn7W/
contains files foo.dll, foo.o.
It looks like the PackageExample.dll is not put into
'C:/Users/JohnDoe/AppData/Local/Temp/Rtmpg9Wn7W/file43d46e066097/PackageExample.Rcheck/00LOCK- PACKAG~1/00new/PackageExample/libs/x64/
and instead foo.dll and foo.o are generated. What might be the problem?
Trying desperately to load and work with Rcpp (well really I am trying to work in the package Seurat which needs Rcpp)
> library(Seurat)
Error: package or namespace load failed for ‘Seurat’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘Rcpp’
In addition: Warning message:
package ‘Seurat’ was built under R version 4.0.2
> install.packages("Rcpp")
trying URL 'https://cran.rstudio.com/bin/macosx/contrib/4.0/Rcpp_1.0.5.tgz'
Content type 'application/x-gzip' length 3215939 bytes (3.1 MB)
==================================================
downloaded 3.1 MB
The downloaded binary packages are in
/var/folders/hl/247qzpv55z99f6kgddn95kk80000gn/T//RtmpX3Ovqt/downloaded_packages
> library(Rcpp)
Error: package or namespace load failed for ‘Rcpp’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so, 6): Symbol not found: _EXTPTR_PTR
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so
Expected in: /Library/Frameworks/R.framework/Resources/lib/libR.dylib
in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so
In addition: Warning message:
package ‘Rcpp’ was built under R version 4.0.2
I have tried the following
restarting, reinstalling -> same errors
Making sure Xcode is installed (downloaded from app store)
Installed Command Line Tools from terminal with xcode-select --install
Installing from source
> install.packages("Rcpp", type = "source")
trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_1.0.5.tar.gz'
Content type 'application/x-gzip' length 2950521 bytes (2.8 MB)
==================================================
downloaded 2.8 MB
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** 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/usr/local/include -fPIC -Wall -g -O2 -c api.cpp -o api.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -fPIC -Wall -g -O2 -c attributes.cpp -o attributes.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -fPIC -Wall -g -O2 -c barrier.cpp -o barrier.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -fPIC -Wall -g -O2 -c date.cpp -o date.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -fPIC -Wall -g -O2 -c module.cpp -o module.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -fPIC -Wall -g -O2 -c rcpp_init.cpp -o rcpp_init.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -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 Rcpp.so api.o attributes.o barrier.o date.o module.o rcpp_init.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-Rcpp/00new/Rcpp/libs
** R
** 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
** 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 (Rcpp)
The downloaded source packages are in
‘/private/var/folders/hl/247qzpv55z99f6kgddn95kk80000gn/T/RtmpX3Ovqt/downloaded_packages’
> library(Rcpp)
Error: package or namespace load failed for ‘Rcpp’ in get(Info[i, 1], envir = env):
lazy-load database '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/R/Rcpp.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
Can someone please advise?
Thanks!
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...
I'm trying to learn how to use R in Finance, and I'm trying to install a package but keep getting the following errors. I've tried now with R 3.0.3 through every version to the current and still the same error. Somebody has confirmed for me that the install worked for them on 3.1.0 so I was hoping somebody here may have some input as to what to try next, as I'm really out of ideas and search queries at this point.
> install.packages("quantstrat", repos="http://R-Forge.R-project.org")
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
cannot open: HTTP status was '404 Not Found'
Warning in install.packages :
unable to access index for repository http://R-Forge.R-project.org/bin/macosx/contrib/3.1
package ‘quantstrat’ is available as a source package but not as a binary
Warning in install.packages :
package ‘quantstrat’ is not available (for R version 3.1.0)
Edit: Following the suggestion in the below comments I have tried entering:
install.packages("quantstrat", repos="http://R-Forge.R-project.org", type="source")
Which yields only this cryptic message after downloading a handful of files:
* installing *source* package ‘zoo’ ...
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c coredata.c -o coredata.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c init.c -o init.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -fPIC -mtune=core2 -g -O2 -c lag.c -o lag.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -L/usr/local/lib -o zoo.so coredata.o init.o lag.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/libs
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (zoo)
* installing *source* package ‘xts’ ...
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c add_class.c -o add_class.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c any.c -o any.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c attr.c -o attr.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c binsearch.c -o binsearch.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c coredata.c -o coredata.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c diff.c -o diff.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c dimnames.c -o dimnames.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c endpoints.c -o endpoints.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c extract_col.c -o extract_col.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c init.c -o init.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c isOrdered.c -o isOrdered.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c isXts.c -o isXts.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c leadingNA.c -o leadingNA.o
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/zoo/include" -fPIC -mtune=core2 -g -O2 -c merge.c -o merge.o
gfortran-4.2 -arch x86_64 -fPIC -g -O2 -c period.max.f -o period.max.o
make: gfortran-4.2: No such file or directory
make: *** [period.max.o] Error 1
ERROR: compilation failed for package ‘xts’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/xts’
Warning in install.packages :
installation of package ‘xts’ had non-zero exit status
ERROR: dependency ‘xts’ is not available for package ‘PerformanceAnalytics’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/PerformanceAnalytics’
Warning in install.packages :
installation of package ‘PerformanceAnalytics’ had non-zero exit status
ERROR: dependency ‘xts’ is not available for package ‘TTR’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/TTR’
Warning in install.packages :
installation of package ‘TTR’ had non-zero exit status
ERROR: dependencies ‘Defaults’, ‘xts’, ‘TTR’ are not available for package ‘quantmod’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/quantmod’
Warning in install.packages :
installation of package ‘quantmod’ had non-zero exit status
ERROR: dependencies ‘quantmod’, ‘xts’ are not available for package ‘FinancialInstrument’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/FinancialInstrument’
Warning in install.packages :
installation of package ‘FinancialInstrument’ had non-zero exit status
ERROR: dependencies ‘xts’, ‘FinancialInstrument’, ‘PerformanceAnalytics’, ‘quantmod’ are not available for package ‘blotter’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/blotter’
Warning in install.packages :
installation of package ‘blotter’ had non-zero exit status
ERROR: dependencies ‘xts’, ‘TTR’, ‘blotter’, ‘FinancialInstrument’ are not available for package ‘quantstrat’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/quantstrat’
Warning in install.packages :
installation of package ‘quantstrat’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/q3/0qq1vm5538l657ffhr1hxj6m0000gn/T/RtmpQ5VCcC/downloaded_packages’
Thanks In Advance,
Jason E.
A combination of the above comments was the solution...
I installed xcode in it's entirety, followed my gfortran, and then proceded to type the repos in as was mentioned before:
install.packages("quantstrat", repos="http://R-Forge.R-project.org", type="source")
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.