Changeset: 24f47fb044f3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=24f47fb044f3
Modified Files:
tools/embedded/demo.c
tools/embedded/undef.h
Branch: embedded
Log Message:
fixed c demo
diffs (62 lines):
diff --git a/tools/embedded/demo.c b/tools/embedded/demo.c
--- a/tools/embedded/demo.c
+++ b/tools/embedded/demo.c
@@ -8,6 +8,9 @@
/*
configure & install MonetDB as follows:
+hg update embedded
+./bootstrap
+
./configure --prefix=/tmp/embedded-install --enable-embedded \
--disable-fits --disable-geom --disable-rintegration --disable-gsl
--disable-netcdf \
--disable-jdbc --disable-merocontrol --disable-odbc --disable-console
--disable-microhttpd \
@@ -17,11 +20,13 @@
make -j clean install
then build this file as follows:
+gcc tools/embedded/demo.c -Wl,-all_load \
+`find common clients/mapilib/ gdk monetdb5/mal monetdb5/modules
monetdb5/optimizer sql tools/embedded -name "*.o" | tr "\n" " "` \
+-Imonetdb5/mal -Igdk -Icommon/stream -Icommon/options -I. -I
sql/backends/monet5 -Isql/include \
+-Imonetdb5/modules/atoms -Isql/server -Isql/common -Isql/storage
-Iclients/mapilib \
+-Imonetdb5/modules/mal -g -lz -lpcre -liconv
-gcc demo.c -I../../monetdb5/mal -I../../gdk -I../../common/stream
-I../../common/options \
--I../../ -I ../../sql/backends/monet5 -I../../sql/include
-I../../monetdb5/modules/atoms \
--I../../sql/server -I ../../sql/common -I../../sql/storage
-I../../clients/mapilib \
--I../../monetdb5/modules/mal -lembedded -lbat -L/tmp/embedded-install/lib -g
+./a.out
*/
@@ -31,7 +36,7 @@ int main() {
res_table* result = NULL;
// we want to get rid of first argument, this is why we want to inline
mal/sql scripts and have fat library
- err = monetdb_startup("/dev/null", "/tmp/embedded-dbfarm", 1);
+ err = monetdb_startup("/tmp/embedded-dbfarm", 1, 0);
if (err != NULL) {
fprintf(stderr, "Init fail: %s\n", err);
return -1;
diff --git a/tools/embedded/undef.h b/tools/embedded/undef.h
--- a/tools/embedded/undef.h
+++ b/tools/embedded/undef.h
@@ -9,7 +9,7 @@
#undef HAVE_NETCDF
#undef HAVE_SAMTOOLS
-#ifdef HAVE_EMBEDDED
+#ifdef HAVE_EMBEDDED_R
extern FILE* embedded_stdout;
extern FILE* embedded_stderr;
@@ -21,9 +21,7 @@ extern FILE* embedded_stderr;
#define stdout embedded_stdout
#undef stderr
#define stderr embedded_stderr
-#endif
-#ifdef HAVE_EMBEDDED_R
#define srand(seed) ((void) (seed))
extern int embedded_r_rand(void);
#define rand embedded_r_rand
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list