MonetDB: default - mclient progress meter part one, mal statemen...

Stefan Manegold Stefan.Manegold at cwi.nl
Tue Feb 24 10:54:23 CET 2015


This fails to compile, at least when BUILDDIR != SOURCEDIR:

========
make[5]: Entering directory `/net/rome.ins.cwi.nl/export/scratch1/manegold/Monet/HG/default/builds/_/clients/mapiclient'
/bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient -I../..  -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient -I../mapilib -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/../mapilib -I../../common/options -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/../../common/options -I../../common/stream -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/../../common/stream -I../R/MonetDB.R/src/ -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/../R/MonetDB.R/src/   -DLIBMCUTIL  -g   -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wpacked -Wunknown-pragmas -Wvariadic-macros -fstack-protector-all -Wstack-protector -Wpacked-bitfield-compat -Wsync-nand -Wjump-misses-init -Wmissing-include-dirs -Wlogical-op -Wunreachable-code  -D_REENTRANT  -c -o libmcutil_la-dump.lo `test -f 'dump.c' || echo '/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/'`dump.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient -I../.. -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient -I../mapilib -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/../mapilib -I../../common/options -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/../../common/options -I../../common/stream -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/../../common/stream -I../R/MonetDB.R/src/ -I/ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/../R/MonetDB.R/src/ -DLIBMCUTIL -g -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wpacked -Wunknown-pragmas -Wvariadic-macros -fstack-protector-all -Wstack-protector -Wpacked-bitfield-compat -Wsync-nand -Wjump-misses-init -Wmissing-include-dirs -Wlogical-op -Wunreachable-code -D_REENTRANT -c /ufs/manegold/_/Monet/HG/default/source/MonetDB/clients/mapiclient/dump.c  -fPIC -DPIC -o .libs/libmcutil_la-dump.o
cc1: error: ../R/MonetDB.R/src/: No such file or directory [-Werror]
cc1: all warnings being treated as errors
make[5]: *** [libmcutil_la-dump.lo] Error 1
make[5]: Leaving directory `/net/rome.ins.cwi.nl/export/scratch1/manegold/Monet/HG/default/builds/_/clients/mapiclient'
========

Stefan

