Skip to content

Commit

Permalink
download gsl for win
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejiang committed Nov 19, 2020
1 parent 2d13cae commit 8c56869
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 43 deletions.
41 changes: 0 additions & 41 deletions inst/README

This file was deleted.

17 changes: 15 additions & 2 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
PKG_LIBS += -L$(LIB_GSL)$(R_ARCH)/lib -lgsl -lgslcblas -lm
PKG_CPPFLAGS += -I$(RHOME)/src/include -I$(LIB_GSL)$(R_ARCH)/include
VERSION=2.4
RWINLIB=../windows/gsl-$(VERSION)

PKG_LIBS += -L$(RWINLIB)/lib$(R_ARCH) -lgsl -lgslcblas -lm
PKG_CPPFLAGS += -I$(RHOME)/src/include -I$(RWINLIB)/include

all: clean winlibs

clean:
rm -f $(OBJECTS) $(SHLIB)

winlibs:
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION)

.PHONY: all winlibs clean
9 changes: 9 additions & 0 deletions tools/winlibs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Build against static libraries from rwinlib
VERSION <- commandArgs(TRUE)
if(!file.exists(sprintf("../windows/gsl-%s/include/gsl/gs_math.h", VERSION))){
if(getRversion() < "3.3.0") setInternet2()
download.file(sprintf("https://github.com/rwinlib/gsl/archive/v%s.zip", VERSION), "lib.zip", quiet = TRUE)
dir.create("../windows", showWarnings = FALSE)
unzip("lib.zip", exdir = "../windows")
unlink("lib.zip")
}

0 comments on commit 8c56869

Please sign in to comment.