Skip to content

Commit

Permalink
Merge pull request #92 from jeroen/master
Browse files Browse the repository at this point in the history
Windows: build against nlopt 2.7.1
  • Loading branch information
astamm authored Jan 17, 2022
2 parents a74c5ba + 7f30707 commit 397e765
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 37 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: windows-2022, r: 'devel'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
Expand Down
35 changes: 0 additions & 35 deletions configure.win

This file was deleted.

2 changes: 2 additions & 0 deletions src/Makevars.ucrt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CRT=-ucrt
include Makevars.win
14 changes: 12 additions & 2 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
CXX_STD = CXX11
PKG_CPPFLAGS = -I../inst/include
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) -Lnlopt$(R_ARCH)/lib -lnlopt
VERSION = 2.7.1
WINLIBS = ../windows/nlopt-2.7.1
PKG_CPPFLAGS = -I../inst/include -I$(WINLIBS)/include
PKG_LIBS = -L$(WINLIBS)/lib${R_ARCH}${CRT} -lnlopt

all: clean winlibs

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

clean:
rm -f $(SHLIB) $(OBJECTS)
7 changes: 7 additions & 0 deletions tools/winlibs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Build against mingw-w64 build of nlopt
if(!file.exists("../windows/nlopt-2.7.1/include/nlopt.hpp")){
download.file("https://github.com/rwinlib/nlopt/archive/v2.7.1.zip", "lib.zip", quiet = TRUE)
dir.create("../windows", showWarnings = FALSE)
unzip("lib.zip", exdir = "../windows")
unlink("lib.zip")
}

0 comments on commit 397e765

Please sign in to comment.