Changeset: 33d7f469d50e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=33d7f469d50e
Added Files:
        java/embedded/build-all.sh
        java/embedded/readme.txt
Modified Files:
        monetdb5/mal/mal_authorize.c
        monetdb5/modules/mal/pcre.c
        sql/backends/monet5/sql_scenario.c
        tools/embedded/embedded.h
        tools/embedded/embeddedr.h
Branch: embedded-java
Log Message:

Add a readme and simple build script

Avoid a few compiler warnings.


diffs (129 lines):

diff --git a/java/embedded/build-all.sh b/java/embedded/build-all.sh
new file mode 100755
--- /dev/null
+++ b/java/embedded/build-all.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+if [ -z "$1" ]; then
+       echo Please provide a location for the MonetDB installation
+       exit 1;
+fi
+
+export MONETDB_HOME=$1
+
+cd ../../
+## Bootstrap
+sh bootstrap
+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
+## Configure
+mkdir BUILD
+cd BUILD
+sh ../configure --prefix=$MONETDB_HOME --disable-fits --disable-netcdf 
--disable-gsl --disable-geom --disable-merocontrol --disable-odbc 
--disable-microhttpd --without-perl --without-python2 --without-python3 
--without-rubygem --without-unixodbc --without-readline --enable-embedded 
--enable-embedded-java
+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
+## Build
+make -j && make install
+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
+## Build embedded Java and test
+cd ../java/embedded
+mvn clean install
diff --git a/java/embedded/readme.txt b/java/embedded/readme.txt
new file mode 100644
--- /dev/null
+++ b/java/embedded/readme.txt
@@ -0,0 +1,30 @@
+# Building
+The embedded Java version of MonetDB requires a few options to be set in order 
to build the required libraries and NOT build some of the undeeded binaries.
+
+## Setting environmental variables
+In order for the embedded Java to find the MonetDB libraries we are currently 
using an environmental variables. The same one would be used as a prefix when 
configuring the MonetDB build (see blow in 'Building MonetDB).
+$ export MONETDB_HOME=<location to installation directory>
+
+## Building MonetDB
+Navigate the the main sources dir and bootstrap the build.
+$ sh bootsrap
+Create a BUILD directory and run the configure script found in the main 
sources dir. Set a prefix location using 
+$ ../configure --prefix=$MONETDB_HOME --enable-embedded --enable-embedded-java
+
+Then run make to build libs and make install to put them in place
+$ make -j && make install
+
+## Building embedded Java
+Navigate to the main sources dir and then to java/embedded. Or most likely 
where this readmy file is. Run Maven build.
+$ mvn clean install
+
+The process uses the preset MONETDB_HOME variable for the location of the 
libraries. It will also run a set of unit test to validate the build.
+
+## Alternativly
+Run the build-all.sh found in the directory along with this file, supplying 
the location of the installation directory as the only argument.
+$ build-all.sh <location to installation directory>
+
+# Usage
+After building it all, you can use the Java binaries. In the test dir you can 
see examples of how to use either the native columnar interface or the JDBC one.
+Remember to set the MONETDB_HOME environmental variable and the 
-Djava.library.path flag, providing the MonetDB installation directory 
location. E.g.
+-Djava.library.path=$MONETDB_HOME
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -740,6 +740,7 @@ AUTHverifyPassword(str *passwd)
 {
        char *p = *passwd;
        size_t len = strlen(p);
+       (void)len;
 
 #ifdef HAVE_RIPEMD160
        if (strcmp(MONETDB5_PASSWDHASH, "RIPEMD160") == 0) {
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -213,6 +213,7 @@ re_destroy( RE *p)
 #define m2p(p) (pcre*)(((size_t*)p)+1)
 #define p2m(p) (pcre*)(((size_t*)p)-1)
 
+#ifndef HAVE_EMBEDDED_JAVA
 static void *
 my_pcre_malloc(size_t s)
 {
@@ -223,6 +224,7 @@ my_pcre_malloc(size_t s)
        *sz = s + sizeof(size_t);
        return (void *) (sz + 1);
 }
+#endif
 
 static void
 my_pcre_free(void *blk)
diff --git a/sql/backends/monet5/sql_scenario.c 
b/sql/backends/monet5/sql_scenario.c
--- a/sql/backends/monet5/sql_scenario.c
+++ b/sql/backends/monet5/sql_scenario.c
@@ -407,6 +407,7 @@ SQLinitClient(Client c)
 {
        mvc *m;
        str schema;
+       (void) schema;
        str msg = MAL_SUCCEED;
        backend *be;
        bstream *bfd = NULL;
diff --git a/tools/embedded/embedded.h b/tools/embedded/embedded.h
--- a/tools/embedded/embedded.h
+++ b/tools/embedded/embedded.h
@@ -20,7 +20,7 @@ typedef struct append_data {
 
 extern int monetdb_embedded_initialized;
 
-void* monetdb_connect();
+void* monetdb_connect(void);
 void  monetdb_disconnect(void* conn);
 char* monetdb_startup(char* libdir, char* dbdir, char silent);
 char* monetdb_query(void* conn, char* query, void** result);
diff --git a/tools/embedded/embeddedr.h b/tools/embedded/embeddedr.h
--- a/tools/embedded/embeddedr.h
+++ b/tools/embedded/embeddedr.h
@@ -19,7 +19,7 @@
 SEXP  monetdb_query_R(SEXP connsexp, SEXP querysexp, SEXP notreally);
 SEXP  monetdb_startup_R(SEXP installdirsexp, SEXP dbdirsexp, SEXP silentsexp);
 SEXP  monetdb_append_R(SEXP connsexp, SEXP schemaname, SEXP tablename, SEXP 
tabledata);
-SEXP  monetdb_connect_R();
+SEXP  monetdb_connect_R(void);
 SEXP  monetdb_disconnect_R(SEXP connsexp);
 
 #endif
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to