You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by br...@apache.org on 2013/06/12 21:17:02 UTC

[2/3] git commit: Build fix for HadoopPipes.cc with GCC 4.7.

Build fix for HadoopPipes.cc with GCC 4.7.

Review: https://reviews.apache.org/r/11113


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

Branch: refs/heads/master
Commit: c07256e3706e56e98263533c117c7b862a172bf2
Parents: 234dbcf
Author: Brenden Matthews <br...@airbnb.com>
Authored: Tue Apr 16 13:22:10 2013 -0700
Committer: Brenden Matthews <br...@airbnb.com>
Committed: Wed Jun 12 12:08:17 2013 -0700

----------------------------------------------------------------------
 hadoop/HadoopPipes.cc.patch | 10 ++++++++++
 hadoop/Makefile.am          |  3 +++
 hadoop/TUTORIAL.sh          | 43 ++++++++++++++++++++++++++++++++++++++--
 3 files changed, 54 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/c07256e3/hadoop/HadoopPipes.cc.patch
----------------------------------------------------------------------
diff --git a/hadoop/HadoopPipes.cc.patch b/hadoop/HadoopPipes.cc.patch
new file mode 100644
index 0000000..aa5df7c
--- /dev/null
+++ b/hadoop/HadoopPipes.cc.patch
@@ -0,0 +1,10 @@
+--- hadoop-2.0.0-mr1-cdh4.2.0/src/c++/pipes/impl/HadoopPipes.cc.old	2013-04-16 20:18:22.681061322 +0000
++++ hadoop-2.0.0-mr1-cdh4.2.0/src/c++/pipes/impl/HadoopPipes.cc	2013-04-16 20:18:44.005060961 +0000
+@@ -34,6 +34,7 @@
+ #include <pthread.h>
+ #include <iostream>
+ #include <fstream>
++#include <unistd.h>
+ 
+ #include <openssl/hmac.h>
+ #include <openssl/buffer.h>

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/c07256e3/hadoop/Makefile.am
----------------------------------------------------------------------
diff --git a/hadoop/Makefile.am b/hadoop/Makefile.am
index ceac085..f32f268 100644
--- a/hadoop/Makefile.am
+++ b/hadoop/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST = TUTORIAL.sh hadoop-gridmix.patch				\
   hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch					\
   hadoop-7698-1.patch							\
   hadoop-0.20.205.0_hadoop-env.sh.patch hadoop-0.20.205.0_mesos.patch	\
+  HadoopPipes.cc.patch                                                  \
   mapred-site.xml.patch mesos-executor mesos/build.xml			\
   mesos/ivy/libraries.properties mesos/ivy.xml				\
   mesos/src/java/org/apache/hadoop/mapred/MesosExecutor.java		\
@@ -67,6 +68,7 @@ hadoop-2.0.0-mr1-cdh4.1.2:
           cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.1.2_hadoop-env.sh.patch .; \
           cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.1.2_mesos.patch .; \
           cp -p $(srcdir)/mapred-site.xml.patch .; \
+          cp -p $(srcdir)/HadoopPipes.cc.patch .; \
           cp -rp $(srcdir)/mesos .; \
           cp -p $(srcdir)/mesos-executor .; \
         fi
@@ -80,6 +82,7 @@ hadoop-2.0.0-mr1-cdh4.2.0:
           cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.2.0_hadoop-env.sh.patch .; \
           cp -p $(srcdir)/hadoop-2.0.0-mr1-cdh4.2.0_mesos.patch .; \
           cp -p $(srcdir)/mapred-site.xml.patch .; \
+          cp -p $(srcdir)/HadoopPipes.cc.patch .; \
           cp -rp $(srcdir)/mesos .; \
           cp -p $(srcdir)/mesos-executor .; \
         fi

http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/c07256e3/hadoop/TUTORIAL.sh
----------------------------------------------------------------------
diff --git a/hadoop/TUTORIAL.sh b/hadoop/TUTORIAL.sh
index 2a8a2e8..aafbfdb 100755
--- a/hadoop/TUTORIAL.sh
+++ b/hadoop/TUTORIAL.sh
@@ -94,6 +94,10 @@ if test ${distribution} = "0.20.205.0"; then
     resources="${resources} hadoop-7698-1.patch"
 fi
 
+if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.0"; then
+    resources="${resources} HadoopPipes.cc.patch"
+fi
+
 for resource in `echo ${resources}`; do
     if test ! -e ${resource}; then
         cat <<__EOF__
@@ -111,7 +115,7 @@ __EOF__
     fi
 done
 
-# Make sure we have all the programs we need.
+# Make sure we have all the build tools we need.
 programs="mvn \
   ant"
 
@@ -120,7 +124,7 @@ for program in `echo ${programs}`; do
     if test "$?" != 0; then
         cat <<__EOF__
 
-${RED}We seem to be missing ${program} from the path.  Please install
+${RED}We seem to be missing ${program} from PATH.  Please install
 ${program} and re-run this tutorial.  If you still have troubles, please report
 this to:
 
@@ -515,6 +519,41 @@ if test ${REPLY} == "Y" -o ${REPLY} == "y"; then
     execute "patch -p1 <../${hadoop}_hadoop-env.sh.patch"
 fi
 
+if test ${distribution} = "2.0.0-mr1-cdh4.1.2" -o ${distribution} = "2.0.0-mr1-cdh4.2.0"; then
+    # Apply HadoopPipes.cc patch.
+    cat <<__EOF__
+
+    This version of Hadoop needs to be patched to build on GCC 4.7 and newer compilers.
+
+__EOF__
+
+    read -e -p "${BRIGHT}Hit enter to continue.${NORMAL} "
+    echo
+
+    patch --dry-run --silent --force -p1 \
+	<../HadoopPipes.cc.patch 1>/dev/null 2>&1
+
+    if test ${?} == "1"; then
+	cat <<__EOF__
+
+    ${RED}It looks like conf/hadoop-env.sh has been modified. You'll need
+    to copy that to something else and restore the file to it's original
+    contents before we'll be able to apply this patch.${NORMAL}
+
+__EOF__
+	DEFAULT="N"
+    else
+	DEFAULT="Y"
+    fi
+
+    read -e -p "${BRIGHT}Patch src/c++/pipes/impl/HadoopPipes.cc?${NORMAL} [${DEFAULT}] "
+    echo
+    test -z ${REPLY} && REPLY=${DEFAULT}
+    if test ${REPLY} == "Y" -o ${REPLY} == "y"; then
+	execute "patch -p1 <../HadoopPipes.cc.patch"
+    fi
+fi
+
 # Build Hadoop and Mesos executor package that Mesos slaves can download
 # and execute.
 # TODO(vinod): Create a new ant target in build.xml that builds the executor.