installing ropensci/magick behind a firewall - r

I'm attempting to use the gganiminate library and I'm having an issue when I call gganimate::gganimate(myplot). The issue appears to be with a dependency library, magick.
When I call the function I get the following warning:
gganimate::gganimate(p)
1: running command 'C:\WINDOWS\system32\cmd.exe /c convert --version' had status 4
2: In find_magic() : ImageMagick not installed yet!
In im.convert(img.files, output = path.expand(movie.name), ... :
Please install ImageMagick first or put its bin path into the system PATH variable
So I try to install magick separately. I'm on a machine at a client so installing packages from github requires me to provide info to get through the firewall. I've installed other libraries from github with this machine using the same technique successfully. However, magick appears to be bumping into other problems. Below is my code and the error:
devtools::install_github("ropensci/magick",httr::set_config(httr::use_proxy("xx.xxx.xx.xx",xxxx)))
Downloading GitHub repo ropensci/magick#master
from URL https://api.github.com/repos/ropensci/magick/zipball/master
Installing magick
"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" \
--no-site-file --no-environ --no-save \
--no-restore --quiet CMD INSTALL \
"C:/Users/r631265/AppData/Local/Temp/1/RtmpS0efnQ/devtools18fc5f2414b/ropensci-magick-7925af3" \
--library="C:/Users/r631265/Documents/R/win-library/3.4" \
--install-tests
* installing *source* package 'magick' ...
** libs
*** arch - i386
rm -f RcppExports.o animation.o attributes.o base.o color.o composite.o config.o convolve.o device.o edit.o fonts.o options.o resize.o transformations.o magick.dll
Linking to imagemagagick-6.9.9
"C:/PROGRA~1/R/R-34~1.3/bin/i386/Rscript.exe" "../tools/winlibs.R" 6.9.9
Error in curl::curl_download(sprintf("https://github.com/rwinlib/imagemagick%s/archive/v%s.zip", :
schannel: failed to receive handshake, SSL/TLS connection failed
Calls: <Anonymous> -> .Call
Execution halted
make: *** [winlibs] Error 1
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-34~1.3/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-34~1.3/share/make/winshlib.mk" CXX='$(CXX11) $(CXX11STD)' CXXFLAGS='$(CXX11FLAGS)' CXXPICFLAGS='$(CXX11PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX11LDFLAGS)' SHLIB_LD='$(SHLIB_CXX11LD)' SHLIB="magick.dll" OBJECTS="RcppExports.o animation.o attributes.o base.o color.o composite.o config.o convolve.o device.o edit.o fonts.o options.o resize.o transformations.o"' had status 2
ERROR: compilation failed for package 'magick'
* removing 'C:/Users/r631265/Documents/R/win-library/3.4/magick'
In R CMD INSTALL
Installation failed: Command failed (1)
I think perhaps my firewall details aren't getting passed into: curl::curl_download(sprintf("https://github.com/rwinlib/imagemagick%s/archive/v%s.zip",...)
Network security is a bit of a black box to me so I'm not sure what else to try or if I'm diagnosing the issue correctly. Any help would be greatly appreciated!

Related

R package installation - R CMD check throws ERROR: Installation Failed

I'm having trouble getting a package that I have written to install (on a Windows 10 machine).
I'm running R CMD build packagename (no errors), then R CMD check packagename_0.1.0.tar.gz (or R CMD INSTALL packagename)
After a number of successful log entries, the output reads
* checking whether package 'packagename' can be installed ...Warning: running command '"C:/PROGRA~1/R/R-3.4.0/bin/x64/Rcmd.exe" INSTALL -l
"C:/Work/parsimony_inapp/packagename.Rcheck" --no-html
"C:\Work\PARSIM~1\packagename.Rcheck\00_pkg_src\packagename"' had status 1
ERROR
Installation failed.
00install.out reports the error:
C:/MinGW/bin/gcc -shared -s -static-libgcc -o packagename.dll tmp.def fitch.o reorder.o -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-
4.9.3/local330/lib -LC:/PROGRA~1/R/R-3.4.0/bin/x64 -lR
C:/PROGRA~1/R/R-3.4.0/bin/x64/R.dll: file not recognized: File format not
recognized
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'packagename'
Oddly, I can install the package from GitHub using devtools::github_install('path/to/package').
Advice I've found elsewhere doesn't help:
setwd() in Rprofile - not present
Set R_WIN_NO_JUNCTIONS - no effect
I've updated to the latest version of R (3.4.0), RTools (34) and Cygwin, and checked that my PATH environment variable contains (in order) C:\Rtools\bin; C:\Rtools\mingw_32\bin; C:\Program Files\R\R-3.4.0\bin; C:\Program Files\R\R-3.4.0\bin\x64.
I've tried including and excluding C:\cygwin64\bin and C:\MinGW\msys\1.0\bin from the path, and have tried installations of Rtools with and without the Cygwin dlls, and have tried uninstalling Cygwin completely.

*.o: File format not recognized on Windows 7

I wrote an R package called arbintools for some work-related data analysis and put it on Github. I wrote it and have been using it on my Mac for a while without issue; Today, I tried to install the dev-1 branch on a Windows 7 laptop and something related to compiling some Rcpp functions seems to go wrong:
devtools::install_github("mjlacey/arbintools", ref = "dev1")
I get this:
Downloading GitHub repo mjlacey/arbintools#dev1
from URL https://api.github.com/repos/mjlacey/arbintools/zipball/dev1
Installing arbintools
"C:/PROGRA~1/R/R-33~1.0/bin/x64/R" --no-site-file --no-environ --no-save \
--no-restore --quiet CMD INSTALL \
"C:/Users/matla332.USER/AppData/Local/Temp/Rtmp8WWkKC/devtools124c45026af1/mjlacey-arbintools-41dc363" \
--library="C:/Users/matla332.USER/Documents/R/win-library/3.3" \
--install-tests
* installing *source* package 'arbintools' ...
** libs
*** arch - i386
C:\Rtools\mingw_32\bin\nm.exe: RcppExports.o: File format not recognized
C:\Rtools\mingw_32\bin\nm.exe: Rcpp_functions.o: File format not recognized
c:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o arbintools.dll tmp.def RcppExports.o Rcpp_functions.o -Ld:/Compiler/gcc-4.9.3/local330/lib/i386 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-33~1.0/bin/i386 -lR
RcppExports.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'arbintools'
* removing 'C:/Users/matla332.USER/Documents/R/win-library/3.3/arbintools'
* restoring previous 'C:/Users/matla332.USER/Documents/R/win-library/3.3/arbintools'
Error: Command failed (1)
Installing other packages requiring some compilation (like dplyr) worked fine. I also updated R on my Mac to the same version (3.3.0) and reinstalled the package successfully, it's just on the Windows PC it doesn't work. This is beyond my understanding, if anyone has a suggestion or solution I'd be very grateful.
The issue is the .so and .o files are only viable with the same architecture e.g. OS X is 64 bit and Windows is 32bit (mingw_32). Please remove them from dev-1/src and then you should be good to go. These files are automatically built on package install as they are the result of using a compiler.
After they are removed, try to create a .gitignore file with the following:
src/*.o
src/*.so
src/*.dll
This will make OS specific files not selectable for staging and, in turn, commits.
As a general rule of thumb, only keep .cpp or .h files within /src while using Rcpp.

While creating an R package the error has arisen

Last week I was training to create a user-defined package in R.
As the tutorial I used this link https://www.youtube.com/watch?v=9PyQlbAEujY.
I used R-studio Version 0.99.486.
Everything worked well, I made a package: ran build&reload -> check and build -> build a binary package
While creating a package, I was using devtools and roxygen2 libraries.
But today I have the error (after pressing “check”) that I can’t find a clue how to fix it. To create a package on the work station is ok, but for my network directory \dc2\mypackage.
The trouble seems to be with the acces to c:\windows. However I have got some security issues to get rid of all restrictions.
So it seems to be another way ((if it is ever) to redefine check (log) directory.
I would be grateful for your help with the error at \dc2\mypackage:
The snapshot of check window:
==> devtools::check(document = FALSE)
Setting env vars ---------------------------------------------------------
CFLAGS : -Wall -pedantic
CXXFLAGS: -Wall -pedantic
Building mypackage ----------------------------------------------------------
"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save \
--no-restore CMD build \
"\\dc2\mypackage" \
--no-resave-data --no-manual
* checking for file '\\dc2\mypackage/DESCRIPTION' ... OK
* preparing 'mypackage':
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'mypackage_0.1.tar.gz'
pdflatex not found! Not building PDF manual or vignettes.
If you are planning to release this package, please run a check with manual and vignettes beforehand.
Setting env vars -----------------------------------------------------------
_R_CHECK_CRAN_INCOMING_ : FALSE
_R_CHECK_FORCE_SUGGESTS_: FALSE
Checking mypackage ----------------------------------------------------------
"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" --no-site-file --no-environ --no-save \
--no-restore CMD check \
"C:\Users\DEMYD~1.DZY\AppData\Local\Temp\Rtmp8eHzkB/mypackage_0.1.tar.gz" \
--as-cran --timings --no-build-vignettes --no-manual
"\\dc2\Risk_Management\Score_card_DEV\R\packages"
��������� ���� ��� �ᯮ�짮��� ��� ����᪥ CMD.EXE � �����⢥ ⥪�饩 �����.
CMD.EXE �� �����ন���� ���� UNC. �� 㬮�砭�� ���࠭� ���⥬��� ����� Windows.
ERROR: cannot create check dir 'C:/Windows/mypackage.Rcheck'
Error in lapply(list(...), quotes) : object 'Log' not found
Execution halted
Error: Command failed (1)
Execution halted
Exited with status 1.

ERROR: configuration failed for package ‘Rsymphony’

I just try to install the 'Rsymphony' package and it failed and the error indicator says
Cannot find SYMPHONY libraries and headers.
See https://projects.coin-or.org/SYMPHONY.
ERROR: configuration failed for package ‘Rsymphony’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Rsymphony’
Addition: my platform is mac os.
Alternatively, open terminal and type:
curl -O http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2
sudo tar fvxz gfortran-4.8.2-darwin13.tar.bz2 -C /
reference to Rcpp, RcppArmadillo and OS X Mavericks "-lgfortran" and "-lquadmath" error

Installing R packages

When I have tried to install some R packages such as Rgraphviz, I get the following error:
install.packages("Rgraphviz_2.12.0.tar.gz",repos=NULL,type="source")
* installing *source* package 'Rgraphviz' ...
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
gcc -m32 -I"C:/PROGRA~1/R/R-31~1.2/include" -DNDEBUG -
I"d:/RCompile/CRANpkg/extralibs64/local/include" -
Ilibwin/i386/include/graphviz -DHAVE_STDBOOL_H=1 -DHAVE_BOOL=1 -
DGRAPHVIZ_MAJOR=2 -DGRAPHVIZ_MINOR=28 -DGRAPHVIZ_STATIC -O3 -Wall -
std=gnu99 -mtune=core2 -c LL_funcs.c -o LL_funcs.o
gcc: unrecognized option `-std=gnu99'
d:\RCompile\CRANpkg\extralibs64\local\include\.: Permission denied
make.exe: *** [LL_funcs.o] Error 1
Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-
31~1.2/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.2/share/make/winshlib.mk"
SHLIB="Rgraphviz.dll" OBJECTS="LL_funcs.o Rgraphviz.o RgraphvizInit.o
agopen.o agread.o agwrite.o bezier.o buildEdgeList.o buildNodeList.o
doLayout.o graphvizVersion.o init.o"' had status 2
ERROR: compilation failed for package 'Rgraphviz'
* removing 'C:/Program Files/R/R-3.1.2/library/Rgraphviz'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-31~1.2/bin/i386/R" CMD INSTALL -l
"C:\Program Files\R\R-3.1.2\library" "Rgraphviz_2.12.0.tar.gz"' had status 1
2: In install.packages("Rgraphviz_2.12.0.tar.gz", repos = NULL, type =
"source") :
installation of package ‘Rgraphviz_2.12.0.tar.gz’ had non-zero exit status
I am mostly appreciate any comment.
The first thing to do is take care of the
d:\RCompile\CRANpkg\extralibs64\local\include\.: Permission denied
error. Check file permissions on that directory; does it belong to Administrator? Make sure you have read access to it.

Resources