Changeset: a57ec9dde0fe for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a57ec9dde0fe
Modified Files:
        clients/R/MonetDB.R/DESCRIPTION
        clients/R/MonetDB.R/NAMESPACE
        clients/R/MonetDB.R/R/dbi.R
        clients/R/MonetDB.R/R/dplyr.R
        clients/R/Tests/dplyr-flights.R
        clients/R/Tests/dplyr.R
        configure.ag
        monetdb5/extras/rapi/converters.c.h
        tools/embedded/Tests/dbi.R
        tools/embedded/Tests/dplyr.R
        tools/embedded/build-on-windows.bat
        tools/embedded/build-rpkg.sh
        tools/embedded/embeddedr.h
        tools/embedded/rpackage/DESCRIPTION
        tools/embedded/rpackage/configure
Branch: default
Log Message:

salvaged some minor changes from embedded branch that were not pushed before


diffs (256 lines):

diff --git a/clients/R/MonetDB.R/DESCRIPTION b/clients/R/MonetDB.R/DESCRIPTION
--- a/clients/R/MonetDB.R/DESCRIPTION
+++ b/clients/R/MonetDB.R/DESCRIPTION
@@ -10,7 +10,6 @@ Imports: DBI (>= 0.3.1), digest (>= 0.6.
 Enhances: dplyr (>= 0.3.0), MonetDBLite
 Description: Allows to pull data from MonetDB into R. Includes a DBI 
implementation and a dplyr backend.
 License: MPL (== 2.0)
-URL: http://monetr.r-forge.r-project.org
+URL: http://www.monetdb.org
 SystemRequirements: MonetDB, available from http://www.monetdb.org or 
MonetDBLite R package
 Collate: mapi.R dbi.R dbapply.R dplyr.R control.R
-Additional_repositories: http://dev.monetdb.org/Assets/R/
diff --git a/clients/R/MonetDB.R/NAMESPACE b/clients/R/MonetDB.R/NAMESPACE
--- a/clients/R/MonetDB.R/NAMESPACE
+++ b/clients/R/MonetDB.R/NAMESPACE
@@ -4,7 +4,7 @@ import(DBI,digest,methods,codetools,util
 export(MonetDB,MonetR,MonetDBR,MonetDB.R)
 export(MonetDBLite,monetdblite,RMonetDBLite,rmonetdblite)
 export(monet.read.csv,monetdb.read.csv)
-# this one is not in the DBI
+# those are not in the DBI
 
exportMethods(dbSendUpdate,dbSendUpdateAsync,dbTransaction,mdbapply,isIdCurrent,initExtension)
 # shorthands
 export(mc,mq)
diff --git a/clients/R/MonetDB.R/R/dbi.R b/clients/R/MonetDB.R/R/dbi.R
--- a/clients/R/MonetDB.R/R/dbi.R
+++ b/clients/R/MonetDB.R/R/dbi.R
@@ -94,7 +94,7 @@ setMethod("dbConnect", "MonetDBDriver", 
   }
 
   if (embedded != FALSE) {
-    if (!require("MonetDBLite", character.only=T)) {
+    if (!requireNamespace("MonetDBLite", quietly=T)) {
       stop("MonetDBLite package required for embedded mode")
     }
     MonetDBLite::monetdb_embedded_startup(embedded, 
!getOption("monetdb.debug.embedded", FALSE))
diff --git a/clients/R/MonetDB.R/R/dplyr.R b/clients/R/MonetDB.R/R/dplyr.R
--- a/clients/R/MonetDB.R/R/dplyr.R
+++ b/clients/R/MonetDB.R/R/dplyr.R
@@ -4,10 +4,6 @@ src_monetdb <- function(dbname="demo", h
     con <- DBI::dbConnect(MonetDB.R(), dbname = dbname , host = host, port = 
port,
       user = user, password = password, ...)
   }
-  pkgname <- "MonetDB.R"
-  if (!(pkgname %in% loadedNamespaces())) {
-    attachNamespace(pkgname)
-  }
   dplyr::src_sql("monetdb", con, info = DBI::dbGetInfo(con))
 }
 
@@ -27,6 +23,8 @@ src_translate_env.src_monetdb <- functio
   )
 }
 
+src_desc <- function(x) UseMethod("src_desc")
+
 src_desc.src_monetdb <- function(x) {
   paste0("MonetDB ",x$info$monet_version, " (",x$info$monet_release, ")")
 }
diff --git a/clients/R/Tests/dplyr-flights.R b/clients/R/Tests/dplyr-flights.R
--- a/clients/R/Tests/dplyr-flights.R
+++ b/clients/R/Tests/dplyr-flights.R
@@ -10,6 +10,9 @@ dd <- capture.output( suppressMessages (
 
 library(dplyr, quietly=T)
 
+# FIXME: this should no longer be required 
+library(MonetDB.R, quietly = T)
+
 args <- commandArgs(trailingOnly = TRUE)
 dbport <- 50000
 dbname <- "mTests_clients_R"
diff --git a/clients/R/Tests/dplyr.R b/clients/R/Tests/dplyr.R
--- a/clients/R/Tests/dplyr.R
+++ b/clients/R/Tests/dplyr.R
@@ -10,6 +10,9 @@ dd <- capture.output( suppressMessages (
 
 library(dplyr, quietly = T)
 
+# FIXME: this should no longer be required 
+library(MonetDB.R, quietly = T)
+
 args <- commandArgs(trailingOnly = TRUE)
 dbport <- 50000
 dbname <- "mTests_clients_R"
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -3645,20 +3645,22 @@ echo "    largest decimal type: ${hge_di
 echo
 
 dnl give some hints to the user
-case "`make -v 2>&1`" in
-'GNU Make '*)
-       ;;
-*)
-       echo "'make' not found in PATH or not GNU Make."
-       case "`gmake -v 2>&1`" in
+if test "x$enable_embedded_r" == xno; then
+       case "`make -v 2>&1`" in
        'GNU Make '*)
-               echo "Please use 'gmake' to build MonetDB."
                ;;
        *)
-               echo "'gmake' not found in PATH or not GNU Make."
-               echo "Please make sure you have GNU Make installed and use it 
to build MonetDB."
+               echo "'make' not found in PATH or not GNU Make."
+               case "`gmake -v 2>&1`" in
+               'GNU Make '*)
+                       echo "Please use 'gmake' to build MonetDB."
+                       ;;
+               *)
+                       echo "'gmake' not found in PATH or not GNU Make."
+                       echo "Please make sure you have GNU Make installed and 
use it to build MonetDB."
+                       ;;
+               esac
+               echo
                ;;
        esac
