Skip to content

Commit

Permalink
Windows: update zeromq libs + arm64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Oct 10, 2023
1 parent 0520dda commit 449af36
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: '4.2'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ src/*.so
clustermq.Rcheck
src/Makevars
.github/*.html
windows
2 changes: 0 additions & 2 deletions src/Makevars.ucrt

This file was deleted.

10 changes: 5 additions & 5 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
GCC_VERSION = ${subst gcc,,${COMPILED_BY}}
RWINLIB = ../windows/zeromq-4.3.4

RWINLIB = ../windows/zeromq
OLDLIBDIR = lib$(subst gcc,,$(COMPILED_BY))$(R_ARCH)
PKG_CPPFLAGS = -DZMQ_STATIC -DZMQ_BUILD_DRAFT_API=1 \
-Icppzmq -I${RWINLIB}/include

PKG_LIBS = \
-L${RWINLIB}/lib${GCC_VERSION}${R_ARCH} \
-L${RWINLIB}/lib${R_ARCH}${CRT} \
-L$(RWINLIB)/$(OLDLIBDIR) \
-L$(RWINLIB)/lib$(R_ARCH) \
-L$(RWINLIB)/lib \
-lzmq -lsodium -liphlpapi -lws2_32

all: clean winlibs
Expand Down
22 changes: 16 additions & 6 deletions tools/winlibs.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# Build against precompiled zeromq libs.
if(!file.exists("../windows/zeromq-4.3.4/include/zmq.h")){
if(getRversion() < "3.3.0") setInternet2()
download.file("https://github.com/rwinlib/zeromq/archive/v4.3.4.zip", "lib.zip", quiet = TRUE)
if(!file.exists("../windows/zeromq/include")){
unlink("../windows", recursive = TRUE)
url <- if(grepl("aarch", R.version$platform)){
"https://github.com/r-windows/bundles/releases/download/zeromq-4.3.4/zeromq-4.3.4-clang-aarch64.tar.xz"
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
"https://github.com/r-windows/bundles/releases/download/zeromq-4.3.4/zeromq-4.3.4-clang-x86_64.tar.xz"
} else if(getRversion() >= "4.3") {
"https://github.com/r-windows/bundles/releases/download/zeromq-4.3.4/zeromq-4.3.4-ucrt-x86_64.tar.xz"
} else {
"https://github.com/rwinlib/zeromq/archive/4.3.4.tar.gz"
}
download.file(url, basename(url), quiet = TRUE)
dir.create("../windows", showWarnings = FALSE)
unzip("lib.zip", exdir = "../windows")
unlink("lib.zip")
untar(basename(url), exdir = "../windows", tar = 'internal')
unlink(basename(url))
setwd("../windows")
file.rename(list.files(), 'zeromq')
}

0 comments on commit 449af36

Please sign in to comment.