COMMON_FLAGS += debug=1\r
endif\r
\r
-.PHONY: all\r
all: \r
$(MAKE) -C src $(COMMON_FLAGS) all\r
\r
-.PHONY: clean\r
clean:\r
$(MAKE) -C src clean\r
-rm -f netdata netdata.old plugins.d/apps.plugin plugins.d/apps.plugin.old\r
\r
-.PHONY: install\r
install:\r
$(MAKE) -C src $(COMMON_FLAGS) install\r
\r
-.PHONY: getconf\r
getconf:\r
@wget -O conf.d/netdata.conf.new "http://localhost:19999/netdata.conf"; \\r
if [ $$? -eq 0 -a -s conf.d/netdata.conf.new ]; \\r
mv conf.d/netdata.conf conf.d/netdata.conf.old; \\r
mv conf.d/netdata.conf.new conf.d/netdata.conf; \\r
fi\r
+\r
+.PHONY: all clean install getconf\r
PLUGINS_DIR = "plugins.d"
endif
+ifndef nomath
+STORAGE_WITH_MATH = 1
+endif
+
COMMON_FLAGS = BIN_DIR='$(BIN_DIR)' CONFIG_DIR='$(CONFIG_DIR)' LOG_DIR='$(LOG_DIR)' PLUGINS_DIR='$(PLUGINS_DIR)'
ifdef debug
libs = -pthread -lz
ifdef STORAGE_WITH_MATH
+CFLAGS += -DSTORAGE_WITH_MATH=1
libs += -lm
endif
headers = $(patsubst %.c,%.h,$(sources))
objects = $(patsubst %.c,%.o,$(sources) $(proc_sources))
-.PHONY: options
-options:
- @echo " COMPILING WITH OPTIONS: $(CFLAGS)"
+all: show_options netdata plugins
-all: options netdata plugins
+%.o: %.c ${headers}
+ @echo " $(CC) $<"
+ @$(CC) $(CFLAGS) -c $< -o $@
netdata: $(objects)
@echo " $(CC) netdata"
@$(CC) -o netdata $(objects) $(libs)
-.PHONY: plugins
+show_options:
+ @echo " COMPILING WITH OPTIONS: $(CFLAGS)"
+
plugins:
$(MAKE) -C plugins.d $(COMMON_FLAGS) all
-%.o: %.c ${headers}
- @echo " $(CC) $<"
- @$(CC) $(CFLAGS) -c $< -o $@
-
-.PHONY: clean
clean:
$(MAKE) -C plugins.d clean
rm -f *.o netdata core
fi; \
cp -f netdata $(BIN_DIR)/; \
echo
+
+.PHONY: all show_options plugins clean install
#include "log.h"
#include "web_buffer.h"
-#define ACCURACY_LOSS 100.0000001
+#define ACCURACY_LOSS 0.0000001
int check_storage_number(calculated_number n, int debug) {
char buffer[100];
fprintf(stderr,
CALCULATED_NUMBER_FORMAT " original\n"
CALCULATED_NUMBER_FORMAT " packed and unpacked, (stored as 0x%08X, diff " CALCULATED_NUMBER_FORMAT ", " CALCULATED_NUMBER_FORMAT "%%)\n"
- "%s printed after unpacked (%lu bytes)\n"
+ "%s printed after unpacked (%zu bytes)\n"
CALCULATED_NUMBER_FORMAT " re-parsed from printed (diff " CALCULATED_NUMBER_FORMAT ", " CALCULATED_NUMBER_FORMAT "%%)\n\n",
n,
d, s, ddiff, dcdiff,
buffer,
len, p, pdiff, pcdiff
);
- if(len != strlen(buffer)) fprintf(stderr, "ERROR: printed number %s is reported to have length %lu but it has %lu\n", buffer, len, strlen(buffer));
+ if(len != strlen(buffer)) fprintf(stderr, "ERROR: printed number %s is reported to have length %zu but it has %zu\n", buffer, len, strlen(buffer));
if(dcdiff > ACCURACY_LOSS) fprintf(stderr, "WARNING: packing number " CALCULATED_NUMBER_FORMAT " has accuracy loss %0.7Lf %%\n", n, dcdiff);
if(pcdiff > ACCURACY_LOSS) fprintf(stderr, "WARNING: re-parsing the packed, unpacked and printed number " CALCULATED_NUMBER_FORMAT " has accuracy loss %0.7Lf %%\n", n, pcdiff);
}
// ------------------------------------------------------------------------
- fprintf(stderr, "SYSTEM LONG DOUBLE SIZE: %lu bytes\n", sizeof(calculated_number));
- fprintf(stderr, "NETDATA FLOATING POINT SIZE: %lu bytes\n", sizeof(storage_number));
+ fprintf(stderr, "SYSTEM LONG DOUBLE SIZE: %zu bytes\n", sizeof(calculated_number));
+ fprintf(stderr, "NETDATA FLOATING POINT SIZE: %zu bytes\n", sizeof(storage_number));
mine = (calculated_number)sizeof(storage_number) * (calculated_number)loop;
their = (calculated_number)sizeof(calculated_number) * (calculated_number)loop;