Skip to content

Commit

Permalink
Merge pull request #105 from jeroen/master
Browse files Browse the repository at this point in the history
Build on windows using rwinlib and BH
  • Loading branch information
eddelbuettel committed Apr 27, 2018
2 parents bb49881 + e42d071 commit f3fd11c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
FIXME
misc
Contributing.md
windows
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ src/*.o
src/*.so
src/*.dll
/FIXME
windows
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Imports: methods, Rcpp (>= 0.11.0), stats, graphics, zoo
LinkingTo: Rcpp
SystemRequirements: QuantLib library (>= 1.8.0) from http://quantlib.org,
Boost library from http://www.boost.org
OS_type: unix
License: GPL (>= 2)
URL: http://dirk.eddelbuettel.com/code/rquantlib.html
BugReports: https://github.com/eddelbuettel/rquantlib/issues
Expand Down
35 changes: 18 additions & 17 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# -*- mode: Makefile -*-
#
# Copyright 2005 - 2006 Dominick Samperi
# Copyright 2005 Uwe Ligges
# Copyright 2008 - 2015 Dirk Eddelbuettel
# Copyright 2011 Uwe Ligges, Brian Ripley, and Josh Ulrich

## This assumes that we can call Rscript to ask Rcpp about its locations
## Use the R_HOME indirection to support installations of multiple R version
## Commented out as Rcpp 0.11.0 and later no longer require this
#RCPP_LDFLAGS = $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")

## The environment variable QUANTLIB_ROOT has to point to an existing build of QuantLib
## With R 2.12.0 and later, we also support 32 and 64 bit builds and need to differentiate
PKG_CPPFLAGS=-I$(QUANTLIB_ROOT) -I../inst/include -I. -I$(BOOSTLIB)
PKG_CXXFLAGS=$(SHLIB_OPENMP_CFLAGS) -fpermissive
PKG_LIBS=-L$(QUANTLIB_ROOT)/lib${R_ARCH} -lQuantLib $(SHLIB_OPENMP_CFLAGS)
# -*- mode: Makefile -*-
#
# Copyright 2005 - 2006 Dominick Samperi
# Copyright 2005 Uwe Ligges
# Copyright 2008 - 2015 Dirk Eddelbuettel
# Copyright 2011 Uwe Ligges, Brian Ripley, and Josh Ulrich
RWINLIB=../windows/quantlib-1.12.1
PKG_CPPFLAGS=-I$(RWINLIB)/include -I../inst/include
PKG_CXXFLAGS=$(SHLIB_OPENMP_CFLAGS)
PKG_LIBS=-L$(RWINLIB)/lib${R_ARCH} -lQuantLib $(SHLIB_OPENMP_CFLAGS)

all: clean winlibs

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

winlibs:
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R"
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 mingw-w64 build of quantlib
if(!file.exists("../windows/quantlib-1.12.1/include/ql/quantlib.hpp")){
if(getRversion() < "3.3.0") setInternet2()
download.file("https://github.com/rwinlib/quantlib/archive/v1.12.1.zip", "lib.zip", quiet = TRUE)
dir.create("../windows", showWarnings = FALSE)
unzip("lib.zip", exdir = "../windows")
unzip("../windows/quantlib-1.12.1/lib.zip", exdir = "../windows/quantlib-1.12.1")
unlink("lib.zip")
}

0 comments on commit f3fd11c

Please sign in to comment.