Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: build against nlopt 2.7.1 #92

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
}