-
Notifications
You must be signed in to change notification settings - Fork 18
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
Providing access to the TileDB-R shared libraries in downstream packages #780
Comments
Hi @LTLA; this functionality is now available in the development version of TileDB-R; you can install the development version of TileDB-R from GitHub with install.packages("tiledb", repos = c("https://tiledb-inc.r-universe.dev", getOption("repos"))) Please let us know if you need more for this functionality to work with |
Nice, thanks - I'll check it out tonight/tomorrow. |
BTW/FYI we anticipate a 0.31.0 release of this package in the next couple weeks |
Works like a charm on Linux and MacOS. Unfortunately, on Windows, there are a few issues. The first is at: Line 179 in ffabb43
The quotes introduced by After fixing the
Dunno what's going on here, because the same FWIW I'm using Rtools 4.4 on R 4.4.1, and I installed tiledb from GitHub (ffabb43). |
Update: I finally got it to work on Windows with the following code: PKG_CXX_FLAGS = switch(
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 -DTILEDB_STATIC_DEFINE -DTILEDB_SILENT_BUILD",
shQuote(pkgdir, type = "cmd"),
shQuote(lib, type = "cmd"),
shQuote(lib, type = "cmd")
),
sprintf("-I%s/include -I%s/include", pkgdir, lib)
),
PKG_CXX_LIBS = switch(
EXPR = .Platform$OS.type,
# rwinlib-tiledb is structured slightly differently than libtiledb for
# Unix-alikes; R 4.2 and higher require ucrt
windows = {
arch <- .Platform$r_arch
libs <- as.vector(vapply(
c(pkgdir, lib),
FUN = \(x) c(
ifelse(
test = getRversion() > '4.2.0',
yes = sprintf("%s/lib/%s-ucrt", x, arch),
no = sprintf("%s/lib/%s", x, arch)
)
),
FUN.VALUE = character(1L),
USE.NAMES = FALSE
))
paste(paste(paste0('-L', shQuote(Filter(dir.exists, libs), type="sh")), collapse = ' '), "-ltiledbstatic -ltiledb -lbz2 -lzstd -llz4 -lz -lspdlog -lfmt -laws-cpp-sdk-identity-management -laws-cpp-sdk-cognito-identity -laws-cpp-sdk-sts -laws-cpp-sdk-s3 -laws-cpp-sdk-core -llibmagic -lwebp -lpcre2-posix -lpcre2-8 -laws-crt-cpp -laws-c-mqtt -laws-c-event-stream -laws-c-s3 -laws-c-auth -laws-c-http -laws-c-io -lSecur32 -lCrypt32 -laws-c-compression -laws-c-cal -lNCrypt -laws-c-sdkutils -laws-checksums -laws-c-common -lBCrypt -lKernel32 -lRpcrt4 -lWininet -lWinhttp -lWs2_32 -lShlwapi -lUserenv -lversion -lws2_32 -lsharpyuv")
},
sprintf("-ltiledb -L%s/lib -L%s/lib", pkgdir, lib)
) replacing L158-192 of |
Fix issues with `.pkg_config()` on Windows; include new include and linking flags as suggested by @LTLA [SC-60076](https://app.shortcut.com/tiledb-inc/story/60076) resolves #780
I have an R package (beachmat.tiledb) that vendors a C++ library that links to the TileDB C++ library. I would like my package to be installable even if TileDB is not installed in the system, so I was going to download the TileDB release binaries myself. However, I noticed that tiledb-R's installation directory already contains a copy of the binaries in its
tiledb/
directory. I would like to be able to use these binaries to avoid having to duplicate tiledb-R'sconfigure.ac
in my own package. (This also avoids the creation of redundant copies of the TileDB binaries scattered throughout the user's R installation directory.)Would you consider adding a little function that sets up the
Makevars
flags for downstream packages to link to these binaries? Based on theconfigure.ac
, it would look something like this (for Linux/MacOS):Downstream packages could then create a little
Makevars
as shown below, allowing their C++ code to compile against tiledb-R's copy of the binaries (or the system libraries, if available).This could be (easily?) extended to Windows, if the newly built static library was deposited somewhere in
inst/
so thatpkgconfig()
could reference it later in theirMakevars.win
.FWIW this proposal is based on the strategy used by the Rhdf5lib and Rhtslib packages.
The text was updated successfully, but these errors were encountered: