Skip to content
Permalink
Browse files

cmake: add checks for lustreapi functions

  • Loading branch information...
adammoody committed Mar 13, 2019
1 parent e33f7bd commit 8bbd8d275aab4e82f1ad5d755689547ae4f1e87a
Showing with 26 additions and 5 deletions.
  1. +25 −4 CMakeLists.txt
  2. +1 −1 src/common/mfu_bz2.c
@@ -17,12 +17,33 @@ ENDIF(ENABLE_XATTRS)

OPTION(ENABLE_LUSTRE "Enable optimization and features for Lustre" OFF)
IF(ENABLE_LUSTRE)
# ADD_DEFINITIONS(-DLUSTRE_SUPPORT)
# ADD_DEFINITIONS(-DHAVE_LLAPI_FILE_CREATE)
ADD_DEFINITIONS(-DLUSTRE_SUPPORT)

FIND_LIBRARY(LUSTREAPI lustreapi)
IF(LUSTREAPI)
# INCLUDE_DIRECTORIES(${LUSTREAPI_INCLUDE_DIRS})
LIST(APPEND MFU_EXTERNAL_LIBS ${LUSTREAPI})
ENDIF(LUSTREAPI)

INCLUDE(CheckLibraryExists)

CHECK_LIBRARY_EXISTS(lustreapi llapi_layout_alloc ${LUSTREAPI} HAVE_LLAPI_LAYOUT)
IF(HAVE_LLAPI_LAYOUT)
ADD_DEFINITIONS(-DHAVE_LLAPI_LAYOUT)
ENDIF(HAVE_LLAPI_LAYOUT)

CHECK_LIBRARY_EXISTS(lustreapi llapi_file_create ${LUSTREAPI} HAVE_LLAPI_FILE_CREATE)
IF(HAVE_LLAPI_FILE_CREATE)
ADD_DEFINITIONS(-DHAVE_LLAPI_FILE_CREATE)
ENDIF(HAVE_LLAPI_FILE_CREATE)

CHECK_LIBRARY_EXISTS(lustreapi llapi_file_get_stripe ${LUSTREAPI} HAVE_LLAPI_FILE_GET_STRIPE)
IF(HAVE_LLAPI_FILE_GET_STRIPE)
ADD_DEFINITIONS(-DHAVE_LLAPI_FILE_GET_STRIPE)
ENDIF(HAVE_LLAPI_FILE_GET_STRIPE)

# todo investigate usage of other lustre #defs
# - LUSTRE_STAT
# - HAVE_LUSTRE_LUSTREAPI_H
# - HAVE_LUSTRE_LUSTRE_USER_H
ENDIF(ENABLE_LUSTRE)

OPTION(ENABLE_GPFS "Enable GFPS/Spectrum Scale support")
@@ -43,7 +43,7 @@ int mfu_create_fully_striped(const char* name, mode_t mode)
MPI_Barrier(MPI_COMM_WORLD);

/* open the file */
int fd = mfu_open(dst, O_WRONLY);
int fd = mfu_open(name, O_WRONLY);
if (fd < 0) {
MFU_LOG(MFU_LOG_ERR, "Failed to open file for writing: %s errno=%d (%s)",
name, errno, strerror(errno));

0 comments on commit 8bbd8d2

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.