summaryrefslogtreecommitdiffstats
path: root/src/os
diff options
context:
space:
mode:
authorJianpeng Ma <jianpeng.ma@intel.com>2017-10-19 18:44:09 +0200
committerJianpeng Ma <jianpeng.ma@intel.com>2017-10-19 18:44:09 +0200
commitb4cc9a9aa83fd9315d7b313ef39b695662b52475 (patch)
tree2402868f3620332934e8389622a5562e65e2292d /src/os
parentMerge pull request #18232 from jdurgin/wip-filestore-rocksdb (diff)
downloadceph-b4cc9a9aa83fd9315d7b313ef39b695662b52475.tar.xz
ceph-b4cc9a9aa83fd9315d7b313ef39b695662b52475.zip
cmake: Build libpmem from source code.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
Diffstat (limited to 'src/os')
-rw-r--r--src/os/CMakeLists.txt29
-rw-r--r--src/os/bluestore/BlockDevice.cc2
-rw-r--r--src/os/bluestore/PMEMDevice.cc2
3 files changed, 27 insertions, 6 deletions
diff --git a/src/os/CMakeLists.txt b/src/os/CMakeLists.txt
index ad2940449ac..1e1a1a84cb5 100644
--- a/src/os/CMakeLists.txt
+++ b/src/os/CMakeLists.txt
@@ -85,10 +85,6 @@ if(WITH_FUSE)
target_link_libraries(os ${FUSE_LIBRARIES})
endif()
-if(WITH_PMEM)
- target_link_libraries(os ${PMEM_LIBRARY})
-endif()
-
if(HAVE_LIBZFS)
target_link_libraries(os ${ZFS_LIBRARIES})
endif()
@@ -141,6 +137,31 @@ if(WITH_SPDK)
endforeach()
endif(WITH_SPDK)
+if(WITH_PMEM)
+ include(ExternalProject)
+ ExternalProject_Add(nvml_ext
+ DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/src/
+ GIT_REPOSITORY "https://github.com/ceph/nvml.git"
+ GIT_TAG "dd5b62dbc2cbbe048087dea"
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/src/nvml
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND $(MAKE)
+ BUILD_IN_SOURCE 1
+ INSTALL_COMMAND "true")
+
+ ExternalProject_Add_Step(nvml_ext forcebuild
+ DEPENDEES configure
+ DEPENDERS build
+ COMMAND "true"
+ ALWAYS 1)
+ add_library(pmem STATIC IMPORTED GLOBAL)
+ add_dependencies(pmem nvml_ext)
+ set_target_properties(pmem PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/src/nvml/src/nondebug/libpmem.a")
+ target_link_libraries(os pmem)
+ target_include_directories(os PRIVATE "${CMAKE_BINARY_DIR}/src/nvml/src/include")
+endif(WITH_PMEM)
+
if(WITH_LTTNG AND WITH_EVENTTRACE)
add_dependencies(os eventtrace_tp)
endif()
diff --git a/src/os/bluestore/BlockDevice.cc b/src/os/bluestore/BlockDevice.cc
index ca81952290e..b6f4dd8a103 100644
--- a/src/os/bluestore/BlockDevice.cc
+++ b/src/os/bluestore/BlockDevice.cc
@@ -24,7 +24,7 @@
#if defined(HAVE_PMEM)
#include "PMEMDevice.h"
-#include <libpmem.h>
+#include "libpmem.h"
#endif
#include "common/debug.h"
diff --git a/src/os/bluestore/PMEMDevice.cc b/src/os/bluestore/PMEMDevice.cc
index 41201e07ef7..11f66706a9c 100644
--- a/src/os/bluestore/PMEMDevice.cc
+++ b/src/os/bluestore/PMEMDevice.cc
@@ -18,9 +18,9 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <libpmem.h>
#include "PMEMDevice.h"
+#include "libpmem.h"
#include "include/types.h"
#include "include/compat.h"
#include "include/stringify.h"