Skip to content

Commit

Permalink
Merge pull request #593 from jdinan/pr/fix-cma
Browse files Browse the repository at this point in the history
Fix CMA build
  • Loading branch information
jdinan authored Jan 31, 2018
2 parents f585e5e + 0da8783 commit 6ac5116
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ elif test -n "$with_xpmem" -a "$with_xpmem" != "no" ; then
elif test -n "$with_cma" -a "$with_cma" != "no" ; then
transport_xpmem="no"
AC_DEFINE([USE_CMA], [1], [Define if Cross Memory Attach transport is active])
AC_DEFINE([_GNU_SOURCE], [1], [CMA transport header requires global definition of _GNU_SOURCE])
# If neither, disable XPMEM and CMA:
else
transport_xpmem="no"
Expand Down
11 changes: 5 additions & 6 deletions src/transport_cma.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
#define SHMEM_TRANSPORT_CMA_H

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#error CMA transport requires definition of _GNU_SOURCE
#endif

#ifdef HAVE_LIBC_CMA
#include <sys/uio.h>
#else
#ifndef HAVE_LIBC_CMA
#include <sys/syscall.h>
#endif

Expand Down Expand Up @@ -116,7 +115,7 @@ shmem_transport_cma_put(void *target, const void *source, size_t len,
#else
char *errstr = errmsg;
int err = strerror_r(errno, errmsg, 128);
if (err) RAISER_ERROR_MSG("Error in call to strerr_r (%d)\n", err);
if (err) RAISE_ERROR_MSG("Error in call to strerr_r (%d)\n", err);
#endif
RAISE_ERROR_MSG("process_vm_writev() failed (%s)\n", errstr);
}
Expand Down Expand Up @@ -150,8 +149,8 @@ shmem_transport_cma_get(void *target, const void *source, size_t len, int pe,
char *errstr = strerror_r(errno, errmsg, 128);
#else
char *errstr = errmsg;
err = strerror_r(errno, errmsg, 128);
if (err) RAISER_ERROR_MSG("Error in call to strerr_r (%d)\n", err);
int err = strerror_r(errno, errmsg, 128);
if (err) RAISE_ERROR_MSG("Error in call to strerr_r (%d)\n", err);
#endif
RAISE_ERROR_MSG("process_vm_readv() failed (%s)\n", errstr);
}
Expand Down
15 changes: 8 additions & 7 deletions src/transport_ofi.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
*/

#include "config.h"

#ifdef HAVE_SYS_GETTID
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sys/syscall.h>
#endif

#include <errno.h>
#include <stdlib.h>
#include <sys/time.h>
Expand All @@ -22,13 +30,6 @@
#include <inttypes.h>
#include <netdb.h>

#ifdef HAVE_SYS_GETTID
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sys/syscall.h>
#endif

#if HAVE_FNMATCH_H
#include <fnmatch.h>
#else
Expand Down

0 comments on commit 6ac5116

Please sign in to comment.