kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [3/4] incubator-kudu git commit: nvml: update to 1.0, add pmem, pmemobj libraries
Date Wed, 11 May 2016 07:28:34 GMT
nvml: update to 1.0, add pmem, pmemobj libraries

Change-Id: I936be31f9df04ab8ac1a1a21d8804bc99ae50bb7
Reviewed-on: http://gerrit.cloudera.org:8080/2956
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <todd@apache.org>
Reviewed-by: Adar Dembo <adar@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/07d35077
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/07d35077
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/07d35077

Branch: refs/heads/master
Commit: 07d35077c0d37ff304a194f9242d7036f7afd209
Parents: f6691e7
Author: Todd Lipcon <todd@apache.org>
Authored: Wed May 4 14:07:18 2016 -0700
Committer: Todd Lipcon <todd@apache.org>
Committed: Wed May 11 07:15:42 2016 +0000

----------------------------------------------------------------------
 CMakeLists.txt                  | 19 +++++---
 cmake_modules/FindPmem.cmake    | 93 ++++++++++++++++++++++++++++++++++++
 cmake_modules/FindVmem.cmake    | 38 ---------------
 thirdparty/build-definitions.sh | 17 +++----
 thirdparty/vars.sh              |  2 +-
 5 files changed, 116 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/07d35077/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b23c1d1..f89b169 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -809,13 +809,20 @@ if (NOT "${KUDU_USE_ASAN}" AND
   set(KUDU_TCMALLOC_AVAILABLE 1)
 endif()
 
-# libvmem
+# Required pmem libraries
 if (NOT APPLE)
-  find_package(Vmem REQUIRED)
-  include_directories(SYSTEM ${VMEM_INCLUDE_DIR})
-  ADD_THIRDPARTY_LIB(vmem
-    STATIC_LIB "${VMEM_STATIC_LIB}"
-    SHARED_LIB "${VMEM_SHARED_LIB}")
+find_package(Pmem REQUIRED)
+include_directories(${PMEM_INCLUDE_DIR})
+ADD_THIRDPARTY_LIB(vmem
+  STATIC_LIB "${VMEM_STATIC_LIB}"
+  SHARED_LIB "${VMEM_SHARED_LIB}")
+ADD_THIRDPARTY_LIB(pmem
+  STATIC_LIB "${PMEM_STATIC_LIB}"
+  SHARED_LIB "${PMEM_SHARED_LIB}")
+ADD_THIRDPARTY_LIB(pmemobj
+  STATIC_LIB "${PMEMOBJ_STATIC_LIB}"
+  SHARED_LIB "${PMEMOBJ_SHARED_LIB}"
+  DEPS ${PMEMOBJ_DEPS})
 endif()
 
 ## curl

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/07d35077/cmake_modules/FindPmem.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindPmem.cmake b/cmake_modules/FindPmem.cmake
new file mode 100644
index 0000000..84522c5
--- /dev/null
+++ b/cmake_modules/FindPmem.cmake
@@ -0,0 +1,93 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# - Find Required PMEM libraries (libvmem, libpmem, libpmemobj)
+# This module defines
+#  PMEM_INCLUDE_DIR, directory containing headers
+#  XXX_STATIC_LIBS, path to *.a
+#  XXX_SHARED_LIBS, path to *.so shared library
+#  PMEM_FOUND, whether PMEM libraries have been found
+#  PMEMOBJ_DEPS, dependencies required for using libpmemobj
+
+set(PMEM_SEARCH_LIB_PATH
+  ${THIRDPARTY_PREFIX}/lib
+)
+set(PMEM_SEARCH_HEADER_PATHS
+  ${THIRDPARTY_PREFIX}/include
+)
+
+find_path(VMEM_INCLUDE_DIR libvmem.h PATHS ${PMEM_SEARCH_HEADER_PATHS}
+  # make sure we don't accidentally pick up a different version
+  NO_DEFAULT_PATH
+  )
+find_path(PMEM_INCLUDE_DIR libpmem.h PATHS ${PMEM_SEARCH_HEADER_PATHS}
+  # make sure we don't accidentally pick up a different version
+  NO_DEFAULT_PATH
+  )
+find_path(PMEMOBJ_INCLUDE_DIR libpmemobj.h PATHS ${PMEM_SEARCH_HEADER_PATHS}
+  # make sure we don't accidentally pick up a different version
+  NO_DEFAULT_PATH
+  )
+
+if (VMEM_INCLUDE_DIR AND PMEM_INCLUDE_DIR AND PMEMOBJ_INCLUDE_DIR)
+  find_library(VMEM_LIB_PATH NAMES vmem PATHS ${PMEM_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
+  find_library(PMEM_LIB_PATH NAMES pmem PATHS ${PMEM_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
+  find_library(PMEMOBJ_LIB_PATH NAMES pmemobj PATHS ${PMEM_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
+endif()
+
+if (VMEM_LIB_PATH AND PMEM_LIB_PATH AND PMEMOBJ_LIB_PATH)
+  MESSAGE("FOUND ALL PMEM LIB PATHS")
+  set(PMEM_FOUND TRUE)
+  set(VMEM_LIB_NAME libvmem)
+  set(VMEM_STATIC_LIB ${PMEM_SEARCH_LIB_PATH}/${VMEM_LIB_NAME}.a)
+  set(VMEM_SHARED_LIB ${PMEM_SEARCH_LIB_PATH}/${VMEM_LIB_NAME}.so)
+  set(PMEM_LIB_NAME libpmem)
+  set(PMEM_STATIC_LIB ${PMEM_SEARCH_LIB_PATH}/${PMEM_LIB_NAME}.a)
+  set(PMEM_SHARED_LIB ${PMEM_SEARCH_LIB_PATH}/${PMEM_LIB_NAME}.so)
+  set(PMEMOBJ_LIB_NAME libpmemobj)
+  set(PMEMOBJ_STATIC_LIB ${PMEM_SEARCH_LIB_PATH}/${PMEMOBJ_LIB_NAME}.a)
+  set(PMEMOBJ_SHARED_LIB ${PMEM_SEARCH_LIB_PATH}/${PMEMOBJ_LIB_NAME}.so)
+  set(PMEMOBJ_DEPS pmem)
+endif()
+
+if(PMEM_FOUND)
+if (NOT PMEM_FIND_QUIETLY)
+    message(STATUS "Found the pmem libraries: ${PMEM_SEARCH_LIB_PATH}")
+  endif ()
+else ()
+  if (NOT PMEM_FIND_QUIETLY)
+    set(PMEM_ERR_MSG "Could not find the pmem libraries. Looked for headers")
+    set(PMEM_ERR_MSG "${PMEM_ERR_MSG} in ${PMEM_SEARCH_HEADER_PATHS}, and for libs")
+    set(PMEM_ERR_MSG "${PMEM_ERR_MSG} in ${PMEM_SEARCH_LIB_PATH}")
+    if (Pmem_FIND_REQUIRED)
+      message(FATAL_ERROR "${PMEM_ERR_MSG}")
+    else (Pmem_FIND_REQUIRED)
+      message(STATUS "${PMEM_ERR_MSG}")
+    endif (Pmem_FIND_REQUIRED)
+  endif ()
+endif ()
+
+mark_as_advanced(
+  VMEM_STATIC_LIB
+  VMEM_SHARED_LIB
+  PMEM_INCLUDE_DIR
+  PMEM_STATIC_LIB
+  PMEM_SHARED_LIB
+  PMEMOBJ_DEPS
+  PMEMOBJ_STATIC_LIB
+  PMEMOBJ_SHARED_LIB
+)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/07d35077/cmake_modules/FindVmem.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindVmem.cmake b/cmake_modules/FindVmem.cmake
deleted file mode 100644
index 6c2e0de..0000000
--- a/cmake_modules/FindVmem.cmake
+++ /dev/null
@@ -1,38 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# - Find VMEM (libvmem.h, libvmem.so)
-# This module defines
-#  VMEM_INCLUDE_DIR, directory containing headers
-#  VMEM_SHARED_LIB, path to vmem's shared library
-#  VMEM_STATIC_LIB, path to vmem's static library
-#  VMEM_FOUND, whether libvmem has been found
-
-find_path(VMEM_INCLUDE_DIR libvmem.h
-  # make sure we don't accidentally pick up a different version
-  NO_CMAKE_SYSTEM_PATH
-  NO_SYSTEM_ENVIRONMENT_PATH)
-find_library(VMEM_SHARED_LIB vmem
-  NO_CMAKE_SYSTEM_PATH
-  NO_SYSTEM_ENVIRONMENT_PATH)
-find_library(VMEM_STATIC_LIB libvmem.a
-  NO_CMAKE_SYSTEM_PATH
-  NO_SYSTEM_ENVIRONMENT_PATH)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(VMEM REQUIRED_VARS
-  VMEM_SHARED_LIB VMEM_STATIC_LIB VMEM_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/07d35077/thirdparty/build-definitions.sh
----------------------------------------------------------------------
diff --git a/thirdparty/build-definitions.sh b/thirdparty/build-definitions.sh
index 4840df7..ae92700 100644
--- a/thirdparty/build-definitions.sh
+++ b/thirdparty/build-definitions.sh
@@ -319,12 +319,13 @@ build_nvml() {
   if ! grep -q -e "$EXTRA_CFLAGS" jemalloc/jemalloc.cfg ; then
     perl -p -i -e "s,(EXTRA_CFLAGS=\"),\$1$EXTRA_CFLAGS ," jemalloc/jemalloc.cfg
   fi
-
-  EXTRA_CFLAGS="$EXTRA_CFLAGS" make -j$PARALLEL libvmem DEBUG=0
-  # NVML doesn't allow configuring PREFIX -- it always installs into
-  # DESTDIR/usr/lib. Additionally, the 'install' target builds all of
-  # the NVML libraries, even though we only need libvmem.
-  # So, we manually install the built artifacts.
-  cp -a $NVML_DIR/src/include/libvmem.h $PREFIX/include
-  cp -a $NVML_DIR/src/nondebug/libvmem.{so*,a} $PREFIX/lib
+  for LIB in libvmem libpmem libpmemobj; do
+    EXTRA_CFLAGS="$EXTRA_CFLAGS" make -j$PARALLEL $LIB DEBUG=0
+    # NVML doesn't allow configuring PREFIX -- it always installs into
+    # DESTDIR/usr/lib. Additionally, the 'install' target builds all of
+    # the NVML libraries, even though we only need the three libraries above.
+    # So, we manually install the built artifacts.
+    cp -a $NVML_DIR/src/include/$LIB.h $PREFIX/include
+    cp -a $NVML_DIR/src/nondebug/$LIB.{so*,a} $PREFIX/lib
+  done
 }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/07d35077/thirdparty/vars.sh
----------------------------------------------------------------------
diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh
index b682928..a88638c 100644
--- a/thirdparty/vars.sh
+++ b/thirdparty/vars.sh
@@ -139,5 +139,5 @@ GCC_BUILD_DIR=${GCC_DIR}.build
 TRACE_VIEWER_VERSION=45f6525d8aa498be53e4137fb73a9e9e036ce91d
 TRACE_VIEWER_DIR=$TP_DIR/kudu-trace-viewer-${TRACE_VIEWER_VERSION}
 
-NVML_VERSION=0.4-b2
+NVML_VERSION=1.0-b1
 NVML_DIR=$TP_DIR/nvml-$NVML_VERSION


Mime
View raw message