You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2019/12/09 14:29:46 UTC

[mesos] branch master updated: Used CMake's automatic parallelization in mesos-tidy setup.

This is an automated email from the ASF dual-hosted git repository.

bbannier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 0bf3646  Used CMake's automatic parallelization in mesos-tidy setup.
0bf3646 is described below

commit 0bf3646174e02062abc5170e5f0c68376f1ced96
Author: Benjamin Bannier <bb...@apache.org>
AuthorDate: Mon Dec 9 15:28:58 2019 +0100

    Used CMake's automatic parallelization in mesos-tidy setup.
    
    Since the `--parallel` flag for `cmake build` is only supported in more
    recent CMake versions we bump the installed version to the latest
    release.
    
    Review: https://reviews.apache.org/r/71852/
---
 support/mesos-tidy/Dockerfile    |  2 +-
 support/mesos-tidy/entrypoint.sh | 38 +++++++++++++++++++++-----------------
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/support/mesos-tidy/Dockerfile b/support/mesos-tidy/Dockerfile
index 7d17a82..90836cf 100644
--- a/support/mesos-tidy/Dockerfile
+++ b/support/mesos-tidy/Dockerfile
@@ -34,7 +34,7 @@ RUN apt-get update && \
 #
 # TODO(abudnik): Skip this step when a newer version of CMake package is
 # available in OS repository.
-RUN curl -sSL https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.sh \
+RUN curl -sSL https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.sh \
     -o /tmp/install-cmake.sh && \
     sh /tmp/install-cmake.sh --skip-license --prefix=/usr/local
 
diff --git a/support/mesos-tidy/entrypoint.sh b/support/mesos-tidy/entrypoint.sh
index 7d2225d..876ab29 100755
--- a/support/mesos-tidy/entrypoint.sh
+++ b/support/mesos-tidy/entrypoint.sh
@@ -33,39 +33,43 @@ cmake -DCMAKE_BUILD_TYPE=Release \
       ${CMAKE_ARGS} \
       "${SRCDIR}"
 
+# Set up CMake to run as many parallel build process as we have cores instead
+# of relying on the default parallelism of the particular build tool.
+CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
+
 # Build the external dependencies.
 # TODO(mpark): Use an external dependencies target once MESOS-6924 is resolved.
-cmake --build 3rdparty --target boost-1.65.0 -- -j $(nproc)
-cmake --build 3rdparty --target elfio-3.2 -- -j $(nproc)
-cmake --build 3rdparty --target glog-0.4.0 -- -j $(nproc)
-cmake --build 3rdparty --target googletest-1.8.0 -- -j $(nproc)
-cmake --build 3rdparty --target grpc-1.10.0 -- -j $(nproc)
-cmake --build 3rdparty --target http_parser-2.6.2 -- -j $(nproc)
+cmake --build 3rdparty --parallel --target boost-1.65.0
+cmake --build 3rdparty --parallel --target elfio-3.2
+cmake --build 3rdparty --parallel --target glog-0.4.0
+cmake --build 3rdparty --parallel --target googletest-1.8.0
+cmake --build 3rdparty --parallel --target grpc-1.10.0
+cmake --build 3rdparty --parallel --target http_parser-2.6.2
 
 # TODO(mpark): The `|| true` is a hack to try both `libev` and `libevent` and
 #              use whichever one happens to be configured. This would also go
 #              away with MESOS-6924.
-cmake --build 3rdparty --target libev-4.22 -- -j $(nproc) || true
-cmake --build 3rdparty --target libevent-2.1.5-beta -- -j $(nproc) || true
+cmake --build 3rdparty --parallel --target libev-4.22 || true
+cmake --build 3rdparty --parallel --target libevent-2.1.5-beta || true
 
-cmake --build 3rdparty --target leveldb-1.19 -- -j $(nproc)
-cmake --build 3rdparty --target nvml-352.79 -- -j $(nproc)
-cmake --build 3rdparty --target picojson-1.3.0 -- -j $(nproc)
-cmake --build 3rdparty --target protobuf-3.5.0 -- -j $(nproc)
-cmake --build 3rdparty --target zookeeper-3.4.8 -- -j $(nproc)
+cmake --build 3rdparty --parallel --target leveldb-1.19
+cmake --build 3rdparty --parallel --target nvml-352.79
+cmake --build 3rdparty --parallel --target picojson-1.3.0
+cmake --build 3rdparty --parallel --target protobuf-3.5.0
+cmake --build 3rdparty --parallel --target zookeeper-3.4.8
 
 # Generate the protobuf definitions.
 # TODO(mpark): Use a protobuf generation target once MESOS-6925 is resolved.
-cmake --build . --target mesos-protobufs -- -j $(nproc)
+cmake --build . --parallel --target mesos-protobufs
 
 # For protobuf definitions in stout (`protobuf-test.pb.h`) or
 # libprocess (`grpc_tests.pb.h`, `grpc_tests.grpc.pb.h` and `benchmarks.pb.h`)
 # no explict targets exists; we instead build the executable targets to produce
 # them as a side-effect. This is pretty hacky for what we want to do, but it's
 # okay for now.
-cmake --build 3rdparty/stout/tests --target stout-tests -- -j $(nproc)
-cmake --build 3rdparty/libprocess/src/tests --target libprocess-tests -- -j $(nproc)
-cmake --build 3rdparty/libprocess/src/tests --target benchmarks -- -j $(nproc)
+cmake --build 3rdparty/stout/tests --parallel --target stout-tests
+cmake --build 3rdparty/libprocess/src/tests --parallel --target libprocess-tests
+cmake --build 3rdparty/libprocess/src/tests --parallel --target benchmarks
 
 # TODO(bbannier): Use a less restrictive `grep` pattern and `header-filter`
 # once MESOS-6115 is fixed.