quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nav...@apache.org
Subject [2/2] incubator-quickstep git commit: Add git repo information. Check for in-source-tree builds.
Date Sun, 12 Jun 2016 20:04:59 GMT
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 <nav@cs.wisc.edu>
Authored: Sun Jun 12 15:02:39 2016 -0500
Committer: Navneet <nav@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"`


Mime
View raw message