----- Original Message -----
> Changeset: 18471e6cd453 for MonetDB
> URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=18471e6cd453
> Added Files:
> 	clients/mapiclient/mapisplit-dummy.c
> 	clients/mapiclient/profiler-dummy.c
> Modified Files:
> 	clients/mapiclient/Makefile.ag
> 	clients/mapiclient/mclient.c
> Branch: default
> Log Message:
> 
> mclient progress meter part one, mal statement progress
> 
> 
> diffs (148 lines):
> 
> diff --git a/clients/mapiclient/Makefile.ag b/clients/mapiclient/Makefile.ag
> --- a/clients/mapiclient/Makefile.ag
> +++ b/clients/mapiclient/Makefile.ag
> @@ -16,7 +16,7 @@
>  # All Rights Reserved.
>  
>  MTSAFE
> -INCLUDES = ../mapilib ../../common/options ../../common/stream
> $(READLINE_INCS)
> +INCLUDES = ../mapilib ../../common/options ../../common/stream
> ../R/MonetDB.R/src/ $(READLINE_INCS)
>  
>  lib_mcutil = {
>  	NOINST
> @@ -24,7 +24,7 @@ lib_mcutil = {
>  }
>  
>  bin_mclient = {
> -	SOURCES = mclient.c ReadlineTools.c ReadlineTools.h
> +	SOURCES = mclient.c ReadlineTools.c ReadlineTools.h mapisplit-dummy.c
> profiler-dummy.c
>  	LIBS = libmcutil ../mapilib/libmapi \
>  		../../common/stream/libstream \
>  		$(READLINE_LIBS) \
> diff --git a/clients/mapiclient/mapisplit-dummy.c
> b/clients/mapiclient/mapisplit-dummy.c
> new file mode 100644
> --- /dev/null
> +++ b/clients/mapiclient/mapisplit-dummy.c
> @@ -0,0 +1,5 @@
> +/*
> +This refers to ../R/MonetDB.R/src/mapisplit.c . We cannot have this file
> here,
> +as the R connector needs to be able to compile stand-alone.
> +*/
> +#include "mapisplit.c"
> \ No newline at end of file
> diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
> --- a/clients/mapiclient/mclient.c
> +++ b/clients/mapiclient/mclient.c
> @@ -78,6 +78,8 @@
>  #define S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
>  #endif
>  
> +#include "profiler.h"
> +
>  enum modes {
>  	MAL,
>  	SQL,
> @@ -1934,14 +1936,13 @@ doFileBulk(Mapi mid, FILE *fp)
>  			}
>  		}
>  		timerResume();
> -
>  		if (hdl == NULL) {
>  			hdl = mapi_query_prep(mid);
>  			CHECK_RESULT(mid, hdl, buf, continue, buf);
>  		}
>  
>  		assert(hdl != NULL);
> -
> +		profiler_arm();
>  		mapi_query_part(hdl, buf, length);
>  		CHECK_RESULT(mid, hdl, buf, continue, buf);
>  
> @@ -2722,6 +2723,8 @@ doFile(Mapi mid, const char *file, int u
>  
>  		if (hdl == NULL) {
>  			timerStart();
> +			profiler_arm();
> +
>  			hdl = mapi_query_prep(mid);
>  			CHECK_RESULT(mid, hdl, buf, continue, buf);
>  		} else
> @@ -2861,6 +2864,7 @@ usage(const char *prog, int xit)
>  	fprintf(stderr, " -w nr       | --width=nr         for pagination\n");
>  	fprintf(stderr, " -D          | --dump             create an SQL dump\n");
>  	fprintf(stderr, " -N          | --inserts          use INSERT INTO
>  	statements when dumping\n");
> +	fprintf(stderr, " -P          | --progress         show progress bar\n");
>  	fprintf(stderr, "The file argument can be - for stdin\n");
>  	exit(xit);
>  }
> @@ -2887,6 +2891,7 @@ main(int argc, char **argv)
>  	int interactive = 0;
>  	int has_fileargs = 0;
>  	int option_index = 0;
> +	int progress = 0;
>  	int settz = 1;
>  	int autocommit = 1;	/* autocommit mode default on */
>  	struct stat statb;
> @@ -2912,6 +2917,7 @@ main(int argc, char **argv)
>  		{"pager", 1, 0, '|'},
>  #endif
>  		{"port", 1, 0, 'p'},
> +		{"progress", 0, 0, 'P'},
>  		{"rows", 1, 0, 'r'},
>  		{"statement", 1, 0, 's'},
>  #if 0
> @@ -2970,7 +2976,7 @@ main(int argc, char **argv)
>  #if 0
>  				"t"
>  #endif
> -				"w:r:p:s:Xu:vzH?",
> +				"w:r:p:s:Xu:vzHP?",
>  				long_options, &option_index)) != -1) {
>  		switch (c) {
>  		case 0:
> @@ -3114,6 +3120,9 @@ main(int argc, char **argv)
>  		case 'z':
>  			settz = 0;
>  			break;
> +		case 'P':
> +			progress = 1;
> +			break;
>  		case '?':
>  			/* a bit of a hack: look at the option that the
>  			 * current `c' is based on and see if we recognize
> @@ -3226,6 +3235,16 @@ main(int argc, char **argv)
>  		}
>  	}
>  
> +	// switch on progress bars
> +	if (mode == SQL && progress) {
> +		char* buf = malloc(100);
> +		int port = profiler_start();
> +		sprintf(buf, "CALL profiler_openstream('127.0.0.1', %d)", port);
> +		mapi_query(mid, buf);
> +		sprintf(buf, "CALL profiler_stethoscope(0)");
> +		mapi_query(mid, buf);
> +	}
> +
>  	/* give the user a welcome message with some general info */
>  	if (!has_fileargs && command == NULL && isatty(fileno(stdin))) {
>  		char *lang;
> @@ -3296,6 +3315,7 @@ main(int argc, char **argv)
>  		/* execute from command-line, need interactive to know whether
>  		 * to keep the mapi handle open */
>  		timerStart();
> +		profiler_arm();
>  		c = doRequest(mid, command);
>  		timerEnd();
>  	}
> diff --git a/clients/mapiclient/profiler-dummy.c
> b/clients/mapiclient/profiler-dummy.c
> new file mode 100644
> --- /dev/null
> +++ b/clients/mapiclient/profiler-dummy.c
> @@ -0,0 +1,5 @@
> +/*
> +This refers to ../R/MonetDB.R/src/profiler.c . We cannot have this file
> here,
> +as the R connector needs to be able to compile stand-alone.
> +*/
> +#include "profiler.c"
> \ No newline at end of file
> _______________________________________________
> checkin-list mailing list
> checkin-list at monetdb.org
> https://www.monetdb.org/mailman/listinfo/checkin-list
> 

-- 
| Stefan.Manegold at CWI.nl | DB Architectures   (DA) |
| www.CWI.nl/~manegold/  | Science Park 123 (L321) |
| +31 (0)20 592-4212     | 1098 XG Amsterdam  (NL) |



More information about the developers-list mailing list