Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C28C82004CA for ; Wed, 11 May 2016 09:28:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C0B731602BE; Wed, 11 May 2016 07:28:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E2966160A17 for ; Wed, 11 May 2016 09:28:37 +0200 (CEST) Received: (qmail 74424 invoked by uid 500); 11 May 2016 07:28:37 -0000 Mailing-List: contact commits-help@kudu.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kudu.incubator.apache.org Delivered-To: mailing list commits@kudu.incubator.apache.org Received: (qmail 74366 invoked by uid 99); 11 May 2016 07:28:37 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2016 07:28:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id B37F9180592 for ; Wed, 11 May 2016 07:28:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.221 X-Spam-Level: X-Spam-Status: No, score=-3.221 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id CnOiGOiL8_pB for ; Wed, 11 May 2016 07:28:34 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with SMTP id BE2FD5FBC5 for ; Wed, 11 May 2016 07:28:33 +0000 (UTC) Received: (qmail 74056 invoked by uid 99); 11 May 2016 07:28:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2016 07:28:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 04600DFFB9; Wed, 11 May 2016 07:28:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: todd@apache.org To: commits@kudu.incubator.apache.org Date: Wed, 11 May 2016 07:28:34 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/4] incubator-kudu git commit: nvml: update to 1.0, add pmem, pmemobj libraries archived-at: Wed, 11 May 2016 07:28:38 -0000 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 Reviewed-by: Adar Dembo 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 Authored: Wed May 4 14:07:18 2016 -0700 Committer: Todd Lipcon 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