1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix several build system related issues

This commit is contained in:
Steffen Vogel 2018-02-06 21:26:12 +01:00
parent 5eb3482c61
commit e5afb8ec48
25 changed files with 85 additions and 84 deletions

View file

@ -69,7 +69,7 @@ endif
# Common flags
LDLIBS =
CFLAGS += -std=c11 -MMD -mcx16 -I$(BUILDDIR)/include -I$(SRCDIR)/include
CFLAGS += -Wall -Werror -fdiagnostics-color=auto
CFLAGS += -Wall -Werror -fdiagnostics-color=auto -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE=1
LDFLAGS += -L$(BUILDDIR)

View file

@ -14,12 +14,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
@ -56,19 +56,3 @@
/* Required kernel version */
#define KERNEL_VERSION_MAJ 3
#define KERNEL_VERSION_MIN 6
/** PCIe BAR number of VILLASfpga registers */
#define FPGA_PCI_BAR 0
#define FPGA_PCI_VID_XILINX 0x10ee
#define FPGA_PCI_PID_VFPGA 0x7022
/** AXI Bus frequency for all components
* except RTDS AXI Stream bridge which runs at RTDS_HZ (100 Mhz) */
#define FPGA_AXI_HZ 125000000 // 125 MHz
#define _POSIX_C_SOURCE 200809L
#define _GNU_SOURCE 1
#if defined(__APPLE__)
#define _DARWIN_C_SOURCE
#endif

View file

@ -31,7 +31,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include "list.h"
#include <villas/list.h>
#define IF_IRQ_MAX 3 /**< Maxmimal number of IRQs of an interface */

View file

@ -29,8 +29,8 @@
#pragma once
#include "queue_signalled.h"
#include "pool.h"
#include <villas/queue_signalled.h>
#include <villas/pool.h>
/* Forward declarations */
struct node;

View file

@ -31,9 +31,9 @@
#pragma once
#include "node.h"
#include "pool.h"
#include "queue_signalled.h"
#include <villas/node.h>
#include <villas/pool.h>
#include <villas/queue_signalled.h>
/* Forward declarations */
struct io_format;
@ -67,7 +67,7 @@ struct mqtt {
};
/** @see node_type::reverse */
char * mqtt_reverse(struct node *n);
int mqtt_reverse(struct node *n);
/** @see node_type::print */
char * mqtt_print(struct node *n);

View file

@ -39,6 +39,8 @@
#include <linux/if_packet.h>
#endif
#include <villas/config.h>
#ifdef WITH_LIBNL_ROUTE_30
#include <villas/kernel/if.h>
#include <villas/kernel/nl.h>

View file

@ -30,7 +30,8 @@
#include <signal.h>
#include <sys/types.h>
#include "log.h"
#include <villas/config.h>
#include <villas/log.h>
#ifdef __GNUC__
#define LIKELY(x) __builtin_expect((x),1)

View file

@ -26,17 +26,21 @@ LIBS = $(patsubst %, lib%, $(SONAMES))
LIB_CFLAGS += $(CFLAGS) -fPIC
ifeq ($(shell uname),Darwin)
LIB_CFLAGS += -D_DARWIN_C_SOURCE=1
endif
include $(patsubst %, lib/Makefile.%.inc, $(SONAMES))
$(BUILDDIR)/include/villas/config.h: include/villas/config.h Makefile.config | $$(dir $$@)
$(BUILDDIR)/include/villas/config.h: include/villas/config.h.in Makefile.config | $$(dir $$@)
cp $< $@
echo -e "\n\n" >> $@
echo -e "\n" >> $@
echo "#define BUILDID \"$(BUILDID)\"" >> $@
echo "#define V $(V)" >> $@
echo "#define PREFIX \"$(PREFIX)\"" >> $@
echo -e "\n\n" >> $@
echo -e "\n" >> $@
echo "/* Available Features */" >> $@
if (( $(WITH_WEB) )); then echo "#define WITH_WEB 1" >> $@; fi
@ -47,6 +51,7 @@ $(BUILDDIR)/include/villas/config.h: include/villas/config.h Makefile.config | $
for NODE in $(call escape,$(LIB_NODES)); do echo "#define WITH_NODE_$${NODE} 1" >> $@; done
for FORMAT in $(call escape,$(LIB_FORMATS)); do echo "#define WITH_FORMAT_$${FORMAT} 1" >> $@; done
for PKG in $(call escape,$(LIB_PKGS)); do echo "#define WITH_$${PKG} 1" >> $@; done
# Compile
$(BUILDDIR)/lib/%.o: lib/%.c | $$(dir $$@)

View file

@ -22,9 +22,9 @@
#include <string.h>
#include <villas/config.h>
#include <villas/config_helper.h>
#include <villas/utils.h>
#include <villas/config.h>
#ifdef WITH_CONFIG

View file

@ -24,7 +24,7 @@ LIB_FORMATS += json villas_binary villas_human csv raw
LIB_SRCS += lib/io/msg.c
# Enable Google Protobuf IO format
ifeq ($(WITH_PROTOBUF),1)
ifeq ($(WITH_FORMAT_PROTOBUF),1)
ifeq ($(shell $(PKGCONFIG) libprotobuf-c; echo $$?),0)
LIB_SRCS += lib/io/protobuf.c lib/io/villas.pb-c.c
LIB_PKGS += libprotobuf-c
@ -35,5 +35,7 @@ endif
%.pb-c.c %.pb-c.h: %.proto
protoc-c --proto_path=$(SRCDIR) --c_out=$(SRCDIR) $(realpath $^)
lib/io/protobuf.c: | lib/io/villas.pb-c.h
$(BUILDDIR)/%.pb-c.o: LIB_CFLAGS += -I$(SRCDIR)
$(BUILDDIR)/lib/io/protobuf.o: lib/io/villas.pb-c.h

View file

@ -23,9 +23,9 @@
// Generated message descriptors by protoc
#include "villas.pb-c.h"
#include "sample.h"
#include "plugin.h"
#include "io/protobuf.h"
#include "villas/sample.h"
#include "villas/plugin.h"
#include "villas/io/protobuf.h"
int protobuf_sprint(char *buf, size_t len, size_t *wbytes, struct sample *smps[], unsigned cnt, int flags)
{

View file

@ -27,15 +27,16 @@
#include <netlink/route/link.h>
#include "kernel/if.h"
#include "kernel/tc.h"
#include "kernel/tc_netem.h"
#include "kernel/nl.h"
#include "kernel/kernel.h"
#include <villas/config.h>
#include <villas/utils.h>
#include "nodes/socket.h"
#include <villas/kernel/if.h>
#include <villas/kernel/tc.h>
#include <villas/kernel/tc_netem.h>
#include <villas/kernel/nl.h>
#include <villas/kernel/kernel.h>
#include "utils.h"
#include <villas/nodes/socket.h>
int if_init(struct interface *i, struct rtnl_link *link)
{

View file

@ -27,9 +27,8 @@
#include <netlink/route/route.h>
#include <netlink/route/link.h>
#include "kernel/nl.h"
#include "utils.h"
#include <villas/utils.h>
#include <villas/kernel/nl.h>
/** Singleton for global netlink socket */
static struct nl_sock *sock = NULL;

View file

@ -27,12 +27,12 @@
#include <linux/if_ether.h>
#include "kernel/kernel.h"
#include "kernel/if.h"
#include "kernel/tc.h"
#include "kernel/nl.h"
#include <villas/utils.h>
#include "utils.h"
#include <villas/kernel/kernel.h>
#include <villas/kernel/if.h>
#include <villas/kernel/tc.h>
#include <villas/kernel/nl.h>
int tc_prio(struct interface *i, struct rtnl_qdisc **qd, tc_hdl_t handle, tc_hdl_t parent, int bands)
{

View file

@ -26,12 +26,12 @@
#include <netlink/route/qdisc/netem.h>
#include "kernel/if.h"
#include "kernel/nl.h"
#include "kernel/nl-private.h"
#include "kernel/tc_netem.h"
#include "kernel/kernel.h"
#include "utils.h"
#include <villas/kernel/if.h>
#include <villas/kernel/nl.h>
#include <villas/kernel/nl-private.h>
#include <villas/kernel/tc_netem.h>
#include <villas/kernel/kernel.h>
#include <villas/utils.h>
int tc_netem_parse(struct rtnl_qdisc **netem, json_t *cfg)

View file

@ -22,6 +22,7 @@
#include <string.h>
#include <villas/config.h>
#include <villas/sample.h>
#include <villas/node.h>
#include <villas/utils.h>
@ -87,7 +88,7 @@ int node_init2(struct node *n)
#ifdef WITH_HOOKS
/* We sort the hooks according to their priority before starting the path */
list_sort(&n->hooks, hook_cmp_priority);
#endif
#endif /* WITH_HOOKS */
return 0;
}

View file

@ -158,7 +158,8 @@ endif
ifeq ($(WITH_NODE_MQTT),1)
ifneq ($(wildcard /usr/include/mosquitto.h),)
LIB_SRCS += lib/nodes/mqtt.c
LIB_CFLAGS += -DWITH_MQTT
LIB_NODES += mqtt
LIB_LDLIBS += -lmosquitto
WITH_IO = 1
endif
endif

View file

@ -6,12 +6,12 @@
#include <sys/eventfd.h>
#include "node.h"
#include "log.h"
#include "plugin.h"
#include "utils.h"
#include <villas/node.h>
#include <villas/log.h>
#include <villas/plugin.h>
#include <villas/utils.h>
#include "nodes/cbuilder.h"
#include <villas/nodes/cbuilder.h>
int cbuilder_parse(struct node *n, json_t *cfg)
{

View file

@ -20,11 +20,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#include "node.h"
#include "plugin.h"
#include "config.h"
#include "nodes/loopback.h"
#include "memory.h"
#include <villas/node.h>
#include <villas/plugin.h>
#include <villas/config.h>
#include <villas/nodes/loopback.h>
#include <villas/memory.h>
int loopback_parse(struct node *n, json_t *cfg)
{

View file

@ -23,10 +23,10 @@
#include <string.h>
#include <mosquitto.h>
#include "nodes/mqtt.h"
#include "plugin.h"
#include "utils.h"
#include "io_format.h"
#include <villas/nodes/mqtt.h>
#include <villas/plugin.h>
#include <villas/utils.h>
#include <villas/io_format.h>
#ifdef MQTT_THREAD
#include <pthread.h>

View file

@ -25,6 +25,7 @@
#include <libgen.h>
#include <unistd.h>
#include <villas/config.h>
#include <villas/super_node.h>
#include <villas/node.h>
#include <villas/path.h>

View file

@ -23,6 +23,7 @@
#include <libwebsockets.h>
#include <string.h>
#include <villas/config.h>
#include <villas/utils.h>
#include <villas/log.h>
#include <villas/web.h>
@ -57,14 +58,14 @@ lws_callback_function websocket_protocol_cb;
.rx_buffer_size = 0
},
#endif /* WITH_API */
#ifdef WITH_WEBSOCKET
#ifdef WITH_NODE_WEBSOCKET
{
.name = "live",
.callback = websocket_protocol_cb,
.per_session_data_size = sizeof(struct websocket_connection),
.rx_buffer_size = 0
},
#endif /* WITH_WEBSOCKET */
#endif /* WITH_NODE_WEBSOCKET */
#if 0 /* not supported yet */
{
.name = "log",
@ -111,7 +112,7 @@ static struct lws_http_mount mounts[] = {
.cache_intermediaries = 0,
.origin_protocol = LWSMPRO_CALLBACK,
.mountpoint_len = 7,
#endif
#endif /* WITH_API */
.mount_next = NULL
}
};

View file

@ -23,6 +23,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <villas/config.h>
#include <villas/utils.h>
#include <villas/super_node.h>
#include <villas/memory.h>
@ -76,7 +77,7 @@ static void usage()
printf("Usage: villas-node OPAL_ASYNC_SHMEM_NAME OPAL_ASYNC_SHMEM_SIZE OPAL_PRINT_SHMEM_NAME\n");
printf(" This type of invocation is used by OPAL-RT Asynchronous processes.\n");
printf(" See in the RT-LAB User Guide for more information.\n\n");
#endif
#endif /* ENABLE_OPAL_ASYNC */
printf("Supported node-types:\n");
plugin_dump(PLUGIN_TYPE_NODE);
@ -86,7 +87,7 @@ static void usage()
printf("Supported hooks:\n");
plugin_dump(PLUGIN_TYPE_HOOK);
printf("\n");
#endif
#endif /* WITH_HOOKS */
printf("Supported API commands:\n");
plugin_dump(PLUGIN_TYPE_API);

View file

@ -30,6 +30,8 @@
#include <signal.h>
#include <pthread.h>
#include <villas/config.h>
#include <villas/config_helper.h>
#include <villas/super_node.h>
#include <villas/utils.h>
#include <villas/node.h>
@ -38,12 +40,9 @@
#include <villas/io.h>
#include <villas/kernel/rt.h>
#include <villas/plugin.h>
#include <villas/config_helper.h>
#include <villas/nodes/websocket.h>
#include <villas/config.h>
static struct super_node sn = { .state = STATE_DESTROYED }; /**< The global configuration */
static struct io io = { .state = STATE_DESTROYED };
@ -321,13 +320,13 @@ check: if (optarg == endptr)
if (!node)
error("Node '%s' does not exist!", nodestr);
#ifdef WITH_WEBSOCKET
#ifdef WITH_NODE_WEBSOCKET
/* Only start web subsystem if villas-pipe is used with a websocket node */
if (node->_vt->start == websocket_start) {
web_start(&sn.web);
api_start(&sn.api);
}
#endif
#endif /* WITH_NODE_WEBSOCKET */
if (reverse)
node_reverse(node);

View file

@ -39,8 +39,11 @@
#define NUM_VALUES 10
static char formats[][32] = {
#ifdef WITH_HDF5
#ifdef WITH_FORMAT_HDF5
"hdf5",
#endif
#ifdef WITH_FORMAT_PROTOBUF
"protobuf",
#endif
"raw-int8",
"raw-int16-be",