You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by na...@apache.org on 2016/06/12 20:04:58 UTC

[1/2] incubator-quickstep git commit: Add trap. Clean up usage notes.

Repository: incubator-quickstep
Updated Branches:
  refs/heads/build_script 93929f092 -> 32f51127d


Add trap. Clean up usage notes.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/7983a4a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/7983a4a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/7983a4a6

Branch: refs/heads/build_script
Commit: 7983a4a63af4b2d070aa9105b364fe2a351576e7
Parents: 93929f0
Author: Navneet <na...@cs.wisc.edu>
Authored: Sun Jun 12 14:45:14 2016 -0500
Committer: Navneet <na...@cs.wisc.edu>
Committed: Sun Jun 12 14:45:14 2016 -0500

----------------------------------------------------------------------
 build/profile_build.sh | 109 ++++++++++++++++++++++++++++----------------
 1 file changed, 69 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/7983a4a6/build/profile_build.sh
----------------------------------------------------------------------
diff --git a/build/profile_build.sh b/build/profile_build.sh
index 94631fc..369f934 100755
--- a/build/profile_build.sh
+++ b/build/profile_build.sh
@@ -11,55 +11,84 @@
 # - vmstat and mpstat 
 # sudo apt-get install -y sysstat
 #
-# Usage: ./profile_build.sh [num_parallel_jobs]
-# The number of parallel make jobs can be passed as argument to this script.
-# By default, it is the number of (virtual) CPUs on the machine (nproc).
-# Set the CMake flags you want to use below.
-#
+# Usage: ./profile_build.sh
+# Set the CMake and make command you want to use below.
+# By default, the number of parallel make jobs is equal to the number of
+# (virtual) CPUs on the machine (nproc).
 # If CMakeCache.txt is detected, the script skips cmake and runs make only.
+
+#   Copyright 2011-2015 Quickstep Technologies LLC.
+#   Copyright 2015-2016 Pivotal Software, Inc.
+#   Copyright 2016, Quickstep Research Group, Computer Sciences Department,
+#     University of Wisconsin\u2014Madison.
+#
+#   Licensed 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.
 
-NUM_JOBS=`nproc`
-if [[ "$1" != "" ]]; then 
-    NUM_JOBS=$1
-fi
+set -e
 
-echo "Starting build in " `pwd`  >> build.log
-echo 
+CMAKE_COMMAND="cmake \
+-D BUILD_SHARED_LIBS=On \
+-D USE_TCMALLOC=0 \
+-D CMAKE_BUILD_TYPE=Debug \
+.. "
+MAKE_COMMAND="make VERBOSE=1 -j `nproc`"
 
 # Continuously dump memory usage and cpu load info to files for later analysis
-rm -f stats_*.txt
-vmstat -SM 3 | ts "%.s (%H:%M:%S)" > stats_mem.txt 3>&1 &
-PID_vmstat=$!
-mpstat 3 | ts "%.s (%H:%M:%S)" > stats_cpu.txt 2>&1  &
-PID_mpstat=$!
+function start_stat_collectors {
+  rm -f stats_*.txt
+  vmstat -SM 3 | ts "%.s (%H:%M:%S)" > stats_mem.txt 3>&1 &
+  PID_vmstat=$!
+  mpstat 3 | ts "%.s (%H:%M:%S)" > stats_cpu.txt 2>&1  &
+  PID_mpstat=$!
+}
 
-START_TIME=`date +"%s"`
-if [[ ! -f CMakeCache.txt ]]; then 
-  CMAKE_COMMAND="cmake -D BUILD_SHARED_LIBS=On -D USE_TCMALLOC=0 \
-               -D CMAKE_BUILD_TYPE=Debug \
-               -D CMAKE_C_COMPILER=/usr/bin/clang -D CMAKE_CXX_COMPILER=/usr/bin/clang++ .. "
-  echo "$CMAKE_COMMAND" | tee -a build.log
-  if ! $CMAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a build.log; then exit 1; fi
-else 
-  echo "CMakeCache.txt detected. Not running CMake again."
-fi
+function kill_stat_collectors {
+  kill $PID_vmstat
+  kill $PID_mpstat
+  exit
+}
 
-MAKE_COMMAND="make VERBOSE=1 -j $NUM_JOBS"
-echo "$MAKE_COMMAND" | tee -a build.log
-if ! $MAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a build.log; then exit 1; fi
+function run_cmake {
+  if [[ ! -f CMakeCache.txt ]]; then 
+    echo "$CMAKE_COMMAND" | tee -a build.log
+    $CMAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a build.log
+  else 
+    echo "CMakeCache.txt detected. Not running CMake again."
+  fi
+}
 
-END_TIME=`date +"%s"`
+function run_make {
+  echo "$MAKE_COMMAND" | tee -a build.log
+  $MAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a build.log
+}
 
-kill $PID_vmstat
-kill $PID_mpstat
+function print_stats {
+  avg_mem=`grep -v r stats_mem.txt | tr -s ' ' | awk -F " " '{s+= $6; c++} END {print s/c/1024}'`
+  echo -e "\n\n"
+  echo "Average memory used was $avg_mem GB"  | tee -a build.log
 
-avg_mem=`grep -v r stats_mem.txt | tr -s ' ' | awk -F " " '{s+= $6; c++} END {print s/c/1024}'`
-echo
-echo
-echo "Average memory used was $avg_mem GB"  | tee -a build.log
+  time_taken=`expr $END_TIME - $START_TIME`
+  mins=`expr $time_taken / 60`
+  secs=`expr $time_taken % 60`
+  echo "Time taken was ${mins}m ${secs}s" | tee -a build.log
+}
 
