You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2017/01/03 22:45:11 UTC

kudu git commit: thirdparty: pass EXTRA_MAKEFLAGS in build-thirdparty.sh

Repository: kudu
Updated Branches:
  refs/heads/master be81fe60c -> bf2e6015d


thirdparty: pass EXTRA_MAKEFLAGS in build-thirdparty.sh

And allow PARALLEL to be overridden. Taken together, this makes it easier to
limit the parallelism of the thirdparty build.

The Kudu build itself needs no such mechanism as its make invocations aren't
hidden behind a shell script.

Change-Id: I69cda8e9a4a7d2ff0db1140f71ab247e14627035
Reviewed-on: http://gerrit.cloudera.org:8080/5595
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <da...@apache.org>


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

Branch: refs/heads/master
Commit: bf2e6015ddcab212201317fc7915ea87d5eb3819
Parents: be81fe6
Author: Adar Dembo <ad...@cloudera.com>
Authored: Tue Jan 3 13:58:44 2017 -0800
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Tue Jan 3 22:44:52 2017 +0000

----------------------------------------------------------------------
 thirdparty/build-definitions.sh | 37 ++++++++++++++++++------------------
 thirdparty/build-thirdparty.sh  |  6 ++++--
 2 files changed, 22 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/bf2e6015/thirdparty/build-definitions.sh
----------------------------------------------------------------------
diff --git a/thirdparty/build-definitions.sh b/thirdparty/build-definitions.sh
index 923a98b..109d715 100644
--- a/thirdparty/build-definitions.sh
+++ b/thirdparty/build-definitions.sh
@@ -91,8 +91,7 @@ build_cmake() {
   $CMAKE_SOURCE/bootstrap \
     --prefix=$PREFIX \
     --parallel=$PARALLEL
-  make -j$PARALLEL
-  make install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -107,7 +106,7 @@ build_libcxxabi() {
     -DCMAKE_CXX_FLAGS="$EXTRA_CXXFLAGS $EXTRA_LDFLAGS" \
     -DLLVM_PATH=$LLVM_SOURCE \
     $LLVM_SOURCE/projects/libcxxabi
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -136,7 +135,7 @@ build_libcxx() {
     -DLIBCXX_CXX_ABI_INCLUDE_PATHS=$LLVM_SOURCE/projects/libcxxabi/include \
     -DLLVM_USE_SANITIZER=$SANITIZER_TYPE \
     $LLVM_SOURCE/projects/libcxx
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -155,7 +154,7 @@ build_or_find_python() {
     mkdir -p $PYTHON_BDIR
     pushd $PYTHON_BDIR
     $PYTHON_SOURCE/configure
-    make -j$PARALLEL
+    make -j$PARALLEL $EXTRA_MAKEFLAGS
     PYTHON_EXECUTABLE="$PYTHON_BDIR/python"
     popd
   fi
@@ -219,7 +218,7 @@ build_llvm() {
     $TOOLS_ARGS \
     $LLVM_SOURCE
 
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
 
   if [[ "$BUILD_TYPE" == "normal" ]]; then
     # Create a link from Clang to thirdparty/clang-toolchain. This path is used
@@ -245,7 +244,7 @@ build_gflags() {
     -DBUILD_SHARED_LIBS=On \
     -DBUILD_STATIC_LIBS=On \
     $GFLAGS_SOURCE
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -259,7 +258,7 @@ build_libunwind() {
     --disable-minidebuginfo \
     --with-pic \
     --prefix=$PREFIX
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -288,7 +287,7 @@ build_glog() {
     --prefix=$PREFIX \
     --with-gflags=$PREFIX
   fixup_libtool
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -306,7 +305,7 @@ build_gperftools() {
     --with-pic \
     --prefix=$PREFIX
   fixup_libtool
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -328,7 +327,7 @@ build_gmock() {
       -DCMAKE_POSITION_INDEPENDENT_CODE=On \
       -DBUILD_SHARED_LIBS=$SHARED \
       $GMOCK_SOURCE
-    make -j$PARALLEL
+    make -j$PARALLEL $EXTRA_MAKEFLAGS
     popd
   done
   echo Installing gmock...
@@ -352,7 +351,7 @@ build_protobuf() {
     --enable-static \
     --prefix=$PREFIX
   fixup_libtool
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -368,7 +367,7 @@ build_snappy() {
     --with-pic \
     --prefix=$PREFIX
   fixup_libtool
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -384,7 +383,7 @@ build_zlib() {
   CFLAGS="$EXTRA_CFLAGS -fPIC" \
     ./configure \
     --prefix=$PREFIX
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -398,7 +397,7 @@ build_lz4() {
     -DBUILD_TOOLS=0 \
     -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX \
     $LZ4_SOURCE/cmake_unofficial
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -462,7 +461,7 @@ build_libev() {
     $LIBEV_SOURCE/configure \
     --with-pic \
     --prefix=$PREFIX
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -510,7 +509,7 @@ build_curl() {
     --disable-tftp \
     --without-librtmp \
     --without-ssl
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -531,7 +530,7 @@ build_crcutil() {
     ./configure \
     --prefix=$PREFIX
   fixup_libtool
-  make -j$PARALLEL install
+  make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }
 
@@ -571,7 +570,7 @@ build_nvml() {
     # Add PREFIX/lib to the rpath; libpmemobj depends on libpmem at runtime.
     EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-error" \
       EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-rpath,$PREFIX/lib" \
-      make -j$PARALLEL $LIB DEBUG=0
+      make -j$PARALLEL $EXTRA_MAKEFLAGS DEBUG=0 $LIB
 
     # NVML doesn't allow configuring PREFIX -- it always installs into
     # DESTDIR/usr/lib. Additionally, the 'install' target builds all of

http://git-wip-us.apache.org/repos/asf/kudu/blob/bf2e6015/thirdparty/build-thirdparty.sh
----------------------------------------------------------------------
diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index 7fdd64d..5626633 100755
--- a/thirdparty/build-thirdparty.sh
+++ b/thirdparty/build-thirdparty.sh
@@ -33,6 +33,8 @@
 #   * EXTRA_CXXFLAGS - additional flags passed to the C++ compiler.
 #   * EXTRA_LDFLAGS - additional flags passed to the linker.
 #   * EXTRA_LIBS - additional libraries to link.
+#   * EXTRA_MAKEFLAGS - additional flags passed to make.
+#   * PARALLEL - parallelism to use when compiling (defaults to number of cores).
 
 set -ex
 
@@ -129,11 +131,11 @@ EXTRA_CXXFLAGS="-fno-omit-frame-pointer -O2 $EXTRA_CXXFLAGS"
 if [[ "$OSTYPE" =~ ^linux ]]; then
   OS_LINUX=1
   DYLIB_SUFFIX="so"
-  PARALLEL=$(grep -c processor /proc/cpuinfo)
+  PARALLEL=${PARALLEL:-$(grep -c processor /proc/cpuinfo)}
 elif [[ "$OSTYPE" == "darwin"* ]]; then
   OS_OSX=1
   DYLIB_SUFFIX="dylib"
-  PARALLEL=$(sysctl -n hw.ncpu)
+  PARALLEL=${PARALLEL:-$(sysctl -n hw.ncpu)}
 
   # Kudu builds with C++11, which on OS X requires using libc++ as the standard
   # library implementation. Some of the dependencies do not compile against