From 3823d5e198425b4f5e5a80267d195769d1063773 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Tue, 28 Oct 2014 13:38:10 +0000 Subject: [PATCH] Make some infiniband example utilities easily buildable: - Add new Makefiles. - Add more include directories when building. - Fixed a printf() formatting string. MFC after: 3 days Sponsored by: Mellanox Technologies --- .../ofed/librdmacm/examples/build/Makefile | 3 +++ .../librdmacm/examples/build/Makefile.inc | 9 ++++++++ .../librdmacm/examples/build/cmatose/Makefile | 10 +++++++++ .../librdmacm/examples/build/mckey/Makefile | 10 +++++++++ .../librdmacm/examples/build/rping/Makefile | 10 +++++++++ .../librdmacm/examples/build/udaddy/Makefile | 10 +++++++++ contrib/ofed/librdmacm/examples/rping.c | 5 +++-- contrib/ofed/usr.lib/Makefile.inc | 21 ++++++++++++------- 8 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 contrib/ofed/librdmacm/examples/build/Makefile create mode 100644 contrib/ofed/librdmacm/examples/build/Makefile.inc create mode 100644 contrib/ofed/librdmacm/examples/build/cmatose/Makefile create mode 100644 contrib/ofed/librdmacm/examples/build/mckey/Makefile create mode 100644 contrib/ofed/librdmacm/examples/build/rping/Makefile create mode 100644 contrib/ofed/librdmacm/examples/build/udaddy/Makefile diff --git a/contrib/ofed/librdmacm/examples/build/Makefile b/contrib/ofed/librdmacm/examples/build/Makefile new file mode 100644 index 000000000000..c949c053c94e --- /dev/null +++ b/contrib/ofed/librdmacm/examples/build/Makefile @@ -0,0 +1,3 @@ +SUBDIR= cmatose mckey rping udaddy + +.include diff --git a/contrib/ofed/librdmacm/examples/build/Makefile.inc b/contrib/ofed/librdmacm/examples/build/Makefile.inc new file mode 100644 index 000000000000..6eacbadd91ec --- /dev/null +++ b/contrib/ofed/librdmacm/examples/build/Makefile.inc @@ -0,0 +1,9 @@ +IBDIR=../../../.. + +CFLAGS+= \ + -I${IBDIR}/include/infiniband \ + -I${IBDIR}/include \ + -I${IBDIR}/librdmacm/include \ + -I${IBDIR}/libibv/include \ + -I${IBDIR}/libibverbs/include + diff --git a/contrib/ofed/librdmacm/examples/build/cmatose/Makefile b/contrib/ofed/librdmacm/examples/build/cmatose/Makefile new file mode 100644 index 000000000000..c4515ac33ebc --- /dev/null +++ b/contrib/ofed/librdmacm/examples/build/cmatose/Makefile @@ -0,0 +1,10 @@ +# +# $FreeBSD$ +# +.PATH: ${.CURDIR}/../.. +PROG= cmatose +MAN= +SRCS= cmatose.c +LDADD+= -libverbs -lrdmacm -lpthread + +.include diff --git a/contrib/ofed/librdmacm/examples/build/mckey/Makefile b/contrib/ofed/librdmacm/examples/build/mckey/Makefile new file mode 100644 index 000000000000..d4ad2954d52b --- /dev/null +++ b/contrib/ofed/librdmacm/examples/build/mckey/Makefile @@ -0,0 +1,10 @@ +# +# $FreeBSD$ +# +.PATH: ${.CURDIR}/../.. +PROG= mckey +MAN= +SRCS= mckey.c +LDADD+= -libverbs -lrdmacm -lpthread + +.include diff --git a/contrib/ofed/librdmacm/examples/build/rping/Makefile b/contrib/ofed/librdmacm/examples/build/rping/Makefile new file mode 100644 index 000000000000..05ef562400e9 --- /dev/null +++ b/contrib/ofed/librdmacm/examples/build/rping/Makefile @@ -0,0 +1,10 @@ +# +# $FreeBSD$ +# +.PATH: ${.CURDIR}/../.. +PROG= rping +MAN= +SRCS= rping.c +LDADD+= -libverbs -lrdmacm -lpthread + +.include diff --git a/contrib/ofed/librdmacm/examples/build/udaddy/Makefile b/contrib/ofed/librdmacm/examples/build/udaddy/Makefile new file mode 100644 index 000000000000..16d941974b65 --- /dev/null +++ b/contrib/ofed/librdmacm/examples/build/udaddy/Makefile @@ -0,0 +1,10 @@ +# +# $FreeBSD$ +# +.PATH: ${.CURDIR}/../.. +PROG= udaddy +MAN= +SRCS= udaddy.c +LDADD+= -libverbs -lrdmacm -lpthread + +.include diff --git a/contrib/ofed/librdmacm/examples/rping.c b/contrib/ofed/librdmacm/examples/rping.c index 985f642e5182..40e6bf43488c 100644 --- a/contrib/ofed/librdmacm/examples/rping.c +++ b/contrib/ofed/librdmacm/examples/rping.c @@ -1148,8 +1148,9 @@ int main(int argc, char *argv[]) if ((cb->size < RPING_MIN_BUFSIZE) || (cb->size > (RPING_BUFSIZE - 1))) { fprintf(stderr, "Invalid size %d " - "(valid range is %Zd to %d)\n", - cb->size, RPING_MIN_BUFSIZE, RPING_BUFSIZE); + "(valid range is %d to %d)\n", + (int)cb->size, (int)(RPING_MIN_BUFSIZE), + (int)(RPING_BUFSIZE)); ret = EINVAL; } else DEBUG_LOG("size %d\n", (int) atoi(optarg)); diff --git a/contrib/ofed/usr.lib/Makefile.inc b/contrib/ofed/usr.lib/Makefile.inc index 67ef39fa2de9..e48285dc1795 100644 --- a/contrib/ofed/usr.lib/Makefile.inc +++ b/contrib/ofed/usr.lib/Makefile.inc @@ -7,11 +7,18 @@ COMPLIBDIR= ${OPENSMDIR}/complib VENDORLIBDIR= ${OPENSMDIR}/libvendor IBVERBSDIR= ${.CURDIR}/../../libibverbs IBINC= ${.CURDIR}/../../include +RDMACMDIR= ${.CURDIR}/../../librdmacm + +CFLAGS+= -I${.CURDIR} \ + -I${IBINC}/infiniband \ + -I${IBINC} \ + -I${IBCOMMONDIR}/include/infiniband \ + -I${IBCOMMONDIR}/include \ + -I${IBMADDIR}/include/infiniband \ + -I${IBMADDIR}/include \ + -I${UMADDIR}/include/infiniband \ + -I${UMADDIR}/include \ + -I${OPENSMDIR}/include \ + -I${RDMACMDIR}/include \ + -I${IBVERBSDIR}/include -CFLAGS+= -I${.CURDIR} -I${IBINC}/infiniband -CFLAGS+= -I${IBCOMMONDIR}/include/infiniband -CFLAGS+= -I${IBMADDIR}/include/infiniband -CFLAGS+= -I${UMADDIR}/include/infiniband -CFLAGS+= -I${OPENSMDIR}/include -# CFLAGS+= -I${UMADDIR}/include -# CFLAGS+= -I${IBVERBSDIR}/include