Commit 443d60d8 authored by Matthieu Dorier's avatar Matthieu Dorier

Merge branch 'master' of xgitlab.cels.anl.gov:sds/mobject-store

parents 86f93b37 bfdf7bdb
......@@ -10,9 +10,11 @@ AM_CFLAGS =
AM_CXXFLAGS = $(AM_CFLAGS)
lib_LTLIBRARIES = src/libmobject-store.la
lib_LTLIBRARIES += src/libmobject-store-server.la
include_HEADERS = include/libmobject-store.h \
include/librados-mobject-store.h
include/librados-mobject-store.h \
include/mobject-server.h
# setting this to empty so subdir makefiles can use +=
noinst_HEADERS =
......
......@@ -20,6 +20,12 @@ PKG_PROG_PKG_CONFIG
if test "x$PKG_CONFIG" == "x"; then
AC_MSG_ERROR([Could not find pkg-config utility!])
fi
dnl seems like this should be a function but my first stab at m4 exploded
dnl mightily...
dnl also, we need to separate client libraries from server libraries. Just jam
dnl it all into one set of flags for now
PKG_CHECK_MODULES([MARGO],[margo],[],
AC_MSG_ERROR([Could not find working margo installation!]) )
LIBS="$MARGO_LIBS $LIBS"
......@@ -38,6 +44,32 @@ LIBS="$ARGOBOTS_LIBS $LIBS"
CPPFLAGS="$ARGOBOTS_CFLAGS $CPPFLAGS"
CFLAGS="$ARGOBOTS_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([SDSKEYVAL],[kv-server],[],
AC_MSG_ERROR([Could not find working sds-keyval server installation!]) )
LIBS="$SDSKEYVAL_LIBS $LIBS"
CPPFLAGS="$SDSKEYVAL_CFLAGS $CPPFLAGS"
CFLAGS="$SDSKEYVAL_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([PMEM],[libpmemobj],[],
AC_MSG_ERROR([Could not find working libpmemobj installation!]) )
LIBS="$PMEM_LIBS $LIBS"
CPPFLAGS="$PMEM_CFLAGS $CPPFLAGS"
CFLAGS="$PMEM_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([PMEM],[libpmemobj],[],
AC_MSG_ERROR([Could not find working libpmemobj installation!]) )
LIBS="$PMEM_LIBS $LIBS"
CPPFLAGS="$PMEM_CFLAGS $CPPFLAGS"
CFLAGS="$PMEM_CFLAGS $CFLAGS"
PKG_CHECK_MODULES([BAKE],[bake-bulk-server],[],
AC_MSG_ERROR([Could not find working BAKE installation!]) )
LIBS="$BAKE_LIBS $LIBS"
CPPFLAGS="$BAKE_CFLAGS $CPPFLAGS"
CFLAGS="$BAKE_CFLAGS $CFLAGS"
# check for RADOS
AC_ARG_WITH([rados],
AS_HELP_STRING([--with_rados], [Additionally build tests against librados (default is no)]),
......
/*
* (C) 2017 The University of Chicago
*
* See COPYRIGHT in top-level directory.
*/
#ifndef MOBJECT_SERVER_H
#define MOBJECT_SERVER_H
/* server-side utilities and routines. Clients are looking for either
* libmobject-store.h or librados-mobject-store.h */
/**
* Start a mobject server instance
*
* @param[in] addr_str
* @param[in poolname
* @returns 0 on success, negative error code on failure */
int mobject_server_register(const char *addr_str, const char *poolname);
#endif
......@@ -23,5 +23,9 @@ noinst_HEADERS += \
src/prepare-write-op.h \
src/prepare-read-op.h \
src/write-op-visitor.h \
src/read-op-visitor.h \
src/buffer-union.h
src/buffer-union.h \
src/args-write-actions.h \
src/args-read-actions.h
src_libmobject_store_server_la_SOURCES = \
src/mobject-server.c
#include <sds-keyval.h>
#include <bake-bulk.h>
#include <bake-bulk-server.h>
#include <margo.h>
#include <libpmemobj.h>
#include <mobject-server.h>
int mobject_server_register(const char *addr_str, const char *poolname)
{
int ret=0;
margo_instance_id mid;
kv_context *metadata;
struct bake_pool_info *pool_info;
pool_info = bake_server_makepool(poolname);
mid = margo_init(addr_str, MARGO_SERVER_MODE, 0, -1);
bake_server_register(mid, pool_info);
metadata = kv_server_register(mid);
return ret;
}
int mobject_shutdown()
{
margo_wait_for_finalize(NULL);
pmemobj_close(NULL);
}
check_PROGRAMS += \
tests/mobject-connect-test
tests/mobject-connect-test \
tests/mobject-server
if HAVE_RADOS
check_PROGRAMS += \
......@@ -11,10 +12,13 @@ endif
tests_mobject_connect_test_SOURCES = tests/mobject-connect-test.c
tests_mobject_connect_test_CPPFLAGS = -I${srcdir}/include
tests_mobject_connect_test_LDADD = src/libmobject-store.la
tests_mobject_connect_test_LDADD = src/libmobject-store.la ${LIBS}
tests_mobject_server_CPPFLAGS = -I${srcdir}/include
tests_mobject_server_LDADD = src/libmobject-store-server.la ${LIBS}
if HAVE_RADOS
tests_rados_mobject_connect_test_SOURCES = tests/mobject-connect-test.c
tests_rados_mobject_connect_test_CFLAGS = -DUSE_RADOS
tests_rados_mobject_connect_test_LDADD = -lrados
tests_rados_mobject_connect_test_LDADD = -lrados ${LIBS}
endif
#include <margo.h>
#include <mobject-server.h>
/* the SDS-keyval and bake-bulk tests should still work, even if there is a higher-level protocol */
int main(int argc, char **argv)
{
mobject_server_register(argc, argv);
margo_wait_for_finalize();
margo_server_deregister();
margo_instance_id mid;
mid = margo_init(argv[1], MARGO_SERVER_MODE, 0, -1);
mobject_server_register(argv[2], argv[3]);
margo_wait_for_finalize(mid);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment