Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E95D0187F1 for ; Mon, 6 Jul 2015 20:57:28 +0000 (UTC) Received: (qmail 53139 invoked by uid 500); 6 Jul 2015 20:57:24 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 52547 invoked by uid 500); 6 Jul 2015 20:57:24 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 52054 invoked by uid 99); 6 Jul 2015 20:57:24 -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; Mon, 06 Jul 2015 20:57:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0B75CE0522; Mon, 6 Jul 2015 20:57:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: zjshen@apache.org To: common-commits@hadoop.apache.org Date: Mon, 06 Jul 2015 20:57:27 -0000 Message-Id: <464908c86e0645da9fc18a14f9fb97c3@git.apache.org> In-Reply-To: <6162da200e644fdeabf9f916da3b92b4@git.apache.org> References: <6162da200e644fdeabf9f916da3b92b4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [05/48] hadoop git commit: HADOOP-12104. Migrate Hadoop Pipes native build to new CMake framework (Alan Burlison via Colin P. McCabe) HADOOP-12104. Migrate Hadoop Pipes native build to new CMake framework (Alan Burlison via Colin P. McCabe) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/96d07d2d Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/96d07d2d Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/96d07d2d Branch: refs/heads/YARN-2928 Commit: 96d07d2dbae3f1a30cc178ee237402369d034350 Parents: e9d1005 Author: Colin Patrick Mccabe Authored: Mon Jun 29 12:01:17 2015 -0700 Committer: Zhijie Shen Committed: Mon Jul 6 11:30:01 2015 -0700 ---------------------------------------------------------------------- hadoop-common-project/hadoop-common/CHANGES.txt | 3 ++ hadoop-tools/hadoop-pipes/src/CMakeLists.txt | 49 +++++++++----------- 2 files changed, 24 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/96d07d2d/hadoop-common-project/hadoop-common/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 0a964a3..e8e85a0 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -685,6 +685,9 @@ Release 2.8.0 - UNRELEASED HADOOP-11885. hadoop-dist dist-layout-stitching.sh does not work with dash. (wang) + HADOOP-12104. Migrate Hadoop Pipes native build to new CMake framework + (alanburlison via cmccabe) + HADOOP-12036. Consolidate all of the cmake extensions in one directory (alanburlison via cmccabe) http://git-wip-us.apache.org/repos/asf/hadoop/blob/96d07d2d/hadoop-tools/hadoop-pipes/src/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/hadoop-tools/hadoop-pipes/src/CMakeLists.txt b/hadoop-tools/hadoop-pipes/src/CMakeLists.txt index 170af49..3b0b28c 100644 --- a/hadoop-tools/hadoop-pipes/src/CMakeLists.txt +++ b/hadoop-tools/hadoop-pipes/src/CMakeLists.txt @@ -6,7 +6,7 @@ # 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 @@ -17,25 +17,11 @@ # cmake_minimum_required(VERSION 2.6 FATAL_ERROR) -find_package(OpenSSL REQUIRED) - -set(CMAKE_BUILD_TYPE, Release) -set(PIPES_FLAGS "-g -Wall -O2 -D_REENTRANT -D_GNU_SOURCE") -set(PIPES_FLAGS "${PIPES_FLAGS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PIPES_FLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PIPES_FLAGS}") +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../../../hadoop-common-project/hadoop-common) +include(HadoopCommon) -include(../../../hadoop-common-project/hadoop-common/src/JNIFlags.cmake NO_POLICY_SCOPE) - -function(output_directory TGT DIR) - SET_TARGET_PROPERTIES(${TGT} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIR}") - SET_TARGET_PROPERTIES(${TGT} PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIR}") - SET_TARGET_PROPERTIES(${TGT} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIR}") -endfunction(output_directory TGT DIR) +find_package(OpenSSL REQUIRED) include_directories( main/native/utils/api @@ -47,19 +33,19 @@ include_directories( # Example programs add_executable(wordcount-simple main/native/examples/impl/wordcount-simple.cc) target_link_libraries(wordcount-simple hadooppipes hadooputils) -output_directory(wordcount-simple examples) +hadoop_output_directory(wordcount-simple examples) add_executable(wordcount-part main/native/examples/impl/wordcount-part.cc) target_link_libraries(wordcount-part hadooppipes hadooputils) -output_directory(wordcount-part examples) +hadoop_output_directory(wordcount-part examples) add_executable(wordcount-nopipe main/native/examples/impl/wordcount-nopipe.cc) target_link_libraries(wordcount-nopipe hadooppipes hadooputils) -output_directory(wordcount-nopipe examples) +hadoop_output_directory(wordcount-nopipe examples) add_executable(pipes-sort main/native/examples/impl/sort.cc) target_link_libraries(pipes-sort hadooppipes hadooputils) -output_directory(pipes-sort examples) +hadoop_output_directory(pipes-sort examples) add_library(hadooputils STATIC main/native/utils/impl/StringUtils.cc @@ -70,15 +56,22 @@ add_library(hadooppipes STATIC main/native/pipes/impl/HadoopPipes.cc ) -INCLUDE(CheckLibraryExists) -CHECK_LIBRARY_EXISTS(dl dlopen "" NEED_LINK_DL) +include(CheckLibraryExists) +check_library_exists(dl dlopen "" NEED_LINK_DL) + +if(NEED_LINK_DL) + set(LIB_DL "dl") +endif() -if (NEED_LINK_DL) - set(LIB_DL dl) -endif (NEED_LINK_DL) +if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") + exec_program("uname" ARGS "-r" OUTPUT_VARIABLE OS_VERSION) + if(OS_VERSION VERSION_LESS "5.12") + set(LIB_NET "socket" "nsl") + endif() +endif() target_link_libraries(hadooppipes ${OPENSSL_LIBRARIES} ${LIB_DL} - pthread + ${LIB_NET} )