Installing a package from source fails for me on my windows machine. I uninstalled RStudio, R and deleted rtools40 folder, restarted and reinstalled those items. I believe I have the path set up appropriately.
Here's the code I tried, using some troubleshooting help from here:
#troubleshooting installation
pkgbuild::find_rtools()
pkgbuild::has_rtools(TRUE)
pkgbuild::check_rtools(TRUE)
pkgbuild::rtools_path()
pkgbuild::check_build_tools(TRUE)
pkgbuild::check_compiler(TRUE)
Sys.getenv("PATH")
Sys.getenv('BINPREF')
sessionInfo()
#Test installation from source via CRAN
pkgbuild::with_build_tools(install.packages("lme4", type = "source"))
And here is the output:
Restarting R session...
> #troubleshooting installation
> pkgbuild::find_rtools()
[1] TRUE
> pkgbuild::has_rtools(TRUE)
[1] TRUE
> pkgbuild::check_rtools(TRUE)
[1] TRUE
> pkgbuild::rtools_path()
[1] "C:\\rtools40/usr/bin"
> pkgbuild::check_build_tools(TRUE)
Your system is ready to build packages!
> pkgbuild::check_compiler(TRUE)
Trying to compile a simple C file
Running "C:/PROGRA~1/R/R-40~1.3/bin/x64/Rcmd.exe" SHLIB foo.c
Warning message:
In system(cmd) : 'make' not found
Error: Failed to compile C code
> Sys.getenv("PATH")
[1] "C:\\Program Files\\R\\R-4.0.3\\bin\\x64;C:\\rtools40\\bin;C:\\rtools40\\mingw64\\bin;C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\CLI2\\wbin;C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Pandoc\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Users\\nealm\\AppData\\Local\\Microsoft\\WindowsApps;C:\\ProgramData\\Anaconda3;C:\\ProgramData\\Anaconda3\\Scripts;C:\\Users\\nealm\\.conda\\pkgs\\conda-4.7.5-py37_0\\Scripts;C:\\ProgramData\\Anaconda3\\Library\\bin;C:\\Users\\nealm\\AppData\\Local\\GitHubDesktop\\bin;C:\\Users\\nealm\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\nealm\\AppData\\Roaming\\TinyTeX\\bin\\win32;"
> Sys.getenv('BINPREF')
[1] "C:/rtools40/mingw64/bin/"
> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
Matrix products: default
locale:
[1] LC_COLLATE=English_New Zealand.1252 LC_CTYPE=English_New Zealand.1252 LC_MONETARY=English_New Zealand.1252
[4] LC_NUMERIC=C LC_TIME=English_New Zealand.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] processx_3.4.5 compiler_4.0.3 assertthat_0.2.1 R6_2.5.0 cli_2.2.0 livecode_0.1.0.9000
[7] prettyunits_1.1.1 tools_4.0.3 glue_1.4.2 rstudioapi_0.13 Rcpp_1.0.5 remotes_2.2.0
[13] crayon_1.3.4 fansi_0.4.1 callr_3.5.1 ps_1.4.0 pkgbuild_1.1.0
>
> #Test installation from source via CRAN
> pkgbuild::with_build_tools(install.packages("lme4", type = "source"))
Installing package into ‘C:/Rpackages’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/lme4_1.1-26.tar.gz'
Content type 'application/x-gzip' length 3297635 bytes (3.1 MB)
downloaded 3.1 MB
* installing *source* package 'lme4' ...
** package 'lme4' successfully unpacked and MD5 sums checked
** using staged installation
** libs
*** arch - i386
C:/rtools40/mingw64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Rpackages/Rcpp/include' -I'C:/Rpackages/RcppEigen/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c external.cpp -o external.o
C:/rtools40/mingw64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Rpackages/Rcpp/include' -I'C:/Rpackages/RcppEigen/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c glmFamily.cpp -o glmFamily.o
C:/rtools40/mingw64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Rpackages/Rcpp/include' -I'C:/Rpackages/RcppEigen/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c optimizer.cpp -o optimizer.o
C:/rtools40/mingw64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Rpackages/Rcpp/include' -I'C:/Rpackages/RcppEigen/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c predModule.cpp -o predModule.o
C:/rtools40/mingw64/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.3/include" -DNDEBUG -I. -DNDEBUG -DEIGEN_DONT_VECTORIZE -I'C:/Rpackages/Rcpp/include' -I'C:/Rpackages/RcppEigen/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c respModule.cpp -o respModule.o
C:/rtools40/mingw64/bin/g++ -std=gnu++11 -shared -s -static-libgcc -o lme4.dll tmp.def external.o glmFamily.o optimizer.o predModule.o respModule.o -LC:/PROGRA~1/R/R-40~1.3/bin/i386 -lR
C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~1/R/R-40~1.3/bin/i386/R.dll when searching for -lR
C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~1/R/R-40~1.3/bin/i386/R.dll when searching for -lR
C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lR
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'lme4'
* removing 'C:/Rpackages/lme4'
* restoring previous 'C:/Rpackages/lme4'
Warning in install.packages :
installation of package ‘lme4’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\nealm\AppData\Local\Temp\RtmpwPwykm\downloaded_packages’
>
The problem does not appear to be specific to the lme4 package.
This is more of a work around than a proper answer. The alternative to installing and building from source is to install a pre-built binary. If one is not available, you can build it remotely.
In this case, for the package of interest for me, rundel/livecode on github, I:
Forked the repo (in this case rundel/livecode). This step might be optional.
Downloaded the tar.gz (remotes::install_github("markbneal/livecode") which doesn't install it, but the error tells you where it saves the .tar.gz file locally.
Used rhub to build the package binary for windows, go to this website https://builder.r-hub.io/ and upload your tar.gz file, ensuring rhub has your email address (click "advanced" button to provide your email address as alternate - you will need to validate it). That emails me a zip 5 minutes later.
Then copy the livecode folder in the zip that is emailed to me to my "R packages" folder location.
Package should now work for you, in my case library(livecode)
Edited six months later when I had to use this process again!
Related
I'm trying to install reticulate so I can execute some Python code I've written from within R. Unfortunately, I'm having trouble installing the package and haven't had much luck in determining the reason.
I've found that it likely has something to do with compiling the package and possible issues with gcc or different versions of c++ compilers, but I'm a bit out of my depth with those issues and haven't been able to get anything working. I've tried uninstalling and reinstalling xcode command line tools, but that didn't solve the issue. Beyond that, I'm not entirely sure where to start. I'm hoping somebody has experienced this and there's a straightforward answer, I'd really appreciate any help.
> install.packages('reticulate')
There is a binary version available but the source version is later:
binary source needs_compilation
reticulate 1.13 1.14 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) y
installing the source package ‘reticulate’
trying URL 'https://cran.rstudio.com/src/contrib/reticulate_1.14.tar.gz'
Content type 'application/x-gzip' length 1504849 bytes (1.4 MB)
==================================================
downloaded 1.4 MB
* installing *source* package ‘reticulate’ ...
** package ‘reticulate’ successfully unpacked and MD5 sums checked
** libs
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c event_loop.cpp -o event_loop.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c libpython.cpp -o libpython.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c output.cpp -o output.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c python.cpp -o python.o
/usr/local/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include -fPIC -Wall -g -O2 -c readline.cpp -o readline.o
/usr/local/bin/gcc-8 -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 reticulate.so RcppExports.o event_loop.o libpython.o output.o python.o readline.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/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
Error: package or namespace load failed for ‘reticulate’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/libs/reticulate.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/libs/reticulate.so, 6): Symbol not found: __ZNSt15basic_streambufIcSt11char_traitsIcEE5imbueERKSt6locale
Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/libs/reticulate.so
Expected in: flat namespace
in /Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate/libs/reticulate.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/reticulate’
Warning in install.packages :
installation of package ‘reticulate’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/4g/ctbqp07114x4brzp4hr8zfc40000gn/T/RtmpDNvElq/downloaded_packages’
Session Info:
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.15.2
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.3 tools_3.5.3 yaml_2.2.0
Okay, I suggest to use conda to create a new environment and install there R anew. Because then you solve the issues - since only one line conda install -c conda-forge r-reticulate will install you reticulate and r-base solving for you all issues.
However some people (who don't know what conda is) won't be happy with my suggestion. I can't and won't help them.
But for those who know conda, I recommend:
conda create --name R_reticulate
source activate R_reticulate
conda install -c conda-forge r-reticulate
(of course you could determine version numbers when installing into conda environment ...)
if the version of R in your local env now is the same like your global R, you can even overtake most of the library installed in the pre-existing R - thus you don't have to reinstall them all over again. Simply by manipulating the path variable in your conda env's R.
(Just as a hack and if you are lazy to install everything anew, probably because you want just to play around with reticulate first, before you install it into your global R).
For that, in your global R, determine where your R packages are installed by .libPaths() from within your global R console.
Then start R in your R_reticulate conda environment,
and at beginning of session do
my_libPaths <- .libPaths()
# and e.g. add one or some of your global .libPaths() paths
# to here by
my_libPaths <- c(my_libPaths, one_of_global_path)
.libPaths(my_libPaths) # assign new libpaths!
# the order of the paths in the vector is important - decides about where R looks first!
# of course you can change order like you want in the vector!
By that, you don't have to re-install libraries.
However, the version number of global and local (conda) R must be same so that this works.
Otherwise you will get always warnings when loading libraries ...
Simpler is of course to re-install everything into your conda env's R. (conda will help you for this a lot!).
I'm trying to install r package "sparsesvd" using install.packages(), but got error during compilation. Any help is highly appreciated!
"unknown type name ‘R_CallMethodDef’"
I also tried conda install -c r r-sparsesvd; but got error.
Solving environment: failed
PackagesNotFoundError: The following packages are not available from
current channels:
r-sparsesvd
Current channels:
https://conda.anaconda.org/r/linux-64
https://conda.anaconda.org/r/noarch
https://conda.anaconda.org/bioconda/linux-64
https://conda.anaconda.org/bioconda/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
...
I tried
conda skeleton cran --recursive r-sparsesvd
conda build r-sparsesvd.
While the 1st step was successful, the build failed.
Execution halted
Tests failed for r-sparsesvd-0.1_4-r341h96ca727_0.tar.bz2
Here is the sessionInfo. Due to project reason, I have to use R3.3
R version 3.3.2 (2016-10-31) Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3]
LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5]
LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7]
LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C
LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils
datasets methods base
loaded via a namespace (and not attached): [1] tools_3.3.2
This (once again) is not a problem with R, CRAN or its packages ...but apparently with Conda. On my system there is strictly no problem with this small package with very few dependencies:
R> install.packages("sparsesvd")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/sparsesvd_0.1-4.tar.gz'
Content type 'application/x-gzip' length 29729 bytes (29 KB)
==================================================
downloaded 29 KB
* installing *source* package ‘sparsesvd’ ...
** package ‘sparsesvd’ successfully unpacked and MD5 sums checked
** libs
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c las2.c -o las2.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c main.c -o main.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c svdlib.c -o svdlib.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c svdutil.c -o svdutil.o
svdutil.c: In function ‘svd_readBinFloat’:
svdutil.c:265:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
y = *((float *) &x);
^
svdutil.c: In function ‘svd_writeBinFloat’:
svdutil.c:290:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
int y = htonl(*((int *) &r));
^~~
gcc -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o sparsesvd.so las2.o main.o svdlib.o svdutil.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/sparsesvd/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (sparsesvd)
The downloaded source packages are in
‘/tmp/RtmpI3TPWj/downloaded_packages’
R>
UPDATE - Problem solved:
It seems like the way I set up .libPaths() (see comments below) loaded dplyr from a network directory, which somehow blocked the installation process of purrr. As soon as I installed and loaded dplyr from my local library I could install purrr.
I tried installing purrr from a local version of the package (purrr_0.2.2.tar.gz; see CRAN website). My installation attempt returns an error (fatal error: dplyr.h: No such file or directory):
> install.packages("H:/R_packages/purrr_0.2.2.tar.gz", # directory of the downloaded file
+ repos = NULL,
+ type = c("source"),
+ INSTALL_opts = "--no-test-load",
+ lib = "H:/R_packages") # where to install the package
'\\userhome\ABCD1234'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'purrr' ...
** package 'purrr' successfully unpacked and MD5 sums checked
** libs
gcc -m64 -I"C:/R/R-3.2.1/include" -DNDEBUG -I../inst/include -DCOMPILING_DPLYR -I"H:/R_packages/Rcpp/include" -I"\\mypath//R/Lib/CRAN/3.2/dplyr/include" -I"H:/R_packages/BH/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -std=gnu99 -mtune=core2 -c extract.c -o extract.o
g++ -m64 -I"C:/R/R-3.2.1/include" -DNDEBUG -I../inst/include -DCOMPILING_DPLYR -I"H:/R_packages/Rcpp/include" -I"\\mypath/R/Lib/CRAN/3.2/dplyr/include" -I"H:/R_packages/BH/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c fast-copy.cpp -o fast-copy.o
gcc -m64 -I"C:/R/R-3.2.1/include" -DNDEBUG -I../inst/include -DCOMPILING_DPLYR -I"H:/R_packages/Rcpp/include" -I"\\mypath/R/Lib/CRAN/3.2/dplyr/include" -I"H:/R_packages/BH/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -std=gnu99 -mtune=core2 -c flatten.c -o flatten.o
gcc -m64 -I"C:/R/R-3.2.1/include" -DNDEBUG -I../inst/include -DCOMPILING_DPLYR -I"H:/R_packages/Rcpp/include" -I"\\mypath/R/Lib/CRAN/3.2/dplyr/include" -I"H:/R_packages/BH/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -std=gnu99 -mtune=core2 -c map.c -o map.o
g++ -m64 -I"C:/R/R-3.2.1/include" -DNDEBUG -I../inst/include -DCOMPILING_DPLYR -I"H:/R_packages/Rcpp/include" -I"\\mypath/R/Lib/CRAN/3.2/dplyr/include" -I"H:/R_packages/BH/include" -I"d:/RCompile/r-compiling/local/local320/include" -O2 -Wall -mtune=core2 -c rows-data.cpp -o rows-data.o
rows-data.cpp:2:19: fatal error: dplyr.h: No such file or directory
compilation terminated.
make: *** [rows-data.o] Error 1
Warning: running command 'make -f "Makevars.win" -f "C:/R/R-3.2.1/etc/x64/Makeconf" -f "C:/R/R-3.2.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="purrr.dll" WIN=64 TCLBIN=64 OBJECTS="extract.o fast-copy.o flatten.o map.o rows-data.o rows-formatter.o rows.o transpose.o utils.o vector.o"' had status 2
ERROR: compilation failed for package 'purrr'
* removing 'H:/R_packages/purrr'
Warning in install.packages :
running command '"C:/R/R-3.2.1/bin/x64/R" CMD INSTALL --no-test-load -l "H:\R_packages" "H:/R_packages/purrr_0.2.2.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘H:/R_packages/purrr_0.2.2.tar.gz’ had non-zero exit Status
I used the same approach for a lot of other packages (broom, modelr, forcats etc.), and it always worked. Does anybody have an idea why the package installation fails in this particular case?
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252 LC_MONETARY=German_Switzerland.1252
[4] LC_NUMERIC=C LC_TIME=German_Switzerland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.4.2
loaded via a namespace (and not attached):
[1] magrittr_1.5 R6_2.1.0 assertthat_0.1 parallel_3.2.1 DBI_0.3.1 tools_3.2.1 Rcpp_0.12.0
When calling install.packages("tm") I get the following error:
> install.packages("tm")
Installing package into ‘/usr/local/lib/R/3.3/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://ftp.cixug.es/CRAN/src/contrib/tm_0.7.tar.gz'
Content type 'application/x-gzip' length 526498 bytes (514 KB)
==================================================
downloaded 514 KB
* installing *source* package ‘tm’ ...
** package ‘tm’ successfully unpacked and MD5 sums checked
** libs
clang++ -I/usr/local/Cellar/r/3.3.2/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -I"/usr/local/lib/R/3.3/site-library/BH/include" -I"/usr/local/lib/R/3.3/site-library/Rcpp/include" -fPIC -g -O2 -c RcppExports.cpp -o RcppExports.o
clang -I/usr/local/Cellar/r/3.3.2/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -I"/usr/local/lib/R/3.3/site-library/BH/include" -I"/usr/local/lib/R/3.3/site-library/Rcpp/include" -fPIC -g -O2 -c copy.c -o copy.o
clang -I/usr/local/Cellar/r/3.3.2/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -I"/usr/local/lib/R/3.3/site-library/BH/include" -I"/usr/local/lib/R/3.3/site-library/Rcpp/include" -fPIC -g -O2 -c init.c -o init.o
clang++ -I/usr/local/Cellar/r/3.3.2/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -I"/usr/local/lib/R/3.3/site-library/BH/include" -I"/usr/local/lib/R/3.3/site-library/Rcpp/include" -fPIC -g -O2 -c tdm.cpp -o tdm.o
In file included from tdm.cpp:4:
/usr/local/lib/R/3.3/site-library/BH/include/boost/tokenizer.hpp:59:9: error: field of type 'std::__1::__wrap_iter<const char *>' has private constructor
: first_(c.begin()), last_(c.end()), f_() { }
^
tdm.cpp:25:28: note: in instantiation of function template specialization 'boost::tokenizer<boost::char_delimiters_separator<char, std::__1::char_traits<char> >, std::__1::__wrap_iter<const char *>, std::__1::basic_string<char> >::tokenizer<Rcpp::internal::const_string_proxy<16> >' requested here
boost::tokenizer<> tok(strings(index));
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:1239:31: note: declared private here
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
^
In file included from tdm.cpp:4:
/usr/local/lib/R/3.3/site-library/BH/include/boost/tokenizer.hpp:59:28: error: field of type 'std::__1::__wrap_iter<const char *>' has private constructor
: first_(c.begin()), last_(c.end()), f_() { }
^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:1239:31: note: declared private here
_LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
^
2 errors generated.
make: *** [tdm.o] Error 1
ERROR: compilation failed for package ‘tm’
* removing ‘/usr/local/lib/R/3.3/site-library/tm’
Warning in install.packages :
installation of package ‘tm’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/02/6mkk426d3jd46mg35j577bwc0000gn/T/RtmpHPgAoU/downloaded_packages’
My computer runs macOS Sierra. The output of sessionInfo() is:
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin16.3.0 (64-bit)
Running under: macOS Sierra 10.12.3
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.3.2
I didn't have problems installing "slam" as other posts mentioned. I have also tried installing "tm" with the dependencies flag set to TRUE but yields the same output. I installed R via homebrew. I wonder if there are any other steps I can try.
I've been having the same issue. For now, I've installed tm 0.6 from the cran.r-project website. This eliminated the compilation errors for me.
I am trying to install X4R package to load a cube in R. There is a package with limited support to do this called 'X4R'. It can be found here:
https://www.linkedin.com/groupItem?view=&gid=77616&type=member&item=265568694&commentID=-1&trk=groups_guest_item_detail-b-jump_last#lastComment
and
https://github.com/overcoil/X4R
I have tried:
install.packages("devtools")
library(devtools)
install.packages("httr")
library(httr)
install.packages("Rcpp", lib="C:/Users/user1/Documents/R/win-library/3.1")
install_github("overcoil/X4R")
Since I am in a VM with no internet access, I used this line instead of last line in the above syntax:
install.packages("//tsclient/D/user1/R packages/X4R-master.zip", repos =NULL,lib="C:/Users/user1/Documents/R/win-library/3.1")
There is no error message displayed, but library didn't get installed.
So I tried this step:
install_local("//tsclient/D/user1/R packages/X4R-master.zip")
The above step produces same error posted in LinkedIn page:
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.0/include" -DNDEBUG -I. -I"C:/Users/user1/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c soapXmlaWebServiceSoapProxy.cpp -o soapXmlaWebServiceSoapProxy
g++ -m32 -I"C:/PROGRA~1/R/R-31~1.0/include" -DNDEBUG -I. -I"C:/Users/user1/Documents/R/win-library/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c stdsoap2.cpp -o stdsoap2.o
stdsoap2.cpp:75:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
stdsoap2.cpp:77:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
stdsoap2.cpp: In function 'const char* soap_strerror(soap*)':
stdsoap2.cpp:16229:11: warning: variable 'len' set but not used [-Wunused-but-set-variable]
g++ -m32 -shared -s -static-libgcc -o X4R.dll tmp.def X4R.o soapC.o soapXmlaWebServiceSoapProxy.o stdsoap2.o -LC:/PROGRA~1/R/R-31~1.0/library/Rcpp/libs/i386 -LC:/PROGRA~1/R/R-31~1.0/library/Rcpp/libs/x64 -lRcpp -lws2_32 -Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/PROGRA~1/R/R-31~1.0/bin/i386 -lR
c:/rtools/gcc-4.6.3/bin/../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lRcpp
collect2: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'X4R'
* removing 'C:/Users/user1/Documents/R/win-library/3.1/X4R'
Error: Command failed (1)
This is my sessionInfo().
sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
1 LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252 LC_MONETARY=English_Canada.1252
[4] LC_NUMERIC=C LC_TIME=English_Canada.1252
attached base packages:
1 stats graphics grDevices utils datasets methods base
other attached packages:
1 devtools_1.6
loaded via a namespace (and not attached):
1 tools_3.1.0
Looks like there are people successfully using this package. I would appreciate some help. Thank you in advance.