Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into ihn/update-0.30.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed Oct 2, 2024
2 parents a8d6788 + 851018e commit 4d0e521
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

* This release of the R package builds against [TileDB 2.26.2](https://github.com/TileDB-Inc/TileDB/releases/tag/2.26.2), and has also been tested against earlier releases as well as the development version (#757)

* [#760](https://github.com/TileDB-Inc/TileDB-R/issues/758) Fix MacOS `rpath`

* [#758](https://github.com/TileDB-Inc/TileDB-R/issues/758) Fix "Can't read domain for dimensions of type UINT16"


# tiledb 0.30.1

* This release of the R package builds against [TileDB 2.26.1](https://github.com/TileDB-Inc/TileDB/releases/tag/2.26.1), and has also been tested against earlier releases as well as the development version (#757)
Expand Down
6 changes: 5 additions & 1 deletion inst/tinytest/test_dim.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ for (dtype in dimtypes) {
"INT64" = as.integer64(1000),
1000) # default is 1000

domain <- tiledb_domain(tiledb_dim("row", dom, tile, dtype))
dimension <- tiledb_dim("row", dom, tile, dtype)
if (dtype != "ASCII") { # no extent for string dims
expect_silent(tile(dimension))
}
domain <- tiledb_domain(dimension)
attrib <- tiledb_attr("attr", type = "INT32")
schema <- tiledb_array_schema(domain, attrib, sparse=TRUE)
tiledb_array_create(uri, schema)
Expand Down
19 changes: 11 additions & 8 deletions src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ LIB_CON_DIR = ../inst/lib$(R_ARCH)
LIB_CON = $(LIB_CON_DIR)/libconnection@DYLIB_EXT@

all: $(OBJECTS) $(LIB_CON) $(SHLIB)
# if we are
# - on macOS aka Darwin which needs this
# - the library is present (implying non-system library use)
# then let us call install_name_tool
@if [ `uname -s` = 'Darwin' ] && [ -f ../inst/tiledb/lib/libtiledb.dylib ] && [ -f tiledb.so ]; then \
install_name_tool -change libz.1.dylib @rpath/libz.1.dylib ../inst/tiledb/lib/libtiledb.dylib; \
install_name_tool -add_rpath @loader_path/../tiledb/lib tiledb.so; \
install_name_tool -add_rpath @loader_path/../tiledb/lib $(LIB_CON); \
# On macOS aka Darwin we call install_name_tool
# Case one: If we had a downloaded TileDB Core artifact, adjust zlib path and add to @rpath
# Case two: If we see the system libraries (on macOS) ensure /usr/local/lib rpath is considered
@if [ `uname -s` = 'Darwin' ] && [ -f tiledb.so ]; then \
if [ -f ../inst/tiledb/lib/libtiledb.dylib ] ; then \
install_name_tool -change libz.1.dylib @rpath/libz.1.dylib ../inst/tiledb/lib/libtiledb.dylib; \
install_name_tool -add_rpath @loader_path/../tiledb/lib tiledb.so; \
fi; \
if [ -f /usr/local/lib/libtiledb.dylib ] ; then \
install_name_tool -add_rpath /usr/local/lib tiledb.so; \
fi; \
fi

$(LIB_CON): connection/connection.o
Expand Down
6 changes: 3 additions & 3 deletions src/libtiledb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ XPtr<tiledb::Dimension> libtiledb_dim(XPtr<tiledb::Context> ctx,
Rcpp::stop("dimension domain must be a c(lower bound, upper bound) pair");
}
std::array<uint16_t, 2> _domain = {static_cast<uint16_t>(domain_vec[0]), static_cast<uint16_t>(domain_vec[1])};
int16_t _tile_extent = Rcpp::as<int16_t>(tile_extent);
uint16_t _tile_extent = Rcpp::as<uint16_t>(tile_extent);
auto dim = new tiledb::Dimension(tiledb::Dimension::create<uint16_t>(*ctx.get(), name, _domain, _tile_extent));
auto ptr = make_xptr<tiledb::Dimension>(dim);
return ptr;
Expand Down Expand Up @@ -925,7 +925,7 @@ SEXP libtiledb_dim_get_domain(XPtr<tiledb::Dimension> dim) {
dim->domain<DataType>().second});
}
case TILEDB_UINT16: {
using DataType = tiledb::impl::tiledb_to_type<TILEDB_INT16>::type;
using DataType = tiledb::impl::tiledb_to_type<TILEDB_UINT16>::type;
return IntegerVector({dim->domain<DataType>().first,
dim->domain<DataType>().second});
}
Expand Down Expand Up @@ -1027,7 +1027,7 @@ SEXP libtiledb_dim_get_tile_extent(XPtr<tiledb::Dimension> dim) {
return Rcpp::wrap(static_cast<int32_t>(dim->tile_extent<DataType>()));
}
case TILEDB_UINT16: {
using DataType = tiledb::impl::tiledb_to_type<TILEDB_INT16>::type;
using DataType = tiledb::impl::tiledb_to_type<TILEDB_UINT16>::type;
return Rcpp::wrap(static_cast<int32_t>(dim->tile_extent<DataType>()));
}
case TILEDB_INT32: {
Expand Down

0 comments on commit 4d0e521

Please sign in to comment.