File: winlibs.R

package info (click to toggle)
rquantlib 0.4.26-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,312 kB
  • sloc: cpp: 3,560; sh: 69; makefile: 6; ansic: 4
file content (19 lines) | stat: -rw-r--r-- 990 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
if(!file.exists("../windows/quantlib/include/ql/quantlib.hpp")){
  unlink("../windows", recursive = TRUE)
  url <- if(grepl("aarch", R.version$platform)){
    "https://github.com/r-windows/bundles/releases/download/quantlib-1.32/quantlib-1.32-clang-aarch64.tar.xz"
  } else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
    "https://github.com/r-windows/bundles/releases/download/quantlib-1.32/quantlib-1.32-clang-x86_64.tar.xz"
  } else if(getRversion() >= "4.3") {
    "https://github.com/r-windows/bundles/releases/download/quantlib-1.32/quantlib-1.32-ucrt-x86_64.tar.xz"
  } else {
    "https://github.com/rwinlib/quantlib/archive/v1.29.tar.gz"
  }
  download.file(url, basename(url), quiet = TRUE)
  dir.create("../windows", showWarnings = FALSE)
  untar(basename(url), exdir = "../windows", tar = 'internal')
  unlink(basename(url))
  setwd("../windows")
  file.rename(list.files(), 'quantlib')
  if(file.exists("quantlib/lib.zip")) unzip("quantlib/lib.zip", exdir = "quantlib")
}