0
votes

Having a difficult time installing blotter for 4.0.2.

I run the following code:

require(devtools)
install_github("braverock/blotter") 
install_github("braverock/quantstrat")

I receive the following error message:

  Failed to install 'blotter' from GitHub:
  (converted from warning) installation of package ‘/var/folders/7f/fzwn25053j3bp0yd_7swzf540000gn/T//Rtmp5kiwSh/file14db938bb63bf/blotter_0.15.0.tar.gz’ had non-zero exit status

I have successfully installed xts, PerformanceAnalytics, and FinancialInstrument. I also have installed the development tool Clang 8.0 (although I believe it is no longer necessary in R 4.0 and higher).

Any help is appreciated. Thanks in advance.

Edit - Full Output:

clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c calcPosAvgCost.c -o calcPosAvgCost.o
calcPosAvgCost.c:31:12: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
        if(abs(d_PrevPosQty) > abs(d_PosQty[i])){
           ^
calcPosAvgCost.c:31:12: note: use function 'fabs' instead
        if(abs(d_PrevPosQty) > abs(d_PosQty[i])){
           ^~~
           fabs
calcPosAvgCost.c:31:32: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
        if(abs(d_PrevPosQty) > abs(d_PosQty[i])){
                               ^
calcPosAvgCost.c:31:32: note: use function 'fabs' instead
        if(abs(d_PrevPosQty) > abs(d_PosQty[i])){
                               ^~~
                               fabs
2 warnings generated.
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.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 blotter.so calcPosAvgCost.o 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-blotter/00new/blotter/libs
** R
** data
*** moving datasets to lazyload DB
** demo
** byte-compile and prepare package for lazy loading
Error: (converted from warning) package ‘xts’ was built under R version 4.0.2
Execution halted
ERROR: lazy loading failed for package ‘blotter’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/blotter’
Error: Failed to install 'blotter' from GitHub:
  (converted from warning) installation of package ‘/var/folders/7f/fzwn25053j3bp0yd_7swzf540000gn/T//Rtmp5kiwSh/file14db956d7f3bb/blotter_0.15.0.tar.gz’ had non-zero exit status
2
I’m confused. Rtools is usually a term I associate with Windoze.IRTFM
@IRTFM I misspoke and will edit this post. I installed the development tool Clang 8.0 form cran.r-project.org/bin/macosx/tools Apologize for the confusion.rocc
There must be more in the log that says what the actual error was. Can you please provide the complete output of install_github("braverock/blotter") ?MrFlick
@MrFlick Provided!rocc

2 Answers

1
votes

Ok I found the fix to this issue.

I followed the formula from a previous question regarding quanstrat from @boniface316:

Installing quantstrat via cmd works well for me. Here are the steps:

  1. Create a folder for packages i.e RPackages\
  2. Download the file from github to that specific folder and extract the files to the library name. i.e RPackages\quantstrat\
  3. Go on command line and goto RPackages
  4. Type" R CMD build quantstrat If it was successful, you will get a message like "building 'package_name_version_number.tar.gz'"
  5. Now type: R CMD INSTALL package_name_version_number.tar.gz

Let me know if you have any other challenges.

This allowed me to install Blotter but not Quantstrat. After playing around with this for awhile, I eventually deleted the Vignettes folder in quanstrat and repeated the steps above. By deleting this folder, I was able to both build and install quantstrat.

0
votes

After manually installing blotter (check the steps given in the above post), running this command worked for me. This is for the latest R versions (3.6 or 4.0 ).

devtools::install_github("braverock/quantstrat", force = TRUE )

or download the older (for R 3.4 or older) version zip from "https://r-forge.r-project.org/R/?group_id=316" (note: you might see "Build status: Failed to build", hence download the older version, you can see the option on the page )