-time_taken=`expr $END_TIME - $START_TIME`
-mins=`expr $time_taken / 60`
-secs=`expr $time_taken % 60`
-echo "Time taken was ${mins}m ${secs}s" | tee -a build.log
+echo "Starting build in " `pwd`  >> build.log
+start_stat_collectors
+trap kill_stat_collectors SIGHUP SIGINT SIGTERM
+START_TIME=`date +"%s"`
+run_cmake
+run_make
+END_TIME=`date +"%s"`
+kill_stat_collectors
+print_stats


[2/2] incubator-quickstep git commit: Add git repo information. Check for in-source-tree builds.

Posted by na...@apache.org.
Add git repo information. Check for in-source-tree builds.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/32f51127
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/32f51127
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/32f51127

Branch: refs/heads/build_script
Commit: 32f51127dd97d431c795395b9e52a1b80d35a09d
Parents: 7983a4a
Author: Navneet <na...@cs.wisc.edu>
Authored: Sun Jun 12 15:02:39 2016 -0500
Committer: Navneet <na...@cs.wisc.edu>
Committed: Sun Jun 12 15:02:39 2016 -0500

----------------------------------------------------------------------
 build/profile_build.sh | 39 ++++++++++++++++++++++++++++-----------
 1 file changed, 28 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/32f51127/build/profile_build.sh
----------------------------------------------------------------------
diff --git a/build/profile_build.sh b/build/profile_build.sh
index 369f934..7669327 100755
--- a/build/profile_build.sh
+++ b/build/profile_build.sh
@@ -6,15 +6,17 @@
 # All log messages are timestamped to enable profiling.
 #
 # Dependencies:
-# - ts 
+# - ts
 # sudo apt-get install -y libtime-duration-perl moreutils
-# - vmstat and mpstat 
+# - vmstat and mpstat
 # sudo apt-get install -y sysstat
 #
 # Usage: ./profile_build.sh
 # Set the CMake and make command you want to use below.
 # By default, the number of parallel make jobs is equal to the number of
 # (virtual) CPUs on the machine (nproc).
+# If CMakeLists.txt is detected, the script exits because in-source-tree build
+# is not supported.
 # If CMakeCache.txt is detected, the script skips cmake and runs make only.
 
 #   Copyright 2011-2015 Quickstep Technologies LLC.
@@ -42,6 +44,7 @@ CMAKE_COMMAND="cmake \
 -D CMAKE_BUILD_TYPE=Debug \
 .. "
 MAKE_COMMAND="make VERBOSE=1 -j `nproc`"
+LOG_FILENAME=$LOG_FILENAME
 
 # Continuously dump memory usage and cpu load info to files for later analysis
 function start_stat_collectors {
@@ -58,35 +61,49 @@ function kill_stat_collectors {
   exit
 }
 
+function check_directory {
+  if [[ -f CMakeLists.txt ]]; then
+    echo "Running the build in the source tree is not supported."
+    exit 1
+  fi
+}
+
+function log_repo_version_info {
+  git log master...
+  git diff master >> $LOG_FILENAME
+}
+
 function run_cmake {
-  if [[ ! -f CMakeCache.txt ]]; then 
-    echo "$CMAKE_COMMAND" | tee -a build.log
-    $CMAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a build.log
-  else 
+  if [[ ! -f CMakeCache.txt ]]; then
+    echo "$CMAKE_COMMAND" | tee -a $LOG_FILENAME
+    $CMAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a $LOG_FILENAME
+  else
     echo "CMakeCache.txt detected. Not running CMake again."
   fi
 }
 
 function run_make {
-  echo "$MAKE_COMMAND" | tee -a build.log
-  $MAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a build.log
+  echo "$MAKE_COMMAND" | tee -a $LOG_FILENAME
+  $MAKE_COMMAND 2>&1 | ts "%.s (%H:%M:%S)" | tee -a $LOG_FILENAME
 }
 
 function print_stats {
   avg_mem=`grep -v r stats_mem.txt | tr -s ' ' | awk -F " " '{s+= $6; c++} END {print s/c/1024}'`
   echo -e "\n\n"
-  echo "Average memory used was $avg_mem GB"  | tee -a build.log
+  echo "Average memory used was $avg_mem GB"  | tee -a $LOG_FILENAME
 
   time_taken=`expr $END_TIME - $START_TIME`
   mins=`expr $time_taken / 60`
   secs=`expr $time_taken % 60`
-  echo "Time taken was ${mins}m ${secs}s" | tee -a build.log
+  echo "Time taken was ${mins}m ${secs}s" | tee -a $LOG_FILENAME
 }
 
-echo "Starting build in " `pwd`  >> build.log
+check_directory
+echo "Starting build in " `pwd`  >> $LOG_FILENAME
 start_stat_collectors
 trap kill_stat_collectors SIGHUP SIGINT SIGTERM
 START_TIME=`date +"%s"`
+
 run_cmake
 run_make
 END_TIME=`date +"%s"`