Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ vignettes/md/
# vim
.sw?
.*.sw?
inst/tiledb/
inst/lib/
23 changes: 19 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,30 @@ SystemRequirements: A C++17 compiler is required; on macOS compilation version 1
build selected); on x86_64 and M1 platforms pre-built TileDB Embedded libraries
are available at GitHub and are used if no TileDB installation is detected, and
no other option to build or download was specified by the user.
Depends:
R (>= 4.2)
Imports:
methods,
Rcpp (>= 1.0.8),
nanoarrow,
nanotime,
Rcpp (>= 1.0.8),
spdl,
nanoarrow,
tools
LinkingTo: Rcpp, RcppInt64, nanoarrow
Suggests: tinytest, simplermarkdown, curl, bit64, Matrix, palmerpenguins, nycflights13, data.table, tibble, arrow
LinkingTo:
nanoarrow,
Rcpp,
RcppInt64
Suggests:
arrow,
bit64,
curl,
data.table,
Matrix,
nycflights13,
palmerpenguins,
simplermarkdown,
tibble,
tinytest
VignetteBuilder: simplermarkdown
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Expand Down
122 changes: 103 additions & 19 deletions R/Version.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,20 @@ tiledb_version <- function(compact = FALSE) {
EXPR = .Platform$OS.type,
# Adapted from Makevars.win, which includes libdir/include/tiledb in
# addition to libdir/include and pkgdir/include
windows = sprintf(
"-I%s/include -I%s/include -I%s/include/tiledb",
shQuote(pkgdir, type = "cmd"),
shQuote(lib, type = "cmd"),
shQuote(lib, type = "cmd")
),
windows = {
include <- file.path(
c(pkgdir, lib, lib),
c("include", "include", "include/tiledb")
)
# Windows likes spaces, but Make does not
if (any(idx <- grepl("[[:space:]]", include))) {
include[idx] <- shQuote(include[idx], type = "cmd")
}
paste(
paste0("-I", include, collapse = " "),
"-DTILEDB_STATIC_DEFINE -DTILEDB_SILENT_BUILD"
)
},
sprintf("-I%s/include -I%s/include", pkgdir, lib)
),
PKG_CXX_LIBS = switch(
Expand All @@ -173,20 +181,96 @@ tiledb_version <- function(compact = FALSE) {
# Unix-alikes; R 4.2 and higher require ucrt
windows = {
arch <- .Platform$r_arch
libs <- as.vector(vapply(
c(pkgdir, lib),
FUN = \(x) c(
sprintf("%s/lib/%s", shQuote(x, type = "cmd"), arch),
ifelse(
test = getRversion() > '4.2.0',
yes = sprintf("%s/lib/%s-ucrt", shQuote(x, type = "cmd"), arch),
no = ""
)
libs <- c(
connection = sprintf("%s/lib/%s", pkgdir, arch),
libtiledb = sprintf("%s/lib/%s-ucrt", lib, arch)
)
libs <- Filter(dir.exists, libs)
# Windows requires additional linking flags, so we need flags for
# rwinlib-tiledb DLLs and Windows system DLLs; these have to be in
# a specific order so filter the rwinlib-tiledb DLLs to the ones
# we're using and interleave them with the Windows system DLLs
winlibs <- list(
c("Secur32", "Crypt32"),
"NCrypt",
c(
"BCrypt",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this replacing the makevars?

-lBCrypt -lKernel32 -lRpcrt4 -lWininet -lWinhttp -lWs2_32 -lShlwapi -lUserenv -lversion -lws2_32 \

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ihnorton Not for tiledb-r, but for any package downstream that links to libtiledb bundled with tiledb-r on Windows

"Kernel32",
"Rpcrt4",
"Wininet",
"Winhttp",
"Ws2_32",
"Shlwapi",
"Userenv",
"version",
"ws2_32"
)
)
tiledblibs <- list(
c(
"tiledbstatic",
"bz2",
"zstd",
"lz4",
"z",
"spdlog",
"fmt",
"aws-cpp-sdk-identity-management",
"aws-cpp-sdk-cognito-identity",
"aws-cpp-sdk-sts",
"aws-cpp-sdk-s3",
"aws-cpp-sdk-core",
"libmagic",
"webp",
"pcre2-posix",
"pcre2-8",
"aws-crt-cpp",
"aws-c-mqtt",
"aws-c-event-stream",
"aws-c-s3",
"aws-c-auth",
"aws-c-http",
"aws-c-io"
),
c(
"aws-c-compression",
"aws-c-cal"
),
c(
"aws-c-sdkutils",
"aws-checksums",
"aws-c-common"
),
FUN.VALUE = character(2L),
USE.NAMES = FALSE
))
paste('-ltiledb', paste0('-L', Filter(dir.exists, libs), collapse = ' '))
"sharpyuv"
)
flags <- if (!is.null(libs["libtiledb"])) {
dlls <- sub(
pattern = "^lib",
replacement = "",
tools::file_path_sans_ext(list.files(libs["libtiledb"]))
)
for (i in seq_along(tiledblibs)) {
tiledblibs[[i]] <- intersect(tiledblibs[[i]], dlls)
if (i > length(winlibs)) {
next
}
tiledblibs[[i]] <- if (length(tiledblibs[[i]])) {
c(tiledblibs[[i]], winlibs[[i]])
} else {
winlibs[[i]]
}
}
paste0("-l", unlist(tiledblibs), collapse = " ")
} else {
""
}
# Windows likes spaces, but Make does not
# This has to come after the flags bit as R does not like quotes
# in directory names
if (any(idx <- grepl("[[:space:]]", libs))) {
libs[idx] <- shQuote(libs[idx], type = "cmd")
}
paste("-ltiledb", paste0("-L", libs, collapse = " "), flags)
},
sprintf("-ltiledb -L%s/lib -L%s/lib", pkgdir, lib)
)
Expand Down
4 changes: 3 additions & 1 deletion TileDB-R.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Yes
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
Expand All @@ -19,3 +19,5 @@ BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source --install-tests
PackageRoxygenize: rd,namespace

QuitChildProcessesOnExit: Yes
Loading