-       echo
-       ;;
-esac
+fi
diff --git a/monetdb5/extras/rapi/converters.c.h 
b/monetdb5/extras/rapi/converters.c.h
--- a/monetdb5/extras/rapi/converters.c.h
+++ b/monetdb5/extras/rapi/converters.c.h
@@ -118,24 +118,24 @@ static SEXP bat_to_sexp(BAT* b) {
                                                        sexp_ptrs[offset] = 
mkCharCE(t, CE_UTF8);
                                                }
                                        }
-                                       STRING_ELT(varvalue, j++) = 
sexp_ptrs[offset];
+                                       SET_STRING_ELT(varvalue, j++, 
sexp_ptrs[offset]);
                                }
                                GDKfree(sexp_ptrs);
                        }
                        else {
                                if (b->T->nonil) {
                                        BATloop(b, p, q) {
-                                               STRING_ELT(varvalue, j++) = 
mkCharCE(
-                                                       (const char *) 
BUNtail(li, p), CE_UTF8);
+                                               SET_STRING_ELT(varvalue, j++, 
mkCharCE(
+                                                       (const char *) 
BUNtail(li, p), CE_UTF8));
                                        }
                                }
                                else {
                                        BATloop(b, p, q) {
                                                const char *t = (const char *) 
BUNtail(li, p);
                                                if (strcmp(t, str_nil) == 0) {
-                                                       STRING_ELT(varvalue, 
j++) = NA_STRING;
+                                                       
SET_STRING_ELT(varvalue, j++, NA_STRING);
                                                } else {
-                                                       STRING_ELT(varvalue, 
j++) = mkCharCE(t, CE_UTF8);
+                                                       
SET_STRING_ELT(varvalue, j++, mkCharCE(t, CE_UTF8));
                                                }
                                        }
                                }
diff --git a/tools/embedded/Tests/dbi.R b/tools/embedded/Tests/dbi.R
--- a/tools/embedded/Tests/dbi.R
+++ b/tools/embedded/Tests/dbi.R
@@ -4,6 +4,7 @@ if (basedir != "") {
 } else {
        library(MonetDBLite)
 }
+library(DBI)
 library(MonetDB.R)
 library(testthat)
 dbdir <- tempdir()
diff --git a/tools/embedded/Tests/dplyr.R b/tools/embedded/Tests/dplyr.R
--- a/tools/embedded/Tests/dplyr.R
+++ b/tools/embedded/Tests/dplyr.R
@@ -1,6 +1,7 @@
 library(testthat)
 library(MonetDB.R)
 library(dplyr)
+library(DBI)
 
 library(Lahman)
 data(Batting)
diff --git a/tools/embedded/build-on-windows.bat 
b/tools/embedded/build-on-windows.bat
--- a/tools/embedded/build-on-windows.bat
+++ b/tools/embedded/build-on-windows.bat
@@ -1,5 +1,5 @@
-rm MonetDBLite_0.2.0.zip
-"c:\Program Files (x86)\GnuWin32\bin\wget.exe" 
http://dev.monetdb.org/Assets/R/MonetDBLite_0.2.0.tar.gz
-"c:\Program Files\R\R-3.2.3\bin\R" CMD INSTALL --build --merge-multiarch 
MonetDBLite_0.2.0.tar.gz 
-rm MonetDBLite_0.2.0.tar.gz 
+rm MonetDBLite_0.2.1.zip
+"c:\Program Files (x86)\GnuWin32\bin\wget.exe" 
http://dev.monetdb.org/Assets/R/MonetDBLite_0.2.1.tar.gz
+"c:\Program Files\R\R-3.2.3\bin\R" CMD INSTALL --build --merge-multiarch 
MonetDBLite_0.2.1.tar.gz 
+rm MonetDBLite_0.2.1.tar.gz 
 pause
diff --git a/tools/embedded/build-rpkg.sh b/tools/embedded/build-rpkg.sh
--- a/tools/embedded/build-rpkg.sh
+++ b/tools/embedded/build-rpkg.sh
@@ -2,9 +2,9 @@
 #set -x
 
 STAGEDIR=/tmp/monetdb-embedded-stage
-RPKG=MonetDBLite_0.2.0.tar.gz
-OSXPKG=MonetDBLite_0.2.0.tgz
-WINPKG=MonetDBLite_0.2.0.zip
+RPKG=MonetDBLite_0.2.1.tar.gz
+OSXPKG=MonetDBLite_0.2.1.tgz
+WINPKG=MonetDBLite_0.2.1.zip
 
 rm -rf $STAGEDIR
 
diff --git a/tools/embedded/embeddedr.h b/tools/embedded/embeddedr.h
--- a/tools/embedded/embeddedr.h
+++ b/tools/embedded/embeddedr.h
@@ -13,7 +13,6 @@
 #ifndef _EMBEDDED_R_LIB_
 #define _EMBEDDED_R_LIB_
 
-#define USE_RINTERNALS 1
 #include <Rdefines.h>
 #include "embedded.h"
 
diff --git a/tools/embedded/rpackage/DESCRIPTION 
b/tools/embedded/rpackage/DESCRIPTION
--- a/tools/embedded/rpackage/DESCRIPTION
+++ b/tools/embedded/rpackage/DESCRIPTION
@@ -1,9 +1,11 @@
 Package: MonetDBLite
-Version: 0.2.0
+Version: 0.2.1
 Title: In-Process Version of MonetDB for R
 Authors@R: c(person("Hannes Muehleisen", role = c("aut", "cre"), email = 
"han...@cwi.nl"), person("MonetDB Development Team", role="ctb"))
 Author: Hannes Muehleisen [aut, cre], MonetDB Development Team [ctb]
 Maintainer: Hannes Muehleisen <han...@cwi.nl>
 Description: An in-process version of MonetDB, a relational database focused 
on analytical tasks. Similar to SQLite, the database runs entirely inside the R 
shell, with the main difference  that queries complete much faster thanks to 
MonetDB's columnar architecture.
-License: MPL (== 1.1)
+License: MPL (== 2.0)
 URL: http://www.monetdb.org
+SystemRequirements: GNU make
+Depends: R (>= 3.2.0)
diff --git a/tools/embedded/rpackage/configure 
b/tools/embedded/rpackage/configure
--- a/tools/embedded/rpackage/configure
+++ b/tools/embedded/rpackage/configure
@@ -13,7 +13,7 @@ CFLAGS="-I$R_INCLUDE_DIR" ./configure --
 LD_PACK_START=-Wl,--whole-archive
 LD_PACK_END=-Wl,--no-whole-archive
 gcc -v 2>&1 | grep LLVM
-if [ $? == 0 ]; then
+if [ $? -eq 0 ]; then
        LD_PACK_START=-Wl,-all_load
        LD_PACK_END=
 fi
@@ -24,7 +24,7 @@ libmonetdb5.so:
        $(R_HOME)/bin/R CMD SHLIB --output $@ '$LD_PACK_START' `find $(SUBDIRS) 
-name "*.o" | xargs echo` '$LD_PACK_END' -lz -lpcre
 
 all: $(BUILT_SOURCES) monetdb_config.h
-       $(MAKE) $(AM_MAKEFLAGS) all-recursive libmonetdb5.so
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive && $(MAKE) $(AM_MAKEFLAGS) 
libmonetdb5.so
 
 ' >> Makefile